5.1.4.1 adc_async_init
Initialize ADC.
int32_t adc_async_init(
struct adc_async_descriptor *const descr,
void *const hw,
uint8_t * channel_map,
uint8_t channel_max,
uint8_t channel_amount,
struct adc_async_channel_descriptor *const descr_ch,
void *const func
)
This function initializes the given ADC descriptor. It checks if the given hardware is not initialized and if the given hardware is permitted to be initialized.
Parameters
- descr
-
Type: struct adc_async_descriptor Struct *const
An ADC descriptor to initialize
- hw
-
Type: void *const
The pointer to hardware instance
- channel_map
-
Type: uint8_t *
The pointer to ADC channel mapping
- channel_max
-
Type: uint8_t
ADC enabled maximum channel number
- channel_amount
-
Type: uint8_t
ADC enabled channel amount
- descr_ch
-
Type: struct adc_async_channel_descriptor Struct *const
A buffer to keep all channel descriptor
- func
-
Type: void *const
The pointer to as set of functions pointers
Returns
Type: int32_t
Initialization status.
- -1
-
Passed parameters were invalid or an ADC is already initialized
- 0
-
The initialization is completed successfully