gr55xx_hal_comp.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file gr55xx_hal_comp.h
5  * @author BLE Driver Team
6  * @brief Header file containing functions prototypes of COMP HAL library.
7  *
8  ****************************************************************************************
9  * @attention
10  #####Copyright (c) 2019 GOODIX
11  All rights reserved.
12 
13  Redistribution and use in source and binary forms, with or without
14  modification, are permitted provided that the following conditions are met:
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17  * Redistributions in binary form must reproduce the above copyright
18  notice, this list of conditions and the following disclaimer in the
19  documentation and/or other materials provided with the distribution.
20  * Neither the name of GOODIX nor the names of its contributors may be used
21  to endorse or promote products derived from this software without
22  specific prior written permission.
23 
24  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  POSSIBILITY OF SUCH DAMAGE.
35  ****************************************************************************************
36  */
37 
38 /** @addtogroup PERIPHERAL Peripheral Driver
39  * @{
40  */
41 
42 /** @addtogroup HAL_DRIVER HAL Driver
43  * @{
44  */
45 
46 /** @defgroup HAL_COMP COMP
47  * @brief COMP HAL module driver.
48  * @{
49  */
50 
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_COMP_H__
53 #define __GR55xx_HAL_COMP_H__
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_ll_comp.h"
61 #include "gr55xx_hal_def.h"
62 
63 /* Exported types ------------------------------------------------------------*/
64 /** @addtogroup HAL_COMP_ENUMERATIONS Enumerations
65  * @{
66  */
67 
68 /** @defgroup HAL_COMP_state HAL COMP state
69  * @{
70  */
71 
72 /**
73  * @brief HAL COMP State Enumerations definition
74  */
75 typedef enum
76 {
77  HAL_COMP_STATE_RESET = 0x00, /**< Peripheral not initialized */
78  HAL_COMP_STATE_READY = 0x01, /**< Peripheral initialized and ready for use */
79  HAL_COMP_STATE_BUSY = 0x02, /**< An internal process is ongoing */
80  HAL_COMP_STATE_ERROR = 0x04 /**< Peripheral in error */
82 
83 /** @} */
84 
85 /** @} */
86 
87 /** @addtogroup HAL_COMP_STRUCTURES Structures
88  * @{
89  */
90 
91 /** @defgroup COMP_Configuration COMP Configuration
92  * @{
93  */
94 
95 /**
96  * @brief COMP init structure definition
97  */
99 /** @} */
100 
101 /** @defgroup COMP_handle COMP handle
102  * @{
103  */
104 
105 /**
106  * @brief COMP handle Structure definition
107  */
108 typedef struct _comp_handle
109 {
110  comp_init_t init; /**< COMP configuration parameters */
111 
112  __IO hal_lock_t lock; /**< Locking object */
113 
114  __IO hal_comp_state_t state; /**< COMP communication state */
115 
116  __IO uint32_t error_code; /**< COMP error code */
117 
118  uint32_t retention[1]; /**< COMP important register information. */
119 
121 /** @} */
122 
123 /** @} */
124 
125 /** @addtogroup HAL_COMP_CALLBACK_STRUCTURES Callback Structures
126  * @{
127  */
128 
129 /** @defgroup COMP_Callback COMP Callback
130  * @{
131  */
132 
133 /**
134  * @brief HAL COMP Callback function definition
135  */
136 typedef struct _comp_callback
137 {
138  void (*comp_msp_init)(comp_handle_t *p_comp); /**< COMP init MSP callback */
139  void (*comp_msp_deinit)(comp_handle_t *p_comp); /**< COMP de-init MSP callback */
140  void (*comp_rising_trigger_callback)(comp_handle_t *p_comp); /**< COMP rising trigger callback */
141  void (*comp_falling_trigger_callback)(comp_handle_t *p_comp); /**< COMP falling trigger callback */
143 
144 /** @} */
145 
146 /** @} */
147 
148 
149 /**
150  * @defgroup HAL_COMP_MACRO Defines
151  * @{
152  */
153 
154 /* Exported constants --------------------------------------------------------*/
155 /** @defgroup COMP_Exported_Constants COMP Exported Constants
156  * @{
157  */
158 
159 /** @defgroup COMP_Error_Code COMP Error Code
160  * @{
161  */
162 #define HAL_COMP_ERROR_NONE ((uint32_t)0x00000000) /**< No error */
163 #define HAL_COMP_ERROR_TIMEOUT ((uint32_t)0x00000001) /**< Timeout error */
164 #define HAL_COMP_ERROR_INVALID_PARAM ((uint32_t)0x00000002) /**< Invalid parameters error */
165 /** @} */
166 
167 
168 /** @defgroup COMP_INPUT_SOURCE COMP Input Channel Select
169  * @{
170  */
171 #define COMP_INPUT_SRC_IO0 LL_COMP_INPUT_SRC_IO0 /**< Set MSIO_0 as inputs for the comparator */
172 #define COMP_INPUT_SRC_IO1 LL_COMP_INPUT_SRC_IO1 /**< Set MSIO_1 as inputs for the comparator */
173 #define COMP_INPUT_SRC_IO2 LL_COMP_INPUT_SRC_IO2 /**< Set MSIO_2 as inputs for the comparator */
174 #define COMP_INPUT_SRC_IO3 LL_COMP_INPUT_SRC_IO3 /**< Set MSIO_3 as inputs for the comparator */
175 #define COMP_INPUT_SRC_IO4 LL_COMP_INPUT_SRC_IO4 /**< Set MSIO_4 as inputs for the comparator */
176 #define COMP_INPUT_SRC_IO5 LL_COMP_INPUT_SRC_IO5 /**< Set MSIO_5 as inputs for the comparator */
177 #define COMP_INPUT_SRC_IO6 LL_COMP_INPUT_SRC_IO6 /**< Set MSIO_6 as inputs for the comparator */
178 #define COMP_INPUT_SRC_IO7 LL_COMP_INPUT_SRC_IO7 /**< Set MSIO_7 as inputs for the comparator */
179 #define COMP_INPUT_SRC_VBAT LL_COMP_INPUT_SRC_VBAT /**< Set VBATT as inputs for the comparator */
180 #define COMP_INPUT_SRC_VREF LL_COMP_INPUT_SRC_VREF /**< Set VREF as inputs for the comparator */
181 /** @} */
182 
183 /** @defgroup COMP_REFERENCE_SOURCE COMP Reference Source Select
184  * @{
185  */
186 #define COMP_REF_SRC_IO0 LL_COMP_REF_SRC_IO0 /**< Set MSIO_0 as references for the comparator */
187 #define COMP_REF_SRC_IO1 LL_COMP_REF_SRC_IO1 /**< Set MSIO_1 as references for the comparator */
188 #define COMP_REF_SRC_IO2 LL_COMP_REF_SRC_IO2 /**< Set MSIO_2 as references for the comparator */
189 #define COMP_REF_SRC_IO3 LL_COMP_REF_SRC_IO3 /**< Set MSIO_3 as references for the comparator */
190 #define COMP_REF_SRC_IO4 LL_COMP_REF_SRC_IO4 /**< Set MSIO_4 as references for the comparator */
191 #define COMP_REF_SRC_IO5 LL_COMP_REF_SRC_IO5 /**< Set MSIO_5 as references for the comparator */
192 #define COMP_REF_SRC_IO6 LL_COMP_REF_SRC_IO6 /**< Set MSIO_6 as references for the comparator */
193 #define COMP_REF_SRC_IO7 LL_COMP_REF_SRC_IO7 /**< Set MSIO_7 as references for the comparator */
194 #define COMP_REF_SRC_VBAT LL_COMP_REF_SRC_VBAT /**< Set VBATT as references for the comparator */
195 #define COMP_REF_SRC_VREF LL_COMP_REF_SRC_VREF /**< Set VREF as references for the comparator */
196 /** @} */
197 
198 /** @defgroup COMP_HYSTERESIS COMP Hysteresis Select
199  * @{
200  */
201 #define COMP_HYST_POSITIVE LL_COMP_HYST_POSITIVE /**< Set positive side of hysteresis for the comparator */
202 #define COMP_HYST_NEGATIVE LL_COMP_HYST_NEGATIVE /**< Set negative side of hysteresis for the comparator */
203 /** @} */
204 
205 /** @defgroup COMP_WAKEUP_EDGE COMP Wakeup Edge Select
206  * @{
207  */
208 #define COMP_WAKEUP_EDGE_BOTH LL_COMP_WAKEUP_EDGE_BOTH /**< Select both rising and falling edges for the comparator */
209 #define COMP_WAKEUP_EDGE_FALLING LL_COMP_WAKEUP_EDGE_FALLING /**< Select only falling edges for the comparator */
210 #define COMP_WAKEUP_EDGE_RISING LL_COMP_WAKEUP_EDGE_RISING /**< Select only rising edges for the comparator */
211 
212 /** @} */
213 
214 /** @defgroup COMP_RES_DEGENERATION COMP Reset Degeneration Select
215  * @{
216  */
217 #define COMP_RES_DEGENERATION_POSITIVE LL_COMP_RES_DEGENERATION_POSITIVE /**< Set positive side of calibration for the comparator */
218 #define COMP_RES_DEGENERATION_NEGATIVE LL_COMP_RES_DEGENERATION_NEGATIVE /**< Set negative side of calibration for the comparator */
219 /** @} */
220 
221 /**
222  * @brief Default configuartion for initializing structure
223  */
224 #define COMP_DEFAULT_CONFIG LL_COMP_DEFAULT_CONFIG
225 /** @} */
226 
227 /* Private macros ------------------------------------------------------------*/
228 /** @addtogroup COMP_Private_Macros COMP Private Macros
229  * @{
230  */
231 
232 /**
233  * @brief Check if COMP input source is valid.
234  * @param __INPUT__ COMP input source.
235  * @retval SET (__INPUT__ is valid) or RESET (__INPUT__ is invalid)
236  */
237 #define IS_COMP_INPUT(__INPUT__) (((__INPUT__) == COMP_INPUT_SRC_IO0) || \
238  ((__INPUT__) == COMP_INPUT_SRC_IO1) || \
239  ((__INPUT__) == COMP_INPUT_SRC_IO2) || \
240  ((__INPUT__) == COMP_INPUT_SRC_IO3) || \
241  ((__INPUT__) == COMP_INPUT_SRC_IO4) || \
242  ((__INPUT__) == COMP_INPUT_SRC_IO5) || \
243  ((__INPUT__) == COMP_INPUT_SRC_IO6) || \
244  ((__INPUT__) == COMP_INPUT_SRC_IO7) || \
245  ((__INPUT__) == COMP_INPUT_SRC_VBAT)|| \
246  ((__INPUT__) == COMP_INPUT_SRC_VREF))
247 /**
248  * @brief Check if COMP reference source is valid.
249  * @param __INPUT__ COMP reference source.
250  * @retval SET (__INPUT__ is valid) or RESET (__INPUT__ is invalid)
251  */
252 
253 #define IS_COMP_REF(__INPUT__) (((__INPUT__) == COMP_REF_SRC_IO0) || \
254  ((__INPUT__) == COMP_REF_SRC_IO1) || \
255  ((__INPUT__) == COMP_REF_SRC_IO2) || \
256  ((__INPUT__) == COMP_REF_SRC_IO3) || \
257  ((__INPUT__) == COMP_REF_SRC_IO4) || \
258  ((__INPUT__) == COMP_REF_SRC_IO5) || \
259  ((__INPUT__) == COMP_REF_SRC_IO6) || \
260  ((__INPUT__) == COMP_REF_SRC_IO7) || \
261  ((__INPUT__) == COMP_REF_SRC_VBAT) || \
262  ((__INPUT__) == COMP_REF_SRC_VREF))
263 
264 /**
265  * @brief Check if COMP reference source is valid.
266  * @param __INPUT__ COMP hysteresis.
267  * @retval SET (__INPUT__ is valid) or RESET (__INPUT__ is invalid)
268  */
269 #define IS_COMP_HYST_POS(__INPUT__) ((__INPUT__) == COMP_HYST_POSITIVE)
270 
271 
272 /**
273  * @brief Check if COMP reference source is invalid.
274  * @param __INPUT__ COMP hysteresis.
275  */
276 #define IS_COMP_HYST_NEG(__INPUT__) ((__INPUT__) == COMP_HYST_NEGATIVE )
277 
278 /**
279  * @brief Check if COMP reference source is valid.
280  * @param __INPUT__ COMP res degeneration.
281  * @retval SET (__INPUT__ is valid) or RESET (__INPUT__ is invalid)
282  */
283 #define IS_COMP_RES_DEGENERATION_POS(__INPUT__) ((__INPUT__) == COMP_RES_DEGENERATION_POSITIVE)
284 
285 
286 /**
287  * @brief Check if COMP reference source is invalid.
288  * @param __INPUT__ COMP res degeneration.
289  */
290 #define IS_COMP_RES_DEGENERATION_NEG(__INPUT__) ((__INPUT__) == COMP_RES_DEGENERATION_NEGATIVE )
291 /** @} */
292 
293 /** @} */
294 
295 /* Exported functions --------------------------------------------------------*/
296 /** @addtogroup HAL_COMP_DRIVER_FUNCTIONS Functions
297  * @{
298  */
299 
300 /** @addtogroup COMP_Exported_Functions_Group1 Initialization and de-initialization functions
301  * @brief Initialization and Configuration functions
302  * @{
303  */
304 
305 /**
306  ****************************************************************************************
307  * @brief Initialize the COMP according to the specified parameters
308  * in the comp_init_t and initialize the associated handle.
309  *
310  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
311  * the specified COMP module.
312  *
313  * @retval ::HAL_OK: Operation is OK.
314  * @retval ::HAL_ERROR: Parameter error or operation not supported.
315  * @retval ::HAL_BUSY: Driver is busy.
316  * @retval ::HAL_TIMEOUT: Timeout occurred.
317  ****************************************************************************************
318  */
320 
321 /**
322  ****************************************************************************************
323  * @brief De-initialize the COMP peripheral.
324  *
325  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
326  * the specified COMP module.
327  *
328  * @retval ::HAL_OK: Operation is OK.
329  * @retval ::HAL_ERROR: Parameter error or operation not supported.
330  * @retval ::HAL_BUSY: Driver is busy.
331  * @retval ::HAL_TIMEOUT: Timeout occurred.
332  ****************************************************************************************
333  */
335 
336 /**
337  ****************************************************************************************
338  * @brief Initialize the COMP MSP.
339  *
340  * @note This function should not be modified. When the callback is needed,
341  * the hal_comp_msp_deinit can be implemented in the user file.
342  *
343  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
344  * the specified COMP module.
345  ****************************************************************************************
346  */
348 
349 /**
350  ****************************************************************************************
351  * @brief De-initialize the COMP MSP.
352  *
353  * @note This function should not be modified. When the callback is needed,
354  * the hal_comp_msp_deinit can be implemented in the user file.
355  *
356  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
357  * the specified COMP module.
358  ****************************************************************************************
359  */
361 
362 /** @} */
363 
364 /** @addtogroup COMP_Exported_Functions_Group2 IO operation functions
365  * @brief COMP polling and DMA conversion management functions.
366  * @{
367  */
368 
369  /**
370  ****************************************************************************************
371  * @brief Start the comparator.
372  *
373  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
374  * the specified COMP module.
375  *
376  * @retval ::HAL_OK: Operation is OK.
377  * @retval ::HAL_ERROR: Parameter error or operation not supported.
378  * @retval ::HAL_BUSY: Driver is busy.
379  * @retval ::HAL_TIMEOUT: Timeout occurred.
380  ****************************************************************************************
381  */
383 
384  /**
385  ****************************************************************************************
386  * @brief Stop the comparator.
387  *
388  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
389  * the specified COMP module.
390  *
391  * @retval ::HAL_OK: Operation is OK.
392  * @retval ::HAL_ERROR: Parameter error or operation not supported.
393  * @retval ::HAL_BUSY: Driver is busy.
394  * @retval ::HAL_TIMEOUT: Timeout occurred.
395  ****************************************************************************************
396  */
398 
399 /** @} */
400 
401 /** @addtogroup COMP_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
402  * @brief IRQ Handler and Callbacks functions
403  * @{
404  */
405 
406 /**
407  ****************************************************************************************
408  * @brief Handle COMP interrupt request.
409  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information
410  * for the specified COMP module.
411  ****************************************************************************************
412  */
414 
415 /**
416  ****************************************************************************************
417  * @brief comparator callback.
418  *
419  * @note This function should not be modified. When the callback is needed,
420  * the hal_comp_trigger_callback can be implemented in the user file.
421  *
422  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
423  * the specified COMP module.
424  ****************************************************************************************
425  */
428 
429 /** @} */
430 
431 /** @defgroup COMP_Exported_Functions_Group3 Peripheral State and Errors functions
432  * @brief COMP control functions
433  *
434 @verbatim
435  ===============================================================================
436  ##### Peripheral State and Errors functions #####
437  ===============================================================================
438  [..]
439  This subsection provides a set of functions allowing to control the COMP.
440  (+) hal_comp_get_state() API can be helpful to check in run-time the state of the COMP peripheral.
441  (+) hal_comp_get_error() check in run-time Errors occurring during communication.
442 @endverbatim
443  * @{
444  */
445 
446 /**
447  ****************************************************************************************
448  * @brief Return the COMP handle state.
449  *
450  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
451  * the specified COMP module.
452  *
453  * @retval ::HAL_COMP_STATE_RESET: Peripheral not initialized.
454  * @retval ::HAL_COMP_STATE_READY: Peripheral initialized and ready for use.
455  * @retval ::HAL_COMP_STATE_BUSY: An internal process is ongoing.
456  * @retval ::HAL_COMP_STATE_ERROR: Peripheral in error.
457  ****************************************************************************************
458  */
460 
461 /**
462  ****************************************************************************************
463  * @brief Return the COMP error code.
464  *
465  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
466  * the specified COMP module.
467  *
468  * @return COMP error code in bitmap format
469  ****************************************************************************************
470  */
472 
473 /**
474  ****************************************************************************************
475  * @brief Suspend some registers related to COMP configuration before sleep.
476  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration
477  * information for the specified COMP module.
478  * @retval ::HAL_OK: Operation is OK.
479  * @retval ::HAL_ERROR: Parameter error or operation not supported.
480  * @retval ::HAL_BUSY: Driver is busy.
481  * @retval ::HAL_TIMEOUT: Timeout occurred.
482  ****************************************************************************************
483  */
485 
486 /**
487  ****************************************************************************************
488  * @brief Restore some registers related to COMP configuration after sleep.
489  * This function must be used in conjunction with the hal_comp_suspend_reg().
490  * @param[in] p_comp: Pointer to a COMP handle which contains the configuration
491  * information for the specified COMP module.
492  * @retval ::HAL_OK: Operation is OK.
493  * @retval ::HAL_ERROR: Parameter error or operation not supported.
494  * @retval ::HAL_BUSY: Driver is busy.
495  * @retval ::HAL_TIMEOUT: Timeout occurred.
496  ****************************************************************************************
497  */
499 
500 /** @} */
501 
502 /** @} */
503 
504 
505 
506 #ifdef __cplusplus
507 }
508 #endif
509 
510 #endif /* __GR55xx_HAL_COMP_H__ */
511 
512 /** @} */
513 
514 /** @} */
515 
516 /** @} */
hal_comp_irq_handler
void hal_comp_irq_handler(comp_handle_t *p_comp)
Handle COMP interrupt request.
HAL_COMP_STATE_ERROR
@ HAL_COMP_STATE_ERROR
Definition: gr55xx_hal_comp.h:80
_comp_handle::retention
uint32_t retention[1]
Definition: gr55xx_hal_comp.h:118
_comp_callback::comp_falling_trigger_callback
void(* comp_falling_trigger_callback)(comp_handle_t *p_comp)
Definition: gr55xx_hal_comp.h:141
hal_lock_t
hal_lock_t
HAL Lock structures definition.
Definition: gr55xx_hal_def.h:81
_comp_callback::comp_msp_deinit
void(* comp_msp_deinit)(comp_handle_t *p_comp)
Definition: gr55xx_hal_comp.h:139
_comp_callback
HAL COMP Callback function definition.
Definition: gr55xx_hal_comp.h:137
hal_comp_rising_trigger_callback
void hal_comp_rising_trigger_callback(comp_handle_t *p_comp)
comparator callback.
hal_comp_init
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...
hal_comp_get_error
uint32_t hal_comp_get_error(comp_handle_t *p_comp)
Return the COMP error code.
hal_comp_resume_reg
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_t
HAL COMP State Enumerations definition.
Definition: gr55xx_hal_comp.h:76
_ll_comp_init
LL COMP init Structure definition.
Definition: gr55xx_ll_comp.h:77
_comp_callback::comp_msp_init
void(* comp_msp_init)(comp_handle_t *p_comp)
Definition: gr55xx_hal_comp.h:138
hal_comp_falling_trigger_callback
void hal_comp_falling_trigger_callback(comp_handle_t *p_comp)
_comp_handle::error_code
__IO uint32_t error_code
Definition: gr55xx_hal_comp.h:116
hal_comp_get_state
hal_comp_state_t hal_comp_get_state(comp_handle_t *p_comp)
Return the COMP handle state.
_comp_handle
COMP handle Structure definition.
Definition: gr55xx_hal_comp.h:109
comp_init_t
ll_comp_init_t comp_init_t
COMP init structure definition.
Definition: gr55xx_hal_comp.h:98
_comp_callback::comp_rising_trigger_callback
void(* comp_rising_trigger_callback)(comp_handle_t *p_comp)
Definition: gr55xx_hal_comp.h:140
comp_handle_t
struct _comp_handle comp_handle_t
COMP handle Structure definition.
HAL_COMP_STATE_RESET
@ HAL_COMP_STATE_RESET
Definition: gr55xx_hal_comp.h:77
hal_comp_stop
hal_status_t hal_comp_stop(comp_handle_t *p_comp)
Stop the comparator.
HAL_COMP_STATE_READY
@ HAL_COMP_STATE_READY
Definition: gr55xx_hal_comp.h:78
comp_callback_t
struct _comp_callback comp_callback_t
HAL COMP Callback function definition.
_comp_handle::init
comp_init_t init
Definition: gr55xx_hal_comp.h:110
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
hal_comp_msp_init
void hal_comp_msp_init(comp_handle_t *p_comp)
Initialize the COMP MSP.
hal_comp_suspend_reg
hal_status_t hal_comp_suspend_reg(comp_handle_t *p_comp)
Suspend some registers related to COMP configuration before sleep.
hal_comp_msp_deinit
void hal_comp_msp_deinit(comp_handle_t *p_comp)
De-initialize the COMP MSP.
hal_comp_deinit
hal_status_t hal_comp_deinit(comp_handle_t *p_comp)
De-initialize the COMP peripheral.
HAL_COMP_STATE_BUSY
@ HAL_COMP_STATE_BUSY
Definition: gr55xx_hal_comp.h:79
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.
gr55xx_ll_comp.h
Header file containing functions prototypes of COMP LL library.
_comp_handle::lock
__IO hal_lock_t lock
Definition: gr55xx_hal_comp.h:112
hal_comp_start
hal_status_t hal_comp_start(comp_handle_t *p_comp)
Start the comparator.
_comp_handle::state
__IO hal_comp_state_t state
Definition: gr55xx_hal_comp.h:114