drv_acmp.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /***************************************************************************//**
  2. * @file drv_acmp.h
  3. * @brief ACMP (analog comparator) 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-02-23 onelife Initial creation for EFM32
  15. * 2011-06-17 onelife Modify for efm32lib v2 upgrading
  16. ******************************************************************************/
  17. #ifndef __DRV_ACMP_H__
  18. #define __DRV_ACMP_H__
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "hdl_interrupt.h"
  21. /* Exported types ------------------------------------------------------------*/
  22. struct efm32_acmp_device_t
  23. {
  24. ACMP_TypeDef *acmp_device;
  25. efm32_irq_hook_t hook;
  26. };
  27. struct efm32_acmp_output_t
  28. {
  29. rt_uint32_t location;
  30. rt_bool_t enable;
  31. rt_bool_t invert;
  32. };
  33. struct efm32_acmp_control_t
  34. {
  35. ACMP_Init_TypeDef *init;
  36. ACMP_Channel_TypeDef posInput;
  37. ACMP_Channel_TypeDef negInput;
  38. struct efm32_acmp_output_t *output;
  39. efm32_irq_hook_t hook;
  40. };
  41. /* Exported constants --------------------------------------------------------*/
  42. /* Exported macro ------------------------------------------------------------*/
  43. /* Exported functions ------------------------------------------------------- */
  44. void rt_hw_acmp_init(void);
  45. #endif /*__DRV_ACMP_H__ */