28 #ifdef CONFIG_ADC_MULTI
33 struct adc *(*adc_init)(uint32_t index, uint8_t bits, uint32_t hz);
35 int32_t (*
adc_get)(
struct adc *adc, TickType_t waittime);
37 int32_t (*
adc_setCallback)(
struct adc *adc, bool (*callback)(
struct adc *adc, uint32_t channel, int32_t value,
void *data),
void *data);
39 int32_t (*
adc_stop)(
struct adc *adc);
51 #ifdef CONFIG_INSTANCE_NAME
57 #ifdef CONFIG_ADC_THREAD_SAVE
63 #ifdef CONFIG_ADC_MULTI
67 const struct adc_ops *ops;
70 #ifndef CONFIG_ADC_MULTI
78 struct adc *
adc_init(uint32_t index, uint8_t bits, uint32_t hz);
91 int32_t
adc_get(
struct adc *adc, TickType_t waittime);
105 int32_t
adc_setCallback(
struct adc *adc,
bool (*callback)(
struct adc *adc, uint32_t channel, int32_t value,
void *data),
void *data);
119 inline struct adc *
adc_init(uint32_t index, uint8_t bits, uint32_t hz) {
125 return a->ops->adc_init(index, bits, hz);
129 return a->ops->adc_deinit(adc);
131 inline int32_t
adc_get(
struct adc *adc, TickType_t waittime) {
133 return a->ops->adc_get(adc, waittime);
137 return a->ops->adc_getISR(adc);
139 inline int32_t
adc_setCallback(
struct adc *adc,
bool (*callback)(
struct adc *adc, uint32_t channel, int32_t value,
void *data),
void *data) {
141 return a->ops->adc_setCallback(adc, callback, data);
143 inline int32_t
adc_start(
struct adc *adc) {
145 return a->ops->adc_start(adc);
147 inline int32_t
adc_stop(
struct adc *adc) {
149 return a->ops->adc_stop(adc);