Header for A/D converter. More...
Go to the source code of this file.
Defines | |
#define | NUM_ADC_USERS 3 |
Be sure to update NUM_ADC_USERS if additional users are added to the ADCUser list. | |
Typedefs | |
typedef int8u | ADCChannelType |
A type for the channel enumeration (such as ADC_SOURCE_ADC0_GND). | |
Enumerations | |
enum | { ADC_USER_LQI = 0, ADC_USER_APP = 1, ADC_USER_APP2 = 2 } |
enum | { ADC_REF_AREF = 0x00, ADC_REF_AVCC = 0x40, ADC_REF_INT = 0xC0 } |
enum | { ADC_CONVERSION_TIME_US_32 = 0x0, ADC_CONVERSION_TIME_US_64 = 0x1, ADC_CONVERSION_TIME_US_128 = 0x2, ADC_CONVERSION_TIME_US_256 = 0x3, ADC_CONVERSION_TIME_US_512 = 0x4, ADC_CONVERSION_TIME_US_1024 = 0x5, ADC_CONVERSION_TIME_US_2048 = 0x6, ADC_CONVERSION_TIME_US_4096 = 0x7 } |
Functions | |
void | halInternalInitAdc (void) |
Initializes and powers-up the ADC. | |
StStatus | halStartAdcConversion (ADCUser id, ADCReferenceType reference, ADCChannelType channel, ADCRateType rate) |
Starts an ADC conversion for the user specified by id . | |
StStatus | halRequestAdcData (ADCUser id, int16u *value) |
Returns the status of a pending conversion previously started by halStartAdcConversion(). | |
StStatus | halReadAdcBlocking (ADCUser id, int16u *value) |
Waits for the user's request to complete and then, if a conversion was done, writes the raw register value of the conversion (the unaltered value taken directly from the ADC's data register) into value and returns ADC_CONVERSION_DONE, or immediately returns ADC_NO_CONVERSION_PENDING. | |
StStatus | halAdcCalibrate (ADCUser id) |
Calibrates or recalibrates the ADC system. | |
int16s | halConvertValueToVolts (int16u value) |
Convert the raw register value (the unaltered value taken directly from the ADC's data register) into a signed fixed point value with units 10^-4 Volts. | |
void | stCalibrateVref (void) |
Calibrates Vref to be 1.2V +/-10mV. |
Header for A/D converter.
Definition in file adc.h.