5.3.2.1 adc_os_init
Initialize ADC.
int32_t adc_os_init(
struct adc_os_descriptor *const descr,
void *const hw,
uint8_t * channel_map,
uint8_t channel_max,
uint8_t channel_amount,
struct adc_os_channel_descriptor *const descr_ch
)
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_os_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_os_channel_descriptor Struct *const
A buffer to keep all channel descriptor
Returns
Type: int32_t
Initialization status.
- <0
-
Passed parameters were invalid or an ADC is already initialized
- ERR_NONE
-
The initialization is completed successfully