Initialization and Configuration functions.
More...
|
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 associated handle. More...
|
|
hal_status_t | hal_gpadc_deinit (gpadc_handle_t *p_gpadc) |
| De-initialize the GPADC peripheral. More...
|
|
void | hal_gpadc_msp_init (gpadc_handle_t *p_gpadc) |
| Initialize the GPADC MSP. More...
|
|
void | hal_gpadc_msp_deinit (gpadc_handle_t *p_gpadc) |
| De-initialize the GPADC MSP. More...
|
|
hal_status_t | hal_gpadc_poll_for_conversion (gpadc_handle_t *p_gpadc, uint16_t *p_data, uint32_t length) |
| Polling for conversion. More...
|
|
hal_status_t | hal_gpadc_start_dma (gpadc_handle_t *p_gpadc, uint16_t *p_data, uint32_t length) |
| DMA for conversion. More...
|
|
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. More...
|
|
hal_status_t | hal_gpadc_stop_dma (gpadc_handle_t *p_gpadc) |
| Abort ongoing conversion (blocking mode). More...
|
|
void | hal_gpadc_conv_cplt_callback (gpadc_handle_t *p_gpadc) |
| Conversion completed callback. More...
|
|
hal_gpadc_state_t | hal_gpadc_get_state (gpadc_handle_t *p_gpadc) |
| Return the GPADC handle state. More...
|
|
uint32_t | hal_gpadc_get_error (gpadc_handle_t *p_gpadc) |
| Return the GPADC error code. More...
|
|
hal_status_t | hal_gpadc_suspend_reg (gpadc_handle_t *p_gpadc) |
| Suspend some registers related to GPADC configuration before sleep. More...
|
|
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 conjunction with the hal_gpadc_suspend_reg(). More...
|
|
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. More...
|
|
Initialization and Configuration functions.
◆ hal_gpadc_conv_cplt_callback()
Conversion completed callback.
- Note
- This function should not be modified. When the callback is needed, the hal_gpadc_msp_deinit can be implemented in the user file.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle which contains the configuration information for the specified GPADC module. |
◆ hal_gpadc_deinit()
De-initialize the GPADC peripheral.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle which contains the configuration information for the specified GPADC module. |
- Return values
-
◆ hal_gpadc_get_error()
Return the GPADC error code.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle which contains the configuration information for the specified GPADC module. |
- Returns
- GPADC error code in bitmap format
◆ hal_gpadc_get_state()
Return the GPADC handle state.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle which contains the configuration information for the specified GPADC module. |
- Return values
-
◆ hal_gpadc_init()
Initialize the GPADC according to the specified parameters in the gpadc_init_t and initialize the associated handle.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle which contains the configuration information for the specified GPADC module. |
- Return values
-
◆ hal_gpadc_msp_deinit()
De-initialize the GPADC MSP.
- Note
- This function should not be modified. When the callback is needed, the hal_gpadc_msp_deinit can be implemented in the user file.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle which contains the configuration information for the specified GPADC module. |
◆ hal_gpadc_msp_init()
Initialize the GPADC MSP.
- Note
- This function should not be modified. When the callback is needed, the hal_gpadc_msp_deinit can be implemented in the user file.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle which contains the configuration information for the specified GPADC module. |
◆ hal_gpadc_poll_for_conversion()
Polling for conversion.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle. |
[in] | p_data | Pointer to data buffer which to store GPADC conversion results. |
[in] | length | Length of data buffer. |
- Return values
-
◆ hal_gpadc_resume_reg()
Restore some registers related to GPADC configuration after sleep. This function must be used in conjunction with the hal_gpadc_suspend_reg().
- Parameters
-
[in] | p_gpadc | Pointer to a GPADC handle which contains the configuration information for the specified GPADC module. |
- Return values
-
◆ hal_gpadc_start_dma()
DMA for conversion.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle. |
[in] | p_data | Pointer to data buffer which to store GPADC conversion results. |
[in] | length | Length of data buffer, ranging between 0 and 4095. |
- Return values
-
◆ hal_gpadc_start_dma_sg_llp()
DMA for conversion.
- Parameters
-
[in] | p_gpadc | Pointer to an GPADC handle. |
[in] | p_data | Pointer to data buffer which to store GPADC conversion results. |
[in] | length | Length of data buffer, ranging between 0 and 4095. |
[in] | sg_llp_config | The config of source and destination's SG and LLP functions. |
- Return values
-
◆ hal_gpadc_stop_dma()
Abort ongoing conversion (blocking mode).
- Note
- This procedure could be only used for aborting conversion started in DMA mode. This procedure performs following operations:
- Disable GPADC clock, stop conversion
- Abort DMA transfer by calling hal_dma_abort (in case of transfer in DMA mode)
- Set handle State to READY. This procedure is executed in blocking mode: when exiting function, Abort is considered as completed.
- Parameters
-
- Return values
-
◆ hal_gpadc_suspend_reg()
Suspend some registers related to GPADC configuration before sleep.
- Parameters
-
[in] | p_gpadc | Pointer to a GPADC handle which contains the configuration information for the specified GPADC module. |
- Return values
-
◆ 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.
- Parameters
-
[in] | p_gpadc | Pointer to a GPADC handle which contains the configuration information for the specified GPADC module. |
[in] | inbuf | Pointer to data buffer which storage GPADC conversion results. |
[out] | outbuf | Pointer to data buffer which to storage voltage results. |
[in] | buflen | Length of data buffer, ranging between 0 and 4095. |
- Returns
- Result of operation.