Go to the documentation of this file.
52 #ifndef __GR55xx_HAL_COMP_H__
53 #define __GR55xx_HAL_COMP_H__
161 #define HAL_COMP_ERROR_NONE ((uint32_t)0x00000000)
162 #define HAL_COMP_ERROR_TIMEOUT ((uint32_t)0x00000001)
163 #define HAL_COMP_ERROR_INVALID_PARAM ((uint32_t)0x00000002)
170 #define COMP_INPUT_SRC_IO0 LL_COMP_INPUT_SRC_IO0
171 #define COMP_INPUT_SRC_IO1 LL_COMP_INPUT_SRC_IO1
172 #define COMP_INPUT_SRC_IO2 LL_COMP_INPUT_SRC_IO2
173 #define COMP_INPUT_SRC_IO3 LL_COMP_INPUT_SRC_IO3
174 #define COMP_INPUT_SRC_IO4 LL_COMP_INPUT_SRC_IO4
180 #define COMP_REF_SRC_IO0 LL_COMP_REF_SRC_IO0
181 #define COMP_REF_SRC_IO1 LL_COMP_REF_SRC_IO1
182 #define COMP_REF_SRC_IO2 LL_COMP_REF_SRC_IO2
183 #define COMP_REF_SRC_IO3 LL_COMP_REF_SRC_IO3
184 #define COMP_REF_SRC_IO4 LL_COMP_REF_SRC_IO4
185 #define COMP_REF_SRC_VBAT LL_COMP_REF_SRC_VBAT
186 #define COMP_REF_SRC_VREF LL_COMP_REF_SRC_VREF
192 #define COMP_DEFAULT_CONFIG LL_COMP_DEFAULT_CONFIG
205 #define IS_COMP_INPUT(__INPUT__) (((__INPUT__) == COMP_INPUT_SRC_IO0) || \
206 ((__INPUT__) == COMP_INPUT_SRC_IO1) || \
207 ((__INPUT__) == COMP_INPUT_SRC_IO2) || \
208 ((__INPUT__) == COMP_INPUT_SRC_IO3) || \
209 ((__INPUT__) == COMP_INPUT_SRC_IO4))
216 #define IS_COMP_REF(__INPUT__) (((__INPUT__) == COMP_REF_SRC_IO0) || \
217 ((__INPUT__) == COMP_REF_SRC_IO1) || \
218 ((__INPUT__) == COMP_REF_SRC_IO2) || \
219 ((__INPUT__) == COMP_REF_SRC_IO3) || \
220 ((__INPUT__) == COMP_REF_SRC_IO4) || \
221 ((__INPUT__) == COMP_REF_SRC_VBAT) || \
222 ((__INPUT__) == COMP_REF_SRC_VREF))
void hal_comp_irq_handler(comp_handle_t *p_comp)
Handle COMP interrupt request.
hal_lock_t
HAL Lock structures definition.
void(* comp_msp_deinit)(comp_handle_t *p_comp)
HAL COMP Callback function definition.
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(comp_handle_t *p_comp)
Return the COMP error code.
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...
void(* comp_trigger_callback)(comp_handle_t *p_comp)
hal_comp_state_t
HAL COMP State Enumerations definition.
LL COMP init Structure definition.
void(* comp_msp_init)(comp_handle_t *p_comp)
hal_comp_state_t hal_comp_get_state(comp_handle_t *p_comp)
Return the COMP handle state.
COMP handle Structure definition.
ll_comp_init_t comp_init_t
COMP init structure definition.
struct _comp_handle comp_handle_t
COMP handle Structure definition.
hal_status_t hal_comp_stop(comp_handle_t *p_comp)
Stop the comparator.
struct _comp_callback comp_callback_t
HAL COMP Callback function definition.
hal_status_t
HAL Status structures definition.
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.
void hal_comp_trigger_callback(comp_handle_t *p_comp)
comparator callback.
void hal_comp_msp_deinit(comp_handle_t *p_comp)
De-initialize the COMP MSP.
hal_status_t hal_comp_deinit(comp_handle_t *p_comp)
De-initialize the COMP peripheral.
This file contains HAL common definitions, enumeration, macros and structures definitions.
Header file containing functions prototypes of COMP LL library.
hal_status_t hal_comp_start(comp_handle_t *p_comp)
Start the comparator.
__IO hal_comp_state_t state