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 12 #ifndef __DRV_ACMP_H__ 13 #define __DRV_ACMP_H__ 14 15 /* Includes ------------------------------------------------------------------*/ 16 #include "hdl_interrupt.h" 17 18 /* Exported types ------------------------------------------------------------*/ 19 struct efm32_acmp_device_t 20 { 21 ACMP_TypeDef *acmp_device; 22 efm32_irq_hook_t hook; 23 }; 24 25 struct efm32_acmp_output_t 26 { 27 rt_uint32_t location; 28 rt_bool_t enable; 29 rt_bool_t invert; 30 }; 31 32 struct efm32_acmp_control_t 33 { 34 ACMP_Init_TypeDef *init; 35 ACMP_Channel_TypeDef posInput; 36 ACMP_Channel_TypeDef negInput; 37 struct efm32_acmp_output_t *output; 38 efm32_irq_hook_t hook; 39 }; 40 41 /* Exported constants --------------------------------------------------------*/ 42 /* Exported macro ------------------------------------------------------------*/ 43 /* Exported functions ------------------------------------------------------- */ 44 void rt_hw_acmp_init(void); 45 46 #endif /*__DRV_ACMP_H__ */ 47