|
struct adc * | adc_init (uint32_t index, uint8_t bits, uint32_t hz) |
|
int32_t | adc_deinit (struct adc *adc) |
|
int32_t | adc_get (struct adc *adc, TickType_t waittime) |
|
int32_t | adc_getISR (struct adc *adc) |
|
int32_t | adc_setCallback (struct adc *adc, bool(*callback)(struct adc *adc, uint32_t channel, int32_t value, void *data), void *data) |
|
int32_t | adc_start (struct adc *adc) |
|
int32_t | adc_stop (struct adc *adc) |
|
This is the ADC Subsystem for controlling ADC of a SOC.
◆ adc_deinit()
int32_t adc_deinit |
( |
struct adc * |
adc | ) |
|
Deinit ADC
- Parameters
-
- Returns
- -1 on error 0 on ok
◆ adc_get()
int32_t adc_get |
( |
struct adc * |
adc, |
|
|
TickType_t |
waittime |
|
) |
| |
Get ADC Value
- Parameters
-
adc | ADC instance |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error >= 0 Value
◆ adc_getISR()
int32_t adc_getISR |
( |
struct adc * |
adc | ) |
|
Get ADC Value in Interrupt Service Routine
- Parameters
-
- Returns
- -1 on error >= 0 Value
◆ adc_init()
struct adc* adc_init |
( |
uint32_t |
index, |
|
|
uint8_t |
bits, |
|
|
uint32_t |
hz |
|
) |
| |
init ADC instance
- Parameters
-
index | Index of PWM |
bits | bit wide of ADC common: 4, 8, 12. 0 on only get instance |
hz | Sample frequency |
- Returns
- ADC Instance NULL on Error if only get instance on bits == 0
◆ adc_setCallback()
int32_t adc_setCallback |
( |
struct adc * |
adc, |
|
|
bool(*)(struct adc *adc, uint32_t channel, int32_t value, void *data) |
callback, |
|
|
void * |
data |
|
) |
| |
Set ADC Interrupt Callback
- Parameters
-
adc | ADC instance |
callback | Callback |
data | Data parsed to Callback |
- Returns
- -1 on error 0 on ok
◆ adc_start()
int32_t adc_start |
( |
struct adc * |
adc | ) |
|
Start ADC Sampling only needed if Callback is set
- Parameters
-
- Returns
- -1 on error 0 on ok
◆ adc_stop()
int32_t adc_stop |
( |
struct adc * |
adc | ) |
|
Stop ADC Sampling only needed if Callback is set
- Parameters
-
- Returns
- -1 on error 0 on ok