app_comp.h
Go to the documentation of this file.
1 
52 #ifndef _APP_COMP_H_
53 #define _APP_COMP_H_
54 
55 #include "gr55xx_hal.h"
56 #include "app_drv_error.h"
57 #include "app_io.h"
58 #ifdef ENV_USE_FREERTOS
59 #include "app_rtos_cfg.h"
60 #endif
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 #ifdef HAL_COMP_MODULE_ENABLED
67 
74 typedef enum
75 {
76  APP_COMP_EVT_DONE,
77  APP_COMP_EVT_ERROR
88 typedef struct
89 {
92  uint32_t pin;
95 
99 typedef struct
100 {
104 
108 typedef struct
109 {
113 
117 typedef void (*app_comp_evt_handler_t)(app_comp_evt_t *p_evt);
122 /* Exported functions --------------------------------------------------------*/
138 uint16_t app_comp_init(app_comp_params_t *p_params, app_comp_evt_handler_t evt_handler);
139 
147 uint16_t app_comp_deinit(void);
148 
156 uint16_t app_comp_start(void);
157 
165 uint16_t app_comp_stop(void);
166 
175 
176 #ifdef ENV_RTOS_USE_SEMP
177 
185 uint16_t app_comp_sem_start(void);
186 
187 #endif
188 
191 #endif
192 
193 #ifdef __cplusplus
194 }
195 #endif
196 
197 #endif
198 
app_comp_evt_handler_t
void(* app_comp_evt_handler_t)(app_comp_evt_t *p_evt)
COMP event callback definition.
Definition: app_comp.h:117
app_comp_stop
uint16_t app_comp_stop(void)
Stop the comparator.
app_comp_get_handle
comp_handle_t * app_comp_get_handle(void)
Return the COMP handle.
_ll_comp_init
LL COMP init Structure definition.
Definition: gr55xx_ll_comp.h:77
app_io_type_t
app_io_type_t
GPIO type Enumerations definition.
Definition: app_io.h:141
_comp_handle
COMP handle Structure definition.
Definition: gr55xx_hal_comp.h:109
app_comp_params_t::pin_cfg
app_comp_pin_cfg_t pin_cfg
Definition: app_comp.h:110
app_io.h
Header file containing functions prototypes of GPIO app library.
app_comp_pin_t
COMP pins Structures.
Definition: app_comp.h:89
app_comp_pin_t::mux
app_io_mux_t mux
Definition: app_comp.h:91
app_comp_deinit
uint16_t app_comp_deinit(void)
De-initialize the APP COMP DRIVER peripheral.
app_comp_start
uint16_t app_comp_start(void)
Start the comparator.
app_comp_pin_cfg_t::vref
app_comp_pin_t vref
Definition: app_comp.h:102
gr55xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_comp_params_t::init
comp_init_t init
Definition: app_comp.h:111
app_comp_init
uint16_t app_comp_init(app_comp_params_t *p_params, app_comp_evt_handler_t evt_handler)
Initialize the APP COMP DRIVER according to the specified parameters in the app_comp_params_t and app...
app_comp_evt_t
app_comp_evt_t
COMP event Enumerations definition.
Definition: app_comp.h:75
app_comp_pin_cfg_t
COMP pins config Structures.
Definition: app_comp.h:100
app_io_mux_t
app_io_mux_t
GPIO mux Enumerations definition.
Definition: app_io.h:198
app_rtos_cfg.h
Header file of app rtos config code.
app_drv_error.h
Header file of app driver error code.
app_comp_params_t
COMP parameters structure definition.
Definition: app_comp.h:109
app_comp_pin_t::type
app_io_type_t type
Definition: app_comp.h:90
app_comp_pin_cfg_t::input
app_comp_pin_t input
Definition: app_comp.h:101
app_comp_pin_t::pin
uint32_t pin
Definition: app_comp.h:92