Functions

uint16_t app_adc_init (app_adc_params_t *p_params, app_adc_evt_handler_t evt_handler)
 Initialize the APP ADC DRIVER according to the specified parameters in the app_adc_params_t and app_adc_evt_handler_t. More...
 
uint16_t app_adc_deinit (void)
 De-initialize the APP ADC DRIVER peripheral. More...
 
uint16_t app_adc_conversion_sync (uint16_t *p_data, uint32_t length, uint32_t timeout)
 Polling for conversion. More...
 
uint16_t app_adc_conversion_async (uint16_t *p_data, uint32_t length)
 DMA for conversion. More...
 
uint16_t app_adc_voltage_intern (uint16_t *inbuf, double *outbuf, uint32_t buflen)
 Convert the ADC conversion results to a voltage value(internal reference). More...
 
uint16_t app_adc_voltage_extern (double ref, uint16_t *inbuf, double *outbuf, uint32_t buflen)
 Convert the ADC conversion results to a voltage value(external reference). More...
 
adc_handle_tapp_adc_get_handle (void)
 Return the ADC handle. More...
 
uint16_t app_adc_multi_channel_conversion_async (app_adc_sample_node_t *p_begin_node, uint32_t total_nodes)
 DMA for multi channels conversion; evt_handler in app_adc_init will callback when all channels finish. More...
 
uint16_t app_adc_dma_init (app_adc_params_t *p_params)
 Initialize the APP ADC DRIVER according to the specified parameters in the app_adc_params_t and app_adc_evt_handler_t. More...
 
uint16_t app_adc_dma_deinit (void)
 De-initialize the APP ADC DRIVER peripheral. More...
 
uint16_t app_adc_dma_conversion_async (uint16_t *p_data, uint32_t length)
 DMA for conversion. More...
 

Detailed Description

Function Documentation

◆ app_adc_conversion_async()

uint16_t app_adc_conversion_async ( uint16_t *  p_data,
uint32_t  length 
)

DMA for conversion.

Parameters
[in]p_dataPointer to data buffer which to storage ADC conversion results.
[in]lengthLength of data buffer, ranging between 0 and 4095.
Returns
Result of operation.

◆ app_adc_conversion_sync()

uint16_t app_adc_conversion_sync ( uint16_t *  p_data,
uint32_t  length,
uint32_t  timeout 
)

Polling for conversion.

Parameters
[in]p_dataPointer to data buffer which to storage ADC conversion results.
[in]lengthLength of data buffer.
[in]timeout: Timeout duration
Returns
Result of operation.

◆ app_adc_deinit()

uint16_t app_adc_deinit ( void  )

De-initialize the APP ADC DRIVER peripheral.

Returns
Result of De-initialization.

◆ app_adc_dma_conversion_async()

uint16_t app_adc_dma_conversion_async ( uint16_t *  p_data,
uint32_t  length 
)

DMA for conversion.

Parameters
[in]p_dataPointer to data buffer which to storage ADC conversion results.
[in]lengthLength of data buffer, ranging between 0 and 4095.
Returns
Result of operation.

◆ app_adc_dma_deinit()

uint16_t app_adc_dma_deinit ( void  )

De-initialize the APP ADC DRIVER peripheral.

Returns
Result of De-initialization.

◆ app_adc_dma_init()

uint16_t app_adc_dma_init ( app_adc_params_t p_params)

Initialize the APP ADC DRIVER according to the specified parameters in the app_adc_params_t and app_adc_evt_handler_t.

Note
If DMA mode is set, you can use blocking mode. Conversely, if blocking mode is set, you can't use DMA mode.
Parameters
[in]p_paramsPointer to app_adc_params_t parameter which contains the configuration information for the specified ADC module.
Returns
Result of initialization.

◆ app_adc_get_handle()

adc_handle_t* app_adc_get_handle ( void  )

Return the ADC handle.

Returns
Pointer to the ADC handle.

◆ app_adc_init()

uint16_t app_adc_init ( app_adc_params_t p_params,
app_adc_evt_handler_t  evt_handler 
)

Initialize the APP ADC DRIVER according to the specified parameters in the app_adc_params_t and app_adc_evt_handler_t.

Note
If DMA mode is set, you can use blocking mode. Conversely, if blocking mode is set, you can't use DMA mode.
Parameters
[in]p_paramsPointer to app_adc_params_t parameter which contains the configuration information for the specified ADC module.
[in]evt_handlerADC user callback function.
Returns
Result of initialization.

◆ app_adc_multi_channel_conversion_async()

uint16_t app_adc_multi_channel_conversion_async ( app_adc_sample_node_t p_begin_node,
uint32_t  total_nodes 
)

DMA for multi channels conversion; evt_handler in app_adc_init will callback when all channels finish.

Parameters
[in]p_begin_nodePointer to the multi sample channels list node.
[in]total_nodestotal sample channels.
Returns
Result of operation.

◆ app_adc_voltage_extern()

uint16_t app_adc_voltage_extern ( double  ref,
uint16_t *  inbuf,
double *  outbuf,
uint32_t  buflen 
)

Convert the ADC conversion results to a voltage value(external reference).

Parameters
[in]refslope of ADC.
[in]inbufPointer to data buffer which storage ADC conversion results.
[out]outbufPointer to data buffer which to storage voltage results.
[in]buflenLength of data buffer.
Returns
Result of operation.

◆ app_adc_voltage_intern()

uint16_t app_adc_voltage_intern ( uint16_t *  inbuf,
double *  outbuf,
uint32_t  buflen 
)

Convert the ADC conversion results to a voltage value(internal reference).

Parameters
[in]inbufPointer to data buffer which storage ADC conversion results.
[out]outbufPointer to data buffer which to storage voltage results.
[in]buflenLength of data buffer.
Returns
Result of operation.