drv_acmp.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2011-02-23 onelife Initial creation for EFM32
  9. * 2011-06-17 onelife Modify for efm32lib v2 upgrading
  10. */
  11. #ifndef __DRV_ACMP_H__
  12. #define __DRV_ACMP_H__
  13. /* Includes ------------------------------------------------------------------*/
  14. #include "hdl_interrupt.h"
  15. /* Exported types ------------------------------------------------------------*/
  16. struct efm32_acmp_device_t
  17. {
  18. ACMP_TypeDef *acmp_device;
  19. efm32_irq_hook_t hook;
  20. };
  21. struct efm32_acmp_output_t
  22. {
  23. rt_uint32_t location;
  24. rt_bool_t enable;
  25. rt_bool_t invert;
  26. };
  27. struct efm32_acmp_control_t
  28. {
  29. ACMP_Init_TypeDef *init;
  30. ACMP_Channel_TypeDef posInput;
  31. ACMP_Channel_TypeDef negInput;
  32. struct efm32_acmp_output_t *output;
  33. efm32_irq_hook_t hook;
  34. };
  35. /* Exported constants --------------------------------------------------------*/
  36. /* Exported macro ------------------------------------------------------------*/
  37. /* Exported functions ------------------------------------------------------- */
  38. void rt_hw_acmp_init(void);
  39. #endif /*__DRV_ACMP_H__ */