drv_timer.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /***************************************************************************//**
  2. * @file drv_timer.h
  3. * @brief Timer driver of RT-Thread RTOS for EFM32
  4. * COPYRIGHT (C) 2012, RT-Thread Development Team
  5. * @author onelife
  6. * @version 1.0
  7. *******************************************************************************
  8. * @section License
  9. * The license and distribution terms for this file may be found in the file
  10. * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
  11. *******************************************************************************
  12. * @section Change Logs
  13. * Date Author Notes
  14. * 2011-01-18 onelife Initial creation for EFM32
  15. ******************************************************************************/
  16. #ifndef __DRV_TIMER_H__
  17. #define __DRV_TIMER_H__
  18. /* Includes ------------------------------------------------------------------*/
  19. #include "hdl_interrupt.h"
  20. /* Exported types ------------------------------------------------------------*/
  21. struct efm32_timer_device_t
  22. {
  23. TIMER_TypeDef *timer_device;
  24. efm32_irq_hook_t hook;
  25. };
  26. struct efm32_timer_control_t
  27. {
  28. rt_uint32_t period;
  29. efm32_irq_hook_t hook;
  30. };
  31. /* Exported constants --------------------------------------------------------*/
  32. /* Exported macro ------------------------------------------------------------*/
  33. #define TMR_MODE_ONESHOT (true)
  34. #define TMR_MODE_CONTINUOUS (false)
  35. #define TMR_CFG_PRESCALER timerPrescale1024
  36. /* Exported functions ------------------------------------------------------- */
  37. void rt_hw_timer_init(void);
  38. #endif /*__DRV_TIMER_H__ */