Driver_Init.h
Go to the documentation of this file.
1 #include <ti/drivers/ADC.h>
2 
3 // Define name for ADC index
4 // This is an index into the ADC_config[] array
5 #define ADC_INSTANCE 0
6 
7 // One-time init of ADC driver
8 ADC_init();
9 
10 // Initialize optional ADC parameters
12 ADC_Params_init(&params);
13 
14 // Open ADC instance for usage
16 
17 // Sample the analog pin
18 ADC_convert(adcHandle, &result);
19 
20 // Convert the sample to microvolts
21 resultUv = ADC_convertToMicroVolts(adcHandle, result);
22 
23 ADC_close(adcHandle);
ADC driver&#39;s custom configuration structure.
Definition: ADC.h:386
ADC_Params params
Definition: Driver_Init.h:11
ADC Parameters used with ADC_open().
Definition: ADC.h:287
uint32_t ADC_convertToMicroVolts(ADC_Handle handle, uint16_t adcValue)
Function to convert a raw ADC sample into microvolts.
void ADC_Params_init(ADC_Params *params)
Initialize an ADC_Params structure to its default values.
Analog to Digital Conversion (ADC) Input Driver.
ADC_Handle ADC_open(uint_least8_t index, ADC_Params *params)
Function to initialize the ADC peripheral.
ADC_convert(adcHandle, &result)
ADC_Handle adcHandle
Definition: Driver_Init.h:15
resultUv
Definition: Driver_Init.h:21
ADC_init()
Function to initialize the ADC driver.
ADC_close(adcHandle)
#define ADC_INSTANCE
Definition: Driver_Init.h:5
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale