gr55xx_hal_gpadc.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file gr55xx_hal_gpadc.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of GPADC 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_GPADC GPADC
47 * @brief GPADC HAL module driver.
48 * @{
49 */
50
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_GPADC_H__
53 #define __GR55xx_HAL_GPADC_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_ll_gpadc.h"
61 #include "gr55xx_hal_def.h"
62 #include "gr55xx_hal_dma.h"
63
64 /* Exported types ------------------------------------------------------------*/
65 /** @addtogroup HAL_GPADC_ENUMERATIONS Enumerations
66 * @{
67 */
68
69 /** @defgroup HAL_GPADC_state HAL GPADC State
70 * @{
71 */
72
73 /**
74 * @brief HAL GPADC State Enumerations definition
75 */
76 typedef enum
77 {
78 HAL_GPADC_STATE_RESET = 0x00, /**< Peripheral not initialized */
79 HAL_GPADC_STATE_READY = 0x01, /**< Peripheral initialized and ready for use */
80 HAL_GPADC_STATE_BUSY = 0x02, /**< An internal process is ongoing */
81 HAL_GPADC_STATE_ERROR = 0x04 /**< Peripheral in error */
82
83 } hal_gpadc_state_t;
84
85 /** @} */
86
87 /** @} */
88
89 /** @addtogroup HAL_GPADC_STRUCTURES Structures
90 * @{
91 */
92
93 /** @defgroup GPADC_Configuration GPADC Configuration
94 * @{
95 */
96
97 /**
98 * @brief GPADC init structure definition
99 */
100 typedef ll_gpadc_init_t gpadc_init_t;
101 /** @} */
102
103 /** @defgroup GPADC_handle GPADC Handle
104 * @{
105 */
106
107 /**
108 * @brief GPADC handle Structure definition
109 */
110 typedef struct _gpadc_handle
111 {
112 gpadc_init_t init; /**< GPADC configuration parameters */
113
114 uint16_t *p_buffer; /**< Pointer to GPADC conversion buffer */
115
116 __IO uint32_t buff_size; /**< Conversion buffer size */
117
118 __IO uint32_t buff_count; /**< Conversion buffer counter */
119
120 dma_handle_t *p_dma; /**< GPADC DMA Handle parameters */
121
122 __IO hal_lock_t lock; /**< Locking object */
123
124 __IO hal_gpadc_state_t state; /**< GPADC communication state */
125
126 __IO uint32_t error_code; /**< GPADC error code */
127
128 uint32_t retention[20]; /**< GPADC important register information. */
129 } gpadc_handle_t;
130 /** @} */
131
132 /** @} */
133
134 /** @addtogroup HAL_GPADC_CALLBACK_STRUCTURES Callback Structures
135 * @{
136 */
137
138 /** @defgroup GPADC_Callback GPADC Callback
139 * @{
140 */
141
142 /**
143 * @brief HAL GPADC Callback function definition
144 */
145 typedef struct _hal_gpadc_callback
146 {
147 void (*gpadc_msp_init)(gpadc_handle_t *p_gpadc); /**< GPADC init MSP callback */
148 void (*gpadc_msp_deinit)(gpadc_handle_t *p_gpadc); /**< GPADC de-init MSP callback */
149 void (*gpadc_conv_cplt_callback)(gpadc_handle_t *p_gpadc); /**< GPADC conversion completed callback */
150 } hal_gpadc_callback_t;
151
152 /** @} */
153
154 /** @} */
155
156 /**
157 * @defgroup HAL_GPADC_MACRO Defines
158 * @{
159 */
160
161 /* Exported constants --------------------------------------------------------*/
162 /** @defgroup GPADC_Exported_Constants GPADC Exported Constants
163 * @{
164 */
165 /** @defgroup GPADC_P_INPUT_SRC GPADC P_Input Source
166 * @{
167 */
168 #define GPADC_P_INPUT_SRC_VCM LL_GPADC_P_INPUT_SRC_VCM /**< Select vcm(=vdd/2) as input */
169 #define GPADC_P_INPUT_SRC_IO1 LL_GPADC_P_INPUT_SRC_IO1 /**< Select MSIOB1 as input */
170 #define GPADC_P_INPUT_SRC_IO2 LL_GPADC_P_INPUT_SRC_IO2 /**< Select MSIOB2 as input */
171 #define GPADC_P_INPUT_SRC_IO3 LL_GPADC_P_INPUT_SRC_IO3 /**< Select MSIOB3 as input */
172 #define GPADC_P_INPUT_SRC_IO4 LL_GPADC_P_INPUT_SRC_IO4 /**< Select MSIOB4 as input */
173 #define GPADC_P_INPUT_SRC_IO5 LL_GPADC_P_INPUT_SRC_IO5 /**< Select MSIOB5 as input */
174 #define GPADC_P_INPUT_SRC_IO6 LL_GPADC_P_INPUT_SRC_IO6 /**< Select MSIOB6 as input */
175 #define GPADC_P_INPUT_SRC_IO7 LL_GPADC_P_INPUT_SRC_IO7 /**< Select MSIOB7 as input */
176 /** @} */
177
178 /** @defgroup GPADC_N_INPUT_SRC GPADC N_Input Source
179 * @{
180 */
181 #define GPADC_N_INPUT_SRC_VCM LL_GPADC_N_INPUT_SRC_VCM /**< Select vcm(=vdd/2) as input */
182 #define GPADC_N_INPUT_SRC_IO0 LL_GPADC_N_INPUT_SRC_IO0 /**< Select MSIOB0 as input */
183 #define GPADC_N_INPUT_SRC_IO1 LL_GPADC_N_INPUT_SRC_IO1 /**< Select MSIOB1 as input */
184 #define GPADC_N_INPUT_SRC_IO2 LL_GPADC_N_INPUT_SRC_IO2 /**< Select MSIOB2 as input */
185 #define GPADC_N_INPUT_SRC_IO3 LL_GPADC_N_INPUT_SRC_IO3 /**< Select MSIOB3 as input */
186 #define GPADC_N_INPUT_SRC_IO4 LL_GPADC_N_INPUT_SRC_IO4 /**< Select MSIOB4 as input */
187 #define GPADC_N_INPUT_SRC_IO5 LL_GPADC_N_INPUT_SRC_IO5 /**< Select MSIOB5 as input */
188 #define GPADC_N_INPUT_SRC_IO6 LL_GPADC_N_INPUT_SRC_IO6 /**< Select MSIOB6 as input */
189 /** @} */
190
191 /** @defgroup GPADC_INPUT_MODE GPADC Input Mode
192 * @{
193 */
194 #define GPADC_INPUT_DIFFERENTIAL LL_GPADC_INPUT_DIFFERENTIAL /**< Differential mode */
195 #define GPADC_INPUT_SINGLE LL_GPADC_INPUT_SINGLE /**< Single ended mode */
196 /** @} */
197
198 /** @defgroup GPADC_VDD_VALUE GPADC Vdd Value
199 * @{
200 */
201 #define GPADC_VDD_VALUE_1P8 LL_GPADC_VDD_VALUE_1P8 /**< Vdd = 1.8 V */
202 #define GPADC_VDD_VALUE_2P3 LL_GPADC_VDD_VALUE_2P3 /**< Vdd = 2.3 V */
203 /** @} */
204
205 /** @defgroup GPADC_SP_RATE GPADC Sample Rate
206 * @{
207 */
208 #define GPADC_SPR_1M LL_GPADC_SPR_1M /**<sample rate = 1Msps */
209 #define GPADC_SPR_500K LL_GPADC_SPR_500K /**<sample rate = 500Ksps */
210 #define GPADC_SPR_250K LL_GPADC_SPR_250K /**<sample rate = 250Ksps */
211 #define GPADC_SPR_125K LL_GPADC_SPR_125K /**<sample rate = 125Ksps */
212 /** @} */
213
214 /** @defgroup GPADC_PGA_MODE GPADC Pga Mode
215 * @{
216 */
217 #define GPADC_PGA_MODE_BYPASS LL_GPADC_PGA_MODE_BYPASS /**<bypass mode, means not use pga*/
218 #define GPADC_PGA_MODE_NORMAL LL_GPADC_PGA_MODE_NORMAL /**<use pga*/
219 /** @} */
220
221 /** @defgroup GPADC_PGA_GAIN GPADC Pga Gain
222 * @{
223 */
224 #define GPADC_PGA_GAIN_0DB LL_GPADC_PGA_GAIN_0DB /**<pga gain = 0db*/
225 #define GPADC_PGA_GAIN_5DB LL_GPADC_PGA_GAIN_5DB /**<pga gain = 5db*/
226 #define GPADC_PGA_GAIN_10DB LL_GPADC_PGA_GAIN_10DB /**<pga gain = 10db*/
227 #define GPADC_PGA_GAIN_20DB LL_GPADC_PGA_GAIN_20DB /**<pga gain = 20db*/
228
229 /** @} */
230
231 /** @defgroup GPADC_Error_Code GPADC Error Code
232 * @{
233 */
234 #define HAL_GPADC_ERROR_NONE ((uint32_t)0x00000000) /**< No error */
235 #define HAL_GPADC_ERROR_TIMEOUT ((uint32_t)0x00000001) /**< Timeout error */
236 #define HAL_GPADC_ERROR_DMA ((uint32_t)0x00000004) /**< DMA transfer error */
237 #define HAL_GPADC_ERROR_INVALID_PARAM ((uint32_t)0x00000008) /**< Invalid parameter error */
238 /** @} */
239
240 /** @} */
241
242 /* Exported macro ------------------------------------------------------------*/
243 /** @defgroup GPADC_Exported_Macros GPADC Exported Macros
244 * @{
245 */
246
247 /** @brief Reset GPADC handle states.
248 * @param __HANDLE__ GPADC handle.
249 * @retval None
250 */
251 #define __HAL_GPADC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_GPADC_STATE_RESET)
252
253 /** @brief Enable the specified GPADC peripheral.
254 * @param __HANDLE__ Specify the GPADC Handle.
255 * @retval None
256 */
257 #define __HAL_GPADC_ENABLE(__HANDLE__) ll_gpadc_enable()
258
259 /** @brief Disable the specified GPADC peripheral.
260 * @param __HANDLE__ Specify the GPADC Handle.
261 * @retval None
262 */
263 #define __HAL_GPADC_DISABLE(__HANDLE__) ll_gpadc_disable()
264
265 /** @brief Check the FIFO is not empty.
266 * @param __HANDLE__ Specify the GPADC Handle.
267 * @retval The new state of notempty flag (TRUE or FALSE).
268 */
269 #define __HAL_GPADC_GET_FLAG_NOTEMPTY(__HANDLE__) ll_gpadc_is_fifo_notempty()
270
271 /** @brief Flush the FIFO.
272 * @param __HANDLE__ Specify the GPADC Handle.
273 * @retval None
274 */
275 #define __HAL_GPADC_FLUSH_FIFO(__HANDLE__) do { \
276 while(ll_gpadc_is_fifo_notempty()) \
277 { \
278 ll_gpadc_flush_fifo(); \
279 } \
280 } while(0)
281 /** @} */
282
283 /** @} */
284
285 /* Exported functions --------------------------------------------------------*/
286 /** @addtogroup HAL_GPADC_DRIVER_FUNCTIONS Functions
287 * @{
288 */
289
290 /** @addtogroup GPADC_Exported_Functions_Group1 Initialization and de-initialization Functions
291 * @brief Initialization and Configuration functions
292 * @{
293 */
294
295 /**
296 ****************************************************************************************
297 * @brief Initialize the GPADC according to the specified parameters
298 * in the gpadc_init_t and initialize the associated handle.
299 *
300 * @param[in] p_gpadc: Pointer to an GPADC handle which contains the configuration information for
301 * the specified GPADC module.
302 *
303 * @retval ::HAL_OK: Operation is OK.
304 * @retval ::HAL_ERROR: Parameter error or operation not supported.
305 * @retval ::HAL_BUSY: Driver is busy.
306 * @retval ::HAL_TIMEOUT: Timeout occurred.
307 ****************************************************************************************
308 */
309 hal_status_t hal_gpadc_init(gpadc_handle_t *p_gpadc);
310
311 /**
312 ****************************************************************************************
313 * @brief De-initialize the GPADC peripheral.
314 *
315 * @param[in] p_gpadc: Pointer to an GPADC handle which contains the configuration information for
316 * the specified GPADC module.
317 *
318 * @retval ::HAL_OK: Operation is OK.
319 * @retval ::HAL_ERROR: Parameter error or operation not supported.
320 * @retval ::HAL_BUSY: Driver is busy.
321 * @retval ::HAL_TIMEOUT: Timeout occurred.
322 ****************************************************************************************
323 */
324 hal_status_t hal_gpadc_deinit(gpadc_handle_t *p_gpadc);
325
326 /**
327 ****************************************************************************************
328 * @brief Initialize the GPADC MSP.
329 *
330 * @note This function should not be modified. When the callback is needed,
331 * the hal_gpadc_msp_deinit can be implemented in the user file.
332 *
333 * @param[in] p_gpadc: Pointer to an GPADC handle which contains the configuration information for
334 * the specified GPADC module.
335 ****************************************************************************************
336 */
337 void hal_gpadc_msp_init(gpadc_handle_t *p_gpadc);
338
339 /**
340 ****************************************************************************************
341 * @brief De-initialize the GPADC MSP.
342 *
343 * @note This function should not be modified. When the callback is needed,
344 * the hal_gpadc_msp_deinit can be implemented in the user file.
345 *
346 * @param[in] p_gpadc: Pointer to an GPADC handle which contains the configuration information for
347 * the specified GPADC module.
348 ****************************************************************************************
349 */
350 void hal_gpadc_msp_deinit(gpadc_handle_t *p_gpadc);
351
352 /**
353 ****************************************************************************************
354 * @brief Polling for conversion.
355 *
356 * @param[in] p_gpadc: Pointer to an GPADC handle.
357 * @param[in] p_data: Pointer to data buffer which to store GPADC conversion results.
358 * @param[in] length: Length of data buffer.
359 *
360 * @retval ::HAL_OK: Operation is OK.
361 * @retval ::HAL_ERROR: Parameter error or operation not supported.
362 * @retval ::HAL_BUSY: Driver is busy.
363 * @retval ::HAL_TIMEOUT: Timeout occurred.
364 ****************************************************************************************
365 */
366 hal_status_t hal_gpadc_poll_for_conversion(gpadc_handle_t *p_gpadc, uint16_t *p_data, uint32_t length);
367
368 /**
369 ****************************************************************************************
370 * @brief DMA for conversion.
371 *
372 * @param[in] p_gpadc: Pointer to an GPADC handle.
373 * @param[in] p_data: Pointer to data buffer which to store GPADC conversion results.
374 * @param[in] length: Length of data buffer, ranging between 0 and 4095.
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 */
382 hal_status_t hal_gpadc_start_dma(gpadc_handle_t *p_gpadc, uint16_t *p_data, uint32_t length);
383
384 /**
385 ****************************************************************************************
386 * @brief DMA for conversion.
387 *
388 * @param[in] p_gpadc: Pointer to an GPADC handle.
389 * @param[in] p_data: Pointer to data buffer which to store GPADC conversion results.
390 * @param[in] length: Length of data buffer, ranging between 0 and 4095.
391 * @param[in] sg_llp_config: The config of source and destination's SG and LLP functions.
392 *
393 * @retval ::HAL_OK: Operation is OK.
394 * @retval ::HAL_ERROR: Parameter error or operation not supported.
395 * @retval ::HAL_BUSY: Driver is busy.
396 * @retval ::HAL_TIMEOUT: Timeout occurred.
397 ****************************************************************************************
398 */
399 hal_status_t hal_gpadc_start_dma_sg_llp(gpadc_handle_t *p_gpadc, uint16_t *p_data, uint32_t length, dma_sg_llp_config_t *sg_llp_config);
400
401
402 /**
403 ****************************************************************************************
404 * @brief Abort ongoing conversion (blocking mode).
405 *
406 * @note This procedure could be only used for aborting conversion started in DMA mode.
407 * This procedure performs following operations:
408 * - Disable GPADC clock, stop conversion
409 * - Abort DMA transfer by calling hal_dma_abort (in case of transfer in DMA mode)
410 * - Set handle State to READY.
411 * This procedure is executed in blocking mode: when exiting function, Abort is considered as completed.
412 *
413 * @param[in] p_gpadc: GPADC handle.
414 *
415 * @retval ::HAL_OK: Operation is OK.
416 * @retval ::HAL_ERROR: Parameter error or operation not supported.
417 * @retval ::HAL_BUSY: Driver is busy.
418 * @retval ::HAL_TIMEOUT: Timeout occurred.
419 ****************************************************************************************
420 */
421 hal_status_t hal_gpadc_stop_dma(gpadc_handle_t *p_gpadc);
422
423 /**
424 ****************************************************************************************
425 * @brief Conversion completed callback.
426 *
427 * @note This function should not be modified. When the callback is needed,
428 * the hal_gpadc_msp_deinit can be implemented in the user file.
429 *
430 * @param[in] p_gpadc: Pointer to an GPADC handle which contains the configuration information for
431 * the specified GPADC module.
432 ****************************************************************************************
433 */
434 void hal_gpadc_conv_cplt_callback(gpadc_handle_t* p_gpadc);
435
436 /**
437 ****************************************************************************************
438 * @brief Return the GPADC handle state.
439 *
440 * @param[in] p_gpadc: Pointer to an GPADC handle which contains the configuration information for
441 * the specified GPADC module.
442 *
443 * @retval ::HAL_GPADC_STATE_RESET: Peripheral not initialized.
444 * @retval ::HAL_GPADC_STATE_READY: Peripheral initialized and ready for use.
445 * @retval ::HAL_GPADC_STATE_BUSY: An internal process is ongoing.
446 * @retval ::HAL_GPADC_STATE_ERROR: Peripheral in error.
447 ****************************************************************************************
448 */
449 hal_gpadc_state_t hal_gpadc_get_state(gpadc_handle_t *p_gpadc);
450
451 /**
452 ****************************************************************************************
453 * @brief Return the GPADC error code.
454 *
455 * @param[in] p_gpadc: Pointer to an GPADC handle which contains the configuration information for
456 * the specified GPADC module.
457 *
458 * @return GPADC error code in bitmap format
459 ****************************************************************************************
460 */
461 uint32_t hal_gpadc_get_error(gpadc_handle_t *p_gpadc);
462
463 /**
464 ****************************************************************************************
465 * @brief Suspend some registers related to GPADC configuration before sleep.
466 * @param[in] p_gpadc: Pointer to a GPADC handle which contains the configuration
467 * information for the specified GPADC module.
468 * @retval ::HAL_OK: Operation is OK.
469 * @retval ::HAL_ERROR: Parameter error or operation not supported.
470 * @retval ::HAL_BUSY: Driver is busy.
471 * @retval ::HAL_TIMEOUT: Timeout occurred.
472 ****************************************************************************************
473 */
474 hal_status_t hal_gpadc_suspend_reg(gpadc_handle_t *p_gpadc);
475
476 /**
477 ****************************************************************************************
478 * @brief Restore some registers related to GPADC configuration after sleep.
479 * This function must be used in conjunction with the hal_gpadc_suspend_reg().
480 * @param[in] p_gpadc: Pointer to a GPADC handle which contains the configuration
481 * information for the specified GPADC module.
482 * @retval ::HAL_OK: Operation is OK.
483 * @retval ::HAL_ERROR: Parameter error or operation not supported.
484 * @retval ::HAL_BUSY: Driver is busy.
485 * @retval ::HAL_TIMEOUT: Timeout occurred.
486 ****************************************************************************************
487 */
488 hal_status_t hal_gpadc_resume_reg(gpadc_handle_t *p_gpadc);
489
490 /**
491 ****************************************************************************************
492 * @brief Convert the GPADC conversion results to a voltage value.
493 *
494 * @param[in] p_gpadc: Pointer to a GPADC handle which contains the configuration information for
495 * the specified GPADC module.
496 * @param[in] inbuf: Pointer to data buffer which storage GPADC conversion results.
497 * @param[out] outbuf: Pointer to data buffer which to storage voltage results.
498 * @param[in] buflen: Length of data buffer, ranging between 0 and 4095.
499 *
500 * @return Result of operation.
501 ****************************************************************************************
502 */
503 void hal_gr55xx_gpadc_code_to_voltage(gpadc_handle_t *p_gpadc, uint16_t *inbuf, float *outbuf, uint32_t buflen);
504
505 /** @} */
506
507 /** @} */
508
509
510 #ifdef __cplusplus
511 }
512 #endif
513
514 #endif /* __GR55xx_HAL_GPADC_H__ */
515
516 /** @} */
517
518 /** @} */
519
520 /** @} */
hal_gpadc_get_error
uint32_t hal_gpadc_get_error(gpadc_handle_t *p_gpadc)
Return the GPADC error code.
gpadc_init_t
ll_gpadc_init_t gpadc_init_t
GPADC init structure definition.
Definition: gr55xx_hal_gpadc.h:100
hal_lock_t
hal_lock_t
HAL Lock structures definition.
Definition: gr55xx_hal_def.h:81
hal_gpadc_start_dma_sg_llp
hal_status_t hal_gpadc_start_dma_sg_llp(gpadc_handle_t *p_gpadc, uint16_t *p_data, uint32_t length, dma_sg_llp_config_t *sg_llp_config)
DMA for conversion.
hal_gpadc_start_dma
hal_status_t hal_gpadc_start_dma(gpadc_handle_t *p_gpadc, uint16_t *p_data, uint32_t length)
DMA for conversion.
_gpadc_handle
GPADC handle Structure definition.
Definition: gr55xx_hal_gpadc.h:111
_gpadc_handle::p_buffer
uint16_t * p_buffer
Definition: gr55xx_hal_gpadc.h:114
HAL_GPADC_STATE_ERROR
@ HAL_GPADC_STATE_ERROR
Definition: gr55xx_hal_gpadc.h:81
hal_gpadc_poll_for_conversion
hal_status_t hal_gpadc_poll_for_conversion(gpadc_handle_t *p_gpadc, uint16_t *p_data, uint32_t length)
Polling for conversion.
dma_sg_llp_config
LL DMA sg and llp config definition.
Definition: gr55xx_hal_dma.h:219
hal_gpadc_get_state
hal_gpadc_state_t hal_gpadc_get_state(gpadc_handle_t *p_gpadc)
Return the GPADC handle state.
hal_gpadc_state_t
hal_gpadc_state_t
HAL GPADC State Enumerations definition.
Definition: gr55xx_hal_gpadc.h:77
hal_gpadc_stop_dma
hal_status_t hal_gpadc_stop_dma(gpadc_handle_t *p_gpadc)
Abort ongoing conversion (blocking mode).
hal_gpadc_callback_t
struct _hal_gpadc_callback hal_gpadc_callback_t
HAL GPADC Callback function definition.
hal_gpadc_deinit
hal_status_t hal_gpadc_deinit(gpadc_handle_t *p_gpadc)
De-initialize the GPADC peripheral.
_gpadc_handle::buff_size
__IO uint32_t buff_size
Definition: gr55xx_hal_gpadc.h:116
hal_gpadc_suspend_reg
hal_status_t hal_gpadc_suspend_reg(gpadc_handle_t *p_gpadc)
Suspend some registers related to GPADC configuration before sleep.
gr55xx_ll_gpadc.h
Header file containing functions prototypes of GPADC LL library.
hal_gr55xx_gpadc_code_to_voltage
void hal_gr55xx_gpadc_code_to_voltage(gpadc_handle_t *p_gpadc, uint16_t *inbuf, float *outbuf, uint32_t buflen)
Convert the GPADC conversion results to a voltage value.
hal_gpadc_msp_init
void hal_gpadc_msp_init(gpadc_handle_t *p_gpadc)
Initialize the GPADC MSP.
_gpadc_handle::state
__IO hal_gpadc_state_t state
Definition: gr55xx_hal_gpadc.h:124
_gpadc_handle::buff_count
__IO uint32_t buff_count
Definition: gr55xx_hal_gpadc.h:118
gr55xx_hal_dma.h
Header file containing functions prototypes of DMA HAL library.
_gpadc_handle::p_dma
dma_handle_t * p_dma
Definition: gr55xx_hal_gpadc.h:120
_hal_gpadc_callback
HAL GPADC Callback function definition.
Definition: gr55xx_hal_gpadc.h:146
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
_hal_gpadc_callback::gpadc_msp_deinit
void(* gpadc_msp_deinit)(gpadc_handle_t *p_gpadc)
Definition: gr55xx_hal_gpadc.h:148
_gpadc_handle::lock
__IO hal_lock_t lock
Definition: gr55xx_hal_gpadc.h:122
_hal_gpadc_callback::gpadc_msp_init
void(* gpadc_msp_init)(gpadc_handle_t *p_gpadc)
Definition: gr55xx_hal_gpadc.h:147
HAL_GPADC_STATE_READY
@ HAL_GPADC_STATE_READY
Definition: gr55xx_hal_gpadc.h:79
hal_gpadc_resume_reg
hal_status_t hal_gpadc_resume_reg(gpadc_handle_t *p_gpadc)
Restore some registers related to GPADC configuration after sleep. This function must be used in conj...
hal_gpadc_conv_cplt_callback
void hal_gpadc_conv_cplt_callback(gpadc_handle_t *p_gpadc)
Conversion completed callback.
_gpadc_handle::error_code
__IO uint32_t error_code
Definition: gr55xx_hal_gpadc.h:126
HAL_GPADC_STATE_RESET
@ HAL_GPADC_STATE_RESET
Definition: gr55xx_hal_gpadc.h:78
_gpadc_handle::init
gpadc_init_t init
Definition: gr55xx_hal_gpadc.h:112
_gpadc_handle::retention
uint32_t retention[20]
Definition: gr55xx_hal_gpadc.h:128
hal_gpadc_msp_deinit
void hal_gpadc_msp_deinit(gpadc_handle_t *p_gpadc)
De-initialize the GPADC MSP.
hal_gpadc_init
hal_status_t hal_gpadc_init(gpadc_handle_t *p_gpadc)
Initialize the GPADC according to the specified parameters in the gpadc_init_t and initialize the ass...
gpadc_handle_t
struct _gpadc_handle gpadc_handle_t
GPADC handle Structure definition.
HAL_GPADC_STATE_BUSY
@ HAL_GPADC_STATE_BUSY
Definition: gr55xx_hal_gpadc.h:80
_dma_handle
DMA handle Structure definition.
Definition: gr55xx_hal_dma.h:277
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.
_hal_gpadc_callback::gpadc_conv_cplt_callback
void(* gpadc_conv_cplt_callback)(gpadc_handle_t *p_gpadc)
Definition: gr55xx_hal_gpadc.h:149