timer_if.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //*****************************************************************************
  2. #ifndef __TIMER_IF_H__
  3. #define __TIMER_IF_H__
  4. //*****************************************************************************
  5. //
  6. // If building with a C++ compiler, make all of the definitions in this header
  7. // have a C binding.
  8. //
  9. //*****************************************************************************
  10. #ifdef __cplusplus
  11. extern "C"
  12. {
  13. #endif
  14. /****************************************************************************/
  15. /* MACROS */
  16. /****************************************************************************/
  17. #define SYS_CLK 80000000
  18. #define MILLISECONDS_TO_TICKS(ms) ((SYS_CLK/1000) * (ms))
  19. #define PERIODIC_TEST_LOOPS 5
  20. extern void Timer_IF_Init( unsigned long ePeripheralc, unsigned long ulBase,
  21. unsigned long ulConfig, unsigned long ulTimer, unsigned long ulValue);
  22. extern void Timer_IF_IntSetup(unsigned long ulBase, unsigned long ulTimer,
  23. void (*TimerBaseIntHandler)(void));
  24. extern void Timer_IF_InterruptClear(unsigned long ulBase);
  25. extern void Timer_IF_Start(unsigned long ulBase, unsigned long ulTimer,
  26. unsigned long ulValue);
  27. extern void Timer_IF_Stop(unsigned long ulBase, unsigned long ulTimer);
  28. extern void Timer_IF_ReLoad(unsigned long ulBase, unsigned long ulTimer,
  29. unsigned long ulValue);
  30. extern unsigned int Timer_IF_GetCount(unsigned long ulBase, unsigned long ulTimer);
  31. void Timer_IF_DeInit(unsigned long ulBase,unsigned long ulTimer);
  32. //*****************************************************************************
  33. //
  34. // Mark the end of the C bindings section for C++ compilers.
  35. //
  36. //*****************************************************************************
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif // __TIMER_IF_H__