Go to the documentation of this file.
160 #define HAL_COMP_ERROR_NONE ((uint32_t)0x00000000)
161 #define HAL_COMP_ERROR_TIMEOUT ((uint32_t)0x00000001)
162 #define HAL_COMP_ERROR_INVALID_PARAM ((uint32_t)0x00000002)
169 #define COMP_INPUT_SRC_IO0 LL_COMP_INPUT_SRC_IO0
170 #define COMP_INPUT_SRC_IO1 LL_COMP_INPUT_SRC_IO1
171 #define COMP_INPUT_SRC_IO2 LL_COMP_INPUT_SRC_IO2
172 #define COMP_INPUT_SRC_IO3 LL_COMP_INPUT_SRC_IO3
173 #define COMP_INPUT_SRC_IO4 LL_COMP_INPUT_SRC_IO4
174 #define COMP_INPUT_SRC_IO5 LL_COMP_INPUT_SRC_IO5
175 #define COMP_INPUT_SRC_IO6 LL_COMP_INPUT_SRC_IO6
176 #define COMP_INPUT_SRC_IO7 LL_COMP_INPUT_SRC_IO7
177 #define COMP_INPUT_SRC_VBAT LL_COMP_INPUT_SRC_VBAT
178 #define COMP_INPUT_SRC_VREF LL_COMP_INPUT_SRC_VREF
184 #define COMP_REF_SRC_IO0 LL_COMP_REF_SRC_IO0
185 #define COMP_REF_SRC_IO1 LL_COMP_REF_SRC_IO1
186 #define COMP_REF_SRC_IO2 LL_COMP_REF_SRC_IO2
187 #define COMP_REF_SRC_IO3 LL_COMP_REF_SRC_IO3
188 #define COMP_REF_SRC_IO4 LL_COMP_REF_SRC_IO4
189 #define COMP_REF_SRC_IO5 LL_COMP_REF_SRC_IO5
190 #define COMP_REF_SRC_IO6 LL_COMP_REF_SRC_IO6
191 #define COMP_REF_SRC_IO7 LL_COMP_REF_SRC_IO7
192 #define COMP_REF_SRC_VBAT LL_COMP_REF_SRC_VBAT
193 #define COMP_REF_SRC_VREF LL_COMP_REF_SRC_VREF
199 #define COMP_HYST_POSITIVE LL_COMP_HYST_POSITIVE
200 #define COMP_HYST_NEGATIVE LL_COMP_HYST_NEGATIVE
206 #define COMP_WAKEUP_EDGE_BOTH LL_COMP_WAKEUP_EDGE_BOTH
207 #define COMP_WAKEUP_EDGE_FALLING LL_COMP_WAKEUP_EDGE_FALLING
208 #define COMP_WAKEUP_EDGE_RISING LL_COMP_WAKEUP_EDGE_RISING
214 #define COMP_RES_DEGENERATION_POSITIVE LL_COMP_RES_DEGENERATION_POSITIVE
215 #define COMP_RES_DEGENERATION_NEGATIVE LL_COMP_RES_DEGENERATION_NEGATIVE
221 #define COMP_DEFAULT_CONFIG LL_COMP_DEFAULT_CONFIG
234 #define IS_COMP_INPUT(__INPUT__) (((__INPUT__) == COMP_INPUT_SRC_IO0) || \
235 ((__INPUT__) == COMP_INPUT_SRC_IO1) || \
236 ((__INPUT__) == COMP_INPUT_SRC_IO2) || \
237 ((__INPUT__) == COMP_INPUT_SRC_IO3) || \
238 ((__INPUT__) == COMP_INPUT_SRC_IO4) || \
239 ((__INPUT__) == COMP_INPUT_SRC_IO5) || \
240 ((__INPUT__) == COMP_INPUT_SRC_IO6) || \
241 ((__INPUT__) == COMP_INPUT_SRC_IO7) || \
242 ((__INPUT__) == COMP_INPUT_SRC_VBAT)|| \
243 ((__INPUT__) == COMP_INPUT_SRC_VREF))
250 #define IS_COMP_REF(__INPUT__) (((__INPUT__) == COMP_REF_SRC_IO0) || \
251 ((__INPUT__) == COMP_REF_SRC_IO1) || \
252 ((__INPUT__) == COMP_REF_SRC_IO2) || \
253 ((__INPUT__) == COMP_REF_SRC_IO3) || \
254 ((__INPUT__) == COMP_REF_SRC_IO4) || \
255 ((__INPUT__) == COMP_REF_SRC_IO5) || \
256 ((__INPUT__) == COMP_REF_SRC_IO6) || \
257 ((__INPUT__) == COMP_REF_SRC_IO7) || \
258 ((__INPUT__) == COMP_REF_SRC_VBAT) || \
259 ((__INPUT__) == COMP_REF_SRC_VREF))
266 #define IS_COMP_HYST_POS(__INPUT__) ((__INPUT__) == COMP_HYST_POSITIVE)
273 #define IS_COMP_HYST_NEG(__INPUT__) ((__INPUT__) == COMP_HYST_NEGATIVE )
280 #define IS_COMP_RES_DEGENERATION_POS(__INPUT__) ((__INPUT__) == COMP_RES_DEGENERATION_POSITIVE)
287 #define IS_COMP_RES_DEGENERATION_NEG(__INPUT__) ((__INPUT__) == COMP_RES_DEGENERATION_NEGATIVE )
void hal_comp_irq_handler(comp_handle_t *p_comp)
Handle COMP interrupt request.
void hal_comp_rising_trigger_callback(comp_handle_t *p_comp)
comparator rising callback.
hal_status_t hal_comp_init(comp_handle_t *p_comp)
Initialize the COMP according to the specified parameters in the comp_init_t and initialize the assoc...
uint32_t hal_comp_get_error(const comp_handle_t *p_comp)
Return the COMP error code.
HAL COMP Callback function definition.
hal_status_t hal_comp_resume_reg(comp_handle_t *p_comp)
Restore some registers related to COMP configuration after sleep. This function must be used in conju...
hal_comp_state_t
HAL COMP State Enumerations definition.
LL COMP init Structure definition.
void hal_comp_falling_trigger_callback(comp_handle_t *p_comp)
comparator rising callback.
void(* comp_msp_deinit)(comp_handle_t *p_comp)
COMP handle Structure definition.
void(* comp_falling_trigger_callback)(comp_handle_t *p_comp)
ll_comp_init_t comp_init_t
COMP init structure definition.
struct _comp_handle comp_handle_t
COMP handle Structure definition.
struct _hal_comp_callback hal_comp_callback_t
HAL COMP Callback function definition.
hal_status_t hal_comp_stop(comp_handle_t *p_comp)
Stop the comparator.
void(* comp_rising_trigger_callback)(comp_handle_t *p_comp)
hal_comp_state_t hal_comp_get_state(const comp_handle_t *p_comp)
Return the COMP handle state.
hal_status_t
HAL Status structures definition.
This file contains HAL common definitions, enumeration, macros and structures definitions.
void hal_comp_msp_init(comp_handle_t *p_comp)
Initialize the COMP MSP.
hal_status_t hal_comp_suspend_reg(comp_handle_t *p_comp)
Suspend some registers related to COMP configuration before sleep.
Header file containing functions prototypes of COMP LL library.
void hal_comp_msp_deinit(comp_handle_t *p_comp)
De-initialize the COMP MSP.
void(* comp_msp_init)(comp_handle_t *p_comp)
hal_status_t hal_comp_deinit(comp_handle_t *p_comp)
De-initialize the COMP peripheral.
hal_status_t hal_comp_start(comp_handle_t *p_comp)
Start the comparator.
__IO hal_comp_state_t state