hal_comp.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file 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 HAL_COMP_H
53 #define HAL_COMP_H
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "ll_comp.h"
61 #include "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 */
81 } hal_comp_state_t;
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 */
98 typedef ll_comp_init_t comp_init_t;
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_comp_state_t state; /**< COMP communication state */
113
114 __IO uint32_t error_code; /**< COMP error code */
115
116 uint32_t retention[1]; /**< COMP important register information. */
117
118 } comp_handle_t;
119 /** @} */
120
121 /** @} */
122
123 /** @addtogroup HAL_COMP_CALLBACK_STRUCTURES Callback Structures
124 * @{
125 */
126
127 /** @defgroup COMP_Callback COMP Callback
128 * @{
129 */
130
131 /**
132 * @brief HAL COMP Callback function definition
133 */
134 typedef struct _hal_comp_callback
135 {
136 void (*comp_msp_init)(comp_handle_t *p_comp); /**< COMP init MSP callback */
137 void (*comp_msp_deinit)(comp_handle_t *p_comp); /**< COMP de-init MSP callback */
138 void (*comp_rising_trigger_callback)(comp_handle_t *p_comp); /**< COMP rising trigger callback */
139 void (*comp_falling_trigger_callback)(comp_handle_t *p_comp); /**< COMP falling trigger callback */
140 } hal_comp_callback_t;
141
142 /** @} */
143
144 /** @} */
145
146
147 /**
148 * @defgroup HAL_COMP_MACRO Defines
149 * @{
150 */
151
152 /* Exported constants --------------------------------------------------------*/
153 /** @defgroup COMP_Exported_Constants COMP Exported Constants
154 * @{
155 */
156
157 /** @defgroup COMP_Error_Code COMP Error Code
158 * @{
159 */
160 #define HAL_COMP_ERROR_NONE ((uint32_t)0x00000000) /**< No error */
161 #define HAL_COMP_ERROR_TIMEOUT ((uint32_t)0x00000001) /**< Timeout error */
162 #define HAL_COMP_ERROR_INVALID_PARAM ((uint32_t)0x00000002) /**< Invalid parameters error */
163 /** @} */
164
165
166 /** @defgroup COMP_INPUT_SOURCE COMP Input Channel Select
167 * @{
168 */
169 #define COMP_INPUT_SRC_IO0 LL_COMP_INPUT_SRC_IO0 /**< Set MSIO_0 as inputs for the comparator */
170 #define COMP_INPUT_SRC_IO1 LL_COMP_INPUT_SRC_IO1 /**< Set MSIO_1 as inputs for the comparator */
171 #define COMP_INPUT_SRC_IO2 LL_COMP_INPUT_SRC_IO2 /**< Set MSIO_2 as inputs for the comparator */
172 #define COMP_INPUT_SRC_IO3 LL_COMP_INPUT_SRC_IO3 /**< Set MSIO_3 as inputs for the comparator */
173 #define COMP_INPUT_SRC_IO4 LL_COMP_INPUT_SRC_IO4 /**< Set MSIO_4 as inputs for the comparator */
174 #define COMP_INPUT_SRC_IO5 LL_COMP_INPUT_SRC_IO5 /**< Set MSIO_5 as inputs for the comparator */
175 #define COMP_INPUT_SRC_IO6 LL_COMP_INPUT_SRC_IO6 /**< Set MSIO_6 as inputs for the comparator */
176 #define COMP_INPUT_SRC_IO7 LL_COMP_INPUT_SRC_IO7 /**< Set MSIO_7 as inputs for the comparator */
177 #define COMP_INPUT_SRC_VBAT LL_COMP_INPUT_SRC_VBAT /**< Set VBATT as inputs for the comparator */
178 #define COMP_INPUT_SRC_VREF LL_COMP_INPUT_SRC_VREF /**< Set VREF as inputs for the comparator */
179 /** @} */
180
181 /** @defgroup COMP_REFERENCE_SOURCE COMP Reference Source Select
182 * @{
183 */
184 #define COMP_REF_SRC_IO0 LL_COMP_REF_SRC_IO0 /**< Set MSIO_0 as references for the comparator */
185 #define COMP_REF_SRC_IO1 LL_COMP_REF_SRC_IO1 /**< Set MSIO_1 as references for the comparator */
186 #define COMP_REF_SRC_IO2 LL_COMP_REF_SRC_IO2 /**< Set MSIO_2 as references for the comparator */
187 #define COMP_REF_SRC_IO3 LL_COMP_REF_SRC_IO3 /**< Set MSIO_3 as references for the comparator */
188 #define COMP_REF_SRC_IO4 LL_COMP_REF_SRC_IO4 /**< Set MSIO_4 as references for the comparator */
189 #define COMP_REF_SRC_IO5 LL_COMP_REF_SRC_IO5 /**< Set MSIO_5 as references for the comparator */
190 #define COMP_REF_SRC_IO6 LL_COMP_REF_SRC_IO6 /**< Set MSIO_6 as references for the comparator */
191 #define COMP_REF_SRC_IO7 LL_COMP_REF_SRC_IO7 /**< Set MSIO_7 as references for the comparator */
192 #define COMP_REF_SRC_VBAT LL_COMP_REF_SRC_VBAT /**< Set VBATT as references for the comparator */
193 #define COMP_REF_SRC_VREF LL_COMP_REF_SRC_VREF /**< Set VREF as references for the comparator */
194 /** @} */
195
196 /** @defgroup COMP_HYSTERESIS COMP Hysteresis Select
197 * @{
198 */
199 #define COMP_HYST_POSITIVE LL_COMP_HYST_POSITIVE /**< Set positive side of hysteresis for the comparator */
200 #define COMP_HYST_NEGATIVE LL_COMP_HYST_NEGATIVE /**< Set negative side of hysteresis for the comparator */
201 /** @} */
202
203 /** @defgroup COMP_WAKEUP_EDGE Select
204 * @{
205 */
206 #define COMP_WAKEUP_EDGE_BOTH LL_COMP_WAKEUP_EDGE_BOTH /**< Select both rising and falling edges for the comparator */
207 #define COMP_WAKEUP_EDGE_FALLING LL_COMP_WAKEUP_EDGE_FALLING /**< Select only falling edges for the comparator */
208 #define COMP_WAKEUP_EDGE_RISING LL_COMP_WAKEUP_EDGE_RISING /**< Select only rising edges for the comparator */
209 /** @} */
210
211 /** @defgroup COMP_RES_DEGENERATION COMP Reset Degeneration Select
212 * @{
213 */
214 #define COMP_RES_DEGENERATION_POSITIVE LL_COMP_RES_DEGENERATION_POSITIVE /**< Set positive side of calibration for the comparator */
215 #define COMP_RES_DEGENERATION_NEGATIVE LL_COMP_RES_DEGENERATION_NEGATIVE /**< Set negative side of calibration for the comparator */
216 /** @} */
217
218 /**
219 * @brief Default configuartion for initializing structure
220 */
221 #define COMP_DEFAULT_CONFIG LL_COMP_DEFAULT_CONFIG
222 /** @} */
223
224 /* Private macros ------------------------------------------------------------*/
225 /** @addtogroup COMP_Private_Macros COMP Private Macros
226 * @{
227 */
228
229 /**
230 * @brief Check if COMP input source is valid.
231 * @param __INPUT__ COMP input source.
232 * @retval SET (__INPUT__ is valid) or RESET (__INPUT__ is invalid)
233 */
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))
244 /**
245 * @brief Check if COMP reference source is valid.
246 * @param __INPUT__ COMP reference source.
247 * @retval SET (__INPUT__ is valid) or RESET (__INPUT__ is invalid)
248 */
249
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))
260
261 /**
262 * @brief Check if COMP reference source is valid.
263 * @param __INPUT__ COMP hysteresis.
264 * @retval SET (__INPUT__ is valid) or RESET (__INPUT__ is invalid)
265 */
266 #define IS_COMP_HYST_POS(__INPUT__) ((__INPUT__) == COMP_HYST_POSITIVE)
267
268
269 /**
270 * @brief Check if COMP reference source is invalid.
271 * @param __INPUT__ COMP hysteresis.
272 */
273 #define IS_COMP_HYST_NEG(__INPUT__) ((__INPUT__) == COMP_HYST_NEGATIVE )
274
275 /**
276 * @brief Check if COMP reference source is valid.
277 * @param __INPUT__ COMP res degeneration.
278 * @retval SET (__INPUT__ is valid) or RESET (__INPUT__ is invalid)
279 */
280 #define IS_COMP_RES_DEGENERATION_POS(__INPUT__) ((__INPUT__) == COMP_RES_DEGENERATION_POSITIVE)
281
282
283 /**
284 * @brief Check if COMP reference source is invalid.
285 * @param __INPUT__ COMP res degeneration.
286 */
287 #define IS_COMP_RES_DEGENERATION_NEG(__INPUT__) ((__INPUT__) == COMP_RES_DEGENERATION_NEGATIVE )
288 /** @} */
289
290 /** @} */
291
292 /* Exported functions --------------------------------------------------------*/
293 /** @addtogroup HAL_COMP_DRIVER_FUNCTIONS Functions
294 * @{
295 */
296
297 /** @addtogroup COMP_Exported_Functions_Group1 Initialization and de-initialization functions
298 * @brief Initialization and Configuration functions
299 * @{
300 */
301
302 /**
303 ****************************************************************************************
304 * @brief Initialize the COMP according to the specified parameters
305 * in the comp_init_t and initialize the associated handle.
306 *
307 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
308 * the specified COMP module.
309 *
310 * @retval ::HAL_OK: Operation is OK.
311 * @retval ::HAL_ERROR: Parameter error or operation not supported.
312 * @retval ::HAL_BUSY: Driver is busy.
313 * @retval ::HAL_TIMEOUT: Timeout occurred.
314 ****************************************************************************************
315 */
316 hal_status_t hal_comp_init(comp_handle_t *p_comp);
317
318 /**
319 ****************************************************************************************
320 * @brief De-initialize the COMP peripheral.
321 *
322 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
323 * the specified COMP module.
324 *
325 * @retval ::HAL_OK: Operation is OK.
326 * @retval ::HAL_ERROR: Parameter error or operation not supported.
327 * @retval ::HAL_BUSY: Driver is busy.
328 * @retval ::HAL_TIMEOUT: Timeout occurred.
329 ****************************************************************************************
330 */
331 hal_status_t hal_comp_deinit(comp_handle_t *p_comp);
332
333 /**
334 ****************************************************************************************
335 * @brief Initialize the COMP MSP.
336 *
337 * @note This function should not be modified. When the callback is needed,
338 * the hal_comp_msp_deinit can be implemented in the user file.
339 *
340 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
341 * the specified COMP module.
342 ****************************************************************************************
343 */
344 void hal_comp_msp_init(comp_handle_t *p_comp);
345
346 /**
347 ****************************************************************************************
348 * @brief De-initialize the COMP MSP.
349 *
350 * @note This function should not be modified. When the callback is needed,
351 * the hal_comp_msp_deinit can be implemented in the user file.
352 *
353 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
354 * the specified COMP module.
355 ****************************************************************************************
356 */
357 void hal_comp_msp_deinit(comp_handle_t *p_comp);
358
359 /** @} */
360
361 /** @addtogroup COMP_Exported_Functions_Group2 IO operation functions
362 * @brief COMP polling and DMA conversion management functions.
363 * @{
364 */
365
366 /**
367 ****************************************************************************************
368 * @brief Start the comparator.
369 *
370 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
371 * the specified COMP module.
372 *
373 * @retval ::HAL_OK: Operation is OK.
374 * @retval ::HAL_ERROR: Parameter error or operation not supported.
375 * @retval ::HAL_BUSY: Driver is busy.
376 * @retval ::HAL_TIMEOUT: Timeout occurred.
377 ****************************************************************************************
378 */
379 hal_status_t hal_comp_start(comp_handle_t *p_comp);
380
381 /**
382 ****************************************************************************************
383 * @brief Stop the comparator.
384 *
385 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
386 * the specified COMP module.
387 *
388 * @retval ::HAL_OK: Operation is OK.
389 * @retval ::HAL_ERROR: Parameter error or operation not supported.
390 * @retval ::HAL_BUSY: Driver is busy.
391 * @retval ::HAL_TIMEOUT: Timeout occurred.
392 ****************************************************************************************
393 */
394 hal_status_t hal_comp_stop(comp_handle_t *p_comp);
395
396 /** @} */
397
398 /** @addtogroup COMP_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks
399 * @brief IRQ Handler and Callbacks functions
400 * @{
401 */
402
403 /**
404 ****************************************************************************************
405 * @brief Handle COMP interrupt request.
406 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information
407 * for the specified COMP module.
408 ****************************************************************************************
409 */
410 void hal_comp_irq_handler(comp_handle_t *p_comp);
411
412 /**
413 ****************************************************************************************
414 * @brief comparator rising callback.
415 *
416 * @note This function should not be modified. When the callback is needed,
417 * the hal_comp_rising_trigger_callback can be implemented in the user file.
418 *
419 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
420 * the specified COMP module.
421 ****************************************************************************************
422 */
423 void hal_comp_rising_trigger_callback(comp_handle_t *p_comp);
424
425 /**
426 ****************************************************************************************
427 * @brief comparator rising callback.
428 *
429 * @note This function should not be modified. When the callback is needed,
430 * the hal_comp_falling_trigger_callback can be implemented in the user file.
431 *
432 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
433 * the specified COMP module.
434 ****************************************************************************************
435 */
436 void hal_comp_falling_trigger_callback(comp_handle_t *p_comp);
437
438 /** @} */
439
440 /** @defgroup COMP_Exported_Functions_Group3 Peripheral State and Errors functions
441 * @brief COMP control functions
442 *
443 @verbatim
444 ===============================================================================
445 ##### Peripheral State and Errors functions #####
446 ===============================================================================
447 [..]
448 This subsection provides a set of functions allowing to control the COMP.
449 (+) hal_comp_get_state() API can be helpful to check in run-time the state of the COMP peripheral.
450 (+) hal_comp_get_error() check in run-time Errors occurring during communication.
451 @endverbatim
452 * @{
453 */
454
455 /**
456 ****************************************************************************************
457 * @brief Return the COMP handle state.
458 *
459 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
460 * the specified COMP module.
461 *
462 * @retval ::HAL_COMP_STATE_RESET: Peripheral not initialized.
463 * @retval ::HAL_COMP_STATE_READY: Peripheral initialized and ready for use.
464 * @retval ::HAL_COMP_STATE_BUSY: An internal process is ongoing.
465 * @retval ::HAL_COMP_STATE_ERROR: Peripheral in error.
466 ****************************************************************************************
467 */
468 hal_comp_state_t hal_comp_get_state(const comp_handle_t *p_comp);
469
470 /**
471 ****************************************************************************************
472 * @brief Return the COMP error code.
473 *
474 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration information for
475 * the specified COMP module.
476 *
477 * @return COMP error code in bitmap format
478 ****************************************************************************************
479 */
480 uint32_t hal_comp_get_error(const comp_handle_t *p_comp);
481
482 /**
483 ****************************************************************************************
484 * @brief Suspend some registers related to COMP configuration before sleep.
485 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration
486 * information for the specified COMP module.
487 * @retval ::HAL_OK: Operation is OK.
488 * @retval ::HAL_ERROR: Parameter error or operation not supported.
489 * @retval ::HAL_BUSY: Driver is busy.
490 * @retval ::HAL_TIMEOUT: Timeout occurred.
491 ****************************************************************************************
492 */
493 hal_status_t hal_comp_suspend_reg(comp_handle_t *p_comp);
494
495 /**
496 ****************************************************************************************
497 * @brief Restore some registers related to COMP configuration after sleep.
498 * This function must be used in conjunction with the hal_comp_suspend_reg().
499 * @param[in] p_comp: Pointer to a COMP handle which contains the configuration
500 * information for the specified COMP module.
501 * @retval ::HAL_OK: Operation is OK.
502 * @retval ::HAL_ERROR: Parameter error or operation not supported.
503 * @retval ::HAL_BUSY: Driver is busy.
504 * @retval ::HAL_TIMEOUT: Timeout occurred.
505 ****************************************************************************************
506 */
507 hal_status_t hal_comp_resume_reg(comp_handle_t *p_comp);
508
509 /** @} */
510
511 /** @} */
512
513
514
515 #ifdef __cplusplus
516 }
517 #endif
518
519 #endif /* HAL_COMP_H */
520
521 /** @} */
522
523 /** @} */
524
525 /** @} */
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: hal_comp.h:80
_comp_handle::retention
uint32_t retention[1]
Definition: hal_comp.h:116
hal_comp_rising_trigger_callback
void hal_comp_rising_trigger_callback(comp_handle_t *p_comp)
comparator rising 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(const comp_handle_t *p_comp)
Return the COMP error code.
_hal_comp_callback
HAL COMP Callback function definition.
Definition: hal_comp.h:135
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: hal_comp.h:76
_ll_comp_init
LL COMP init Structure definition.
Definition: ll_comp.h:77
hal_comp_falling_trigger_callback
void hal_comp_falling_trigger_callback(comp_handle_t *p_comp)
comparator rising callback.
_comp_handle::error_code
__IO uint32_t error_code
Definition: hal_comp.h:114
_hal_comp_callback::comp_msp_deinit
void(* comp_msp_deinit)(comp_handle_t *p_comp)
Definition: hal_comp.h:137
_comp_handle
COMP handle Structure definition.
Definition: hal_comp.h:109
_hal_comp_callback::comp_falling_trigger_callback
void(* comp_falling_trigger_callback)(comp_handle_t *p_comp)
Definition: hal_comp.h:139
comp_init_t
ll_comp_init_t comp_init_t
COMP init structure definition.
Definition: hal_comp.h:98
comp_handle_t
struct _comp_handle comp_handle_t
COMP handle Structure definition.
HAL_COMP_STATE_RESET
@ HAL_COMP_STATE_RESET
Definition: hal_comp.h:77
hal_comp_callback_t
struct _hal_comp_callback hal_comp_callback_t
HAL COMP Callback function definition.
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: hal_comp.h:78
_hal_comp_callback::comp_rising_trigger_callback
void(* comp_rising_trigger_callback)(comp_handle_t *p_comp)
Definition: hal_comp.h:138
_comp_handle::init
comp_init_t init
Definition: hal_comp.h:110
hal_comp_get_state
hal_comp_state_t hal_comp_get_state(const comp_handle_t *p_comp)
Return the COMP handle state.
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr_common.h:140
hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.
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.
ll_comp.h
Header file containing functions prototypes of COMP LL library.
hal_comp_msp_deinit
void hal_comp_msp_deinit(comp_handle_t *p_comp)
De-initialize the COMP MSP.
_hal_comp_callback::comp_msp_init
void(* comp_msp_init)(comp_handle_t *p_comp)
Definition: hal_comp.h:136
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: hal_comp.h:79
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: hal_comp.h:112