36 #define IOT_ADC_SUCCESS ( 0 ) 37 #define IOT_ADC_FAILED ( 1 ) 38 #define IOT_ADC_INVALID_VALUE ( 2 ) 39 #define IOT_ADC_NOT_OPEN ( 3 ) 40 #define IOT_ADC_FUNCTION_NOT_SUPPORTED ( 4 ) 41 #define IOT_ADC_CH_BUSY ( 5 ) 47 struct IotAdcDescriptor; 66 void * pvUserContext );
130 uint8_t ucAdcChannel,
132 void * pvUserContext );
194 uint8_t ucAdcChannel );
208 uint8_t ucAdcChannel );
254 uint8_t ucAdcChannel,
255 uint16_t * pusAdcSample );
264 typedef struct IotAdcConfig_s
281 typedef struct IotAdcChStatus_s
298 typedef struct IotAdcChBuffer_s
313 typedef struct IoTAdcChain_s
329 typedef enum IotAdcIoctlRequest_s
356 void *
const pvBuffer );
uint8_t ucAdcResolution
Definition: iot_adc.h:269
Definition: iot_adc.h:334
uint8_t ucAdcChannel
Definition: iot_adc.h:300
data structure for ioctl GetChStatus
Definition: iot_adc.h:281
Definition: iot_adc.h:335
Definition: iot_adc.h:331
uint8_t ucBufLen
Definition: iot_adc.h:302
void iot_adc_set_callback(IotAdcHandle_t const pxAdc, uint8_t ucAdcChannel, IotAdcCallback_t xAdcCallback, void *pvUserContext)
Sets channel callback on availability of channel scan data. On availability of ADC scan data...
struct IotAdcDescriptor * IotAdcHandle_t
IotAdcHandle_t is the handle type returned by calling iot_adc_open(). This is initialized in open and...
Definition: iot_adc.h:54
data structures for ioctl request
Definition: iot_adc.h:264
void(* IotAdcCallback_t)(uint16_t *pusConvertedData, void *pvUserContext)
adc notification callback type
Definition: iot_adc.h:65
int32_t iot_adc_close(IotAdcHandle_t const pxAdc)
Close ADC controller. All pending operation will be cancelled, put ADC module in reset state or low p...
Definition: iot_adc.h:333
int32_t iot_adc_stop(IotAdcHandle_t const pxAdc, uint8_t ucAdcChannel)
Stop data acquisition for ADC channel.
int32_t iot_adc_read_sample(IotAdcHandle_t const pxAdc, uint8_t ucAdcChannel, uint16_t *pusAdcSample)
read one ADC data sample. This API will return one ADC sample.
IotAdcHandle_t iot_adc_open(int32_t lAdc)
Initializes ADC controller with default configuration. init ADC controller, enable ADC clock...
uint16_t usChainMask
Definition: iot_adc.h:321
uint8_t ucAdcChannel
Definition: iot_adc.h:283
IotAdcChState_t xAdcChState
Definition: iot_adc.h:284
IotAdcChState_t
Definition: iot_adc.h:272
Definition: iot_adc.h:332
uint32_t ulAdcSampleTime
Definition: iot_adc.h:266
IotAdcIoctlRequest_t
adc ioctl request types.
Definition: iot_adc.h:329
Definition: iot_adc.h:274
int32_t iot_adc_ioctl(IotAdcHandle_t const pxAdc, IotAdcIoctlRequest_t xRequest, void *const pvBuffer)
Used for various ADC control functions.
uint8_t ucBufLen
Definition: iot_adc.h:320
Definition: iot_adc.h:275
void * pvBuffer
Definition: iot_adc.h:301
void * pvBuffer
Definition: iot_adc.h:318
uint8_t ucAdcChannel
Definition: iot_adc.h:315
data structure for ioctl SetChBuffer setting channel data buffer is optional using this ioctl if clie...
Definition: iot_adc.h:298
Some ADC host controller supports grouping multiple ADC channels into a chain. When the chain is trig...
Definition: iot_adc.h:313
int32_t iot_adc_start(IotAdcHandle_t const pxAdc, uint8_t ucAdcChannel)
Start data acquisition for ADC channel until iot_adc_stop API is called. data will be passed back to ...