This module contains APIs to program and use the ADC module.
|
static void | ADC_setPrescaler (uint32_t base, ADC_ClkPrescale clkPrescale) |
|
static void | ADC_setupSOC (uint32_t base, ADC_SOCNumber socNumber, ADC_Trigger trigger, ADC_Channel channel, uint32_t sampleWindow) |
|
static void | ADC_setInterruptSOCTrigger (uint32_t base, ADC_SOCNumber socNumber, ADC_IntSOCTrigger trigger) |
|
static void | ADC_setInterruptPulseMode (uint32_t base, ADC_PulseMode pulseMode) |
|
static void | ADC_setInterruptCycleOffset (uint32_t base, uint16_t cycleOffset) |
|
static void | ADC_enableConverter (uint32_t base) |
|
static void | ADC_disableConverter (uint32_t base) |
|
static void | ADC_forceSOC (uint32_t base, ADC_SOCNumber socNumber) |
|
static void | ADC_forceMultipleSOC (uint32_t base, uint16_t socMask) |
|
static bool | ADC_getInterruptStatus (uint32_t base, ADC_IntNumber adcIntNum) |
|
static void | ADC_clearInterruptStatus (uint32_t base, ADC_IntNumber adcIntNum) |
|
static bool | ADC_getInterruptOverflowStatus (uint32_t base, ADC_IntNumber adcIntNum) |
|
static void | ADC_clearInterruptOverflowStatus (uint32_t base, ADC_IntNumber adcIntNum) |
|
static uint16_t | ADC_readResult (uint32_t resultBase, ADC_SOCNumber socNumber) |
|
static bool | ADC_isBusy (uint32_t base) |
|
static void | ADC_setBurstModeConfig (uint32_t base, ADC_Trigger trigger, uint16_t burstSize) |
|
static void | ADC_enableBurstMode (uint32_t base) |
|
static void | ADC_disableBurstMode (uint32_t base) |
|
static void | ADC_setSOCPriority (uint32_t base, ADC_PriorityMode priMode) |
|
static void | ADC_setupPPB (uint32_t base, ADC_PPBNumber ppbNumber, ADC_SOCNumber socNumber) |
|
static void | ADC_enablePPBEvent (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags) |
|
static void | ADC_disablePPBEvent (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags) |
|
static void | ADC_enablePPBEventInterrupt (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t intFlags) |
|
static void | ADC_disablePPBEventInterrupt (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t intFlags) |
|
static uint16_t | ADC_getPPBEventStatus (uint32_t base, ADC_PPBNumber ppbNumber) |
|
static void | ADC_clearPPBEventStatus (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t evtFlags) |
|
static int32_t | ADC_readPPBResult (uint32_t resultBase, ADC_PPBNumber ppbNumber) |
|
static uint16_t | ADC_getPPBDelayTimeStamp (uint32_t base, ADC_PPBNumber ppbNumber) |
|
static void | ADC_setPPBCalibrationOffset (uint32_t base, ADC_PPBNumber ppbNumber, int16_t offset) |
|
static void | ADC_setPPBReferenceOffset (uint32_t base, ADC_PPBNumber ppbNumber, uint16_t offset) |
|
static void | ADC_enablePPBTwosComplement (uint32_t base, ADC_PPBNumber ppbNumber) |
|
static void | ADC_disablePPBTwosComplement (uint32_t base, ADC_PPBNumber ppbNumber) |
|
static void | ADC_enablePPBEventCBCClear (uint32_t base, uint32_t ppbNumber) |
|
static void | ADC_disablePPBEventCBCClear (uint32_t base, uint32_t ppbNumber) |
|
static void | ADC_enableInterrupt (uint32_t base, ADC_IntNumber adcIntNum) |
|
static void | ADC_disableInterrupt (uint32_t base, ADC_IntNumber adcIntNum) |
|
static void | ADC_setInterruptSource (uint32_t base, ADC_IntNumber adcIntNum, ADC_SOCNumber socNumber) |
|
static void | ADC_enableContinuousMode (uint32_t base, ADC_IntNumber adcIntNum) |
|
static void | ADC_disableContinuousMode (uint32_t base, ADC_IntNumber adcIntNum) |
|
void | ADC_setMode (uint32_t base, ADC_Resolution resolution, ADC_SignalMode signalMode) |
|
void | ADC_setPPBTripLimits (uint32_t base, ADC_PPBNumber ppbNumber, int32_t tripHiLimit, int32_t tripLoLimit) |
|
|
enum | ADC_ClkPrescale {
ADC_CLK_DIV_1_0 = 0,
ADC_CLK_DIV_2_0 = 2,
ADC_CLK_DIV_2_5 = 3,
ADC_CLK_DIV_3_0 = 4,
ADC_CLK_DIV_3_5 = 5,
ADC_CLK_DIV_4_0 = 6,
ADC_CLK_DIV_4_5 = 7,
ADC_CLK_DIV_5_0 = 8,
ADC_CLK_DIV_5_5 = 9,
ADC_CLK_DIV_6_0 = 10,
ADC_CLK_DIV_6_5 = 11,
ADC_CLK_DIV_7_0 = 12,
ADC_CLK_DIV_7_5 = 13,
ADC_CLK_DIV_8_0 = 14,
ADC_CLK_DIV_8_5 = 15
} |
|
enum | ADC_Resolution { ADC_RESOLUTION_12BIT = 0
} |
|
enum | ADC_SignalMode { ADC_MODE_SINGLE_ENDED = 0,
ADC_MODE_DIFFERENTIAL = 1
} |
|
enum | ADC_Trigger {
ADC_TRIGGER_SW_ONLY = 0x00,
ADC_TRIGGER_RTI0 = 0x01,
ADC_TRIGGER_RTI1 = 0x02,
ADC_TRIGGER_RTI2 = 0x03,
ADC_TRIGGER_RTI3 = 0x04,
ADC_TRIGGER_INPUT_XBAR_OUT5 = 0x05,
ADC_TRIGGER_EPWM0_SOCA = 0x08,
ADC_TRIGGER_EPWM0_SOCB = 0x09,
ADC_TRIGGER_EPWM1_SOCA = 0x0A,
ADC_TRIGGER_EPWM1_SOCB = 0x0B,
ADC_TRIGGER_EPWM2_SOCA = 0x0C,
ADC_TRIGGER_EPWM2_SOCB = 0x0D,
ADC_TRIGGER_EPWM3_SOCA = 0x0E,
ADC_TRIGGER_EPWM3_SOCB = 0x0F,
ADC_TRIGGER_EPWM4_SOCA = 0x10,
ADC_TRIGGER_EPWM4_SOCB = 0x11,
ADC_TRIGGER_EPWM5_SOCA = 0x12,
ADC_TRIGGER_EPWM5_SOCB = 0x13,
ADC_TRIGGER_EPWM6_SOCA = 0x14,
ADC_TRIGGER_EPWM6_SOCB = 0x15,
ADC_TRIGGER_EPWM7_SOCA = 0x16,
ADC_TRIGGER_EPWM7_SOCB = 0x17,
ADC_TRIGGER_EPWM8_SOCA = 0x18,
ADC_TRIGGER_EPWM8_SOCB = 0x19,
ADC_TRIGGER_EPWM9_SOCA = 0x1A,
ADC_TRIGGER_EPWM9_SOCB = 0x1B,
ADC_TRIGGER_EPWM10_SOCA = 0x1C,
ADC_TRIGGER_EPWM10_SOCB = 0x1D,
ADC_TRIGGER_EPWM11_SOCA = 0x1E,
ADC_TRIGGER_EPWM11_SOCB = 0x1F,
ADC_TRIGGER_EPWM12_SOCA = 0x20,
ADC_TRIGGER_EPWM12_SOCB = 0x21,
ADC_TRIGGER_EPWM13_SOCA = 0x22,
ADC_TRIGGER_EPWM13_SOCB = 0x23,
ADC_TRIGGER_EPWM14_SOCA = 0x24,
ADC_TRIGGER_EPWM14_SOCB = 0x25,
ADC_TRIGGER_EPWM15_SOCA = 0x26,
ADC_TRIGGER_EPWM15_SOCB = 0x27,
ADC_TRIGGER_EPWM16_SOCA = 0x28,
ADC_TRIGGER_EPWM16_SOCB = 0x29,
ADC_TRIGGER_EPWM17_SOCA = 0x2A,
ADC_TRIGGER_EPWM17_SOCB = 0x2B,
ADC_TRIGGER_EPWM18_SOCA = 0x2C,
ADC_TRIGGER_EPWM18_SOCB = 0x2D,
ADC_TRIGGER_EPWM19_SOCA = 0x2E,
ADC_TRIGGER_EPWM19_SOCB = 0x2F,
ADC_TRIGGER_EPWM20_SOCA = 0x30,
ADC_TRIGGER_EPWM20_SOCB = 0x31,
ADC_TRIGGER_EPWM21_SOCA = 0x32,
ADC_TRIGGER_EPWM21_SOCB = 0x33,
ADC_TRIGGER_EPWM22_SOCA = 0x34,
ADC_TRIGGER_EPWM22_SOCB = 0x35,
ADC_TRIGGER_EPWM23_SOCA = 0x36,
ADC_TRIGGER_EPWM23_SOCB = 0x37,
ADC_TRIGGER_EPWM24_SOCA = 0x38,
ADC_TRIGGER_EPWM24_SOCB = 0x39,
ADC_TRIGGER_EPWM25_SOCA = 0x3A,
ADC_TRIGGER_EPWM25_SOCB = 0x3B,
ADC_TRIGGER_EPWM26_SOCA = 0x3C,
ADC_TRIGGER_EPWM26_SOCB = 0x3D,
ADC_TRIGGER_EPWM27_SOCA = 0x3E,
ADC_TRIGGER_EPWM27_SOCB = 0x3F,
ADC_TRIGGER_EPWM28_SOCA = 0x40,
ADC_TRIGGER_EPWM28_SOCB = 0x41,
ADC_TRIGGER_EPWM29_SOCA = 0x42,
ADC_TRIGGER_EPWM29_SOCB = 0x43,
ADC_TRIGGER_EPWM30_SOCA = 0x44,
ADC_TRIGGER_EPWM30_SOCB = 0x45,
ADC_TRIGGER_EPWM31_SOCA = 0x46,
ADC_TRIGGER_EPWM31_SOCB = 0x47,
ADC_TRIGGER_ECAP0_SOCEVT = 0x48,
ADC_TRIGGER_ECAP1_SOCEVT = 0x49,
ADC_TRIGGER_ECAP2_SOCEVT = 0x4A,
ADC_TRIGGER_ECAP3_SOCEVT = 0x4B,
ADC_TRIGGER_ECAP4_SOCEVT = 0x4C,
ADC_TRIGGER_ECAP5_SOCEVT = 0x4D,
ADC_TRIGGER_ECAP6_SOCEVT = 0x4E,
ADC_TRIGGER_ECAP7_SOCEVT = 0x4F,
ADC_TRIGGER_ECAP8_SOCEVT = 0x50,
ADC_TRIGGER_ECAP9_SOCEVT = 0x51
} |
|
enum | ADC_Channel {
ADC_CH_ADCIN0 = 0,
ADC_CH_ADCIN1 = 1,
ADC_CH_ADCIN2 = 2,
ADC_CH_ADCIN3 = 3,
ADC_CH_ADCIN4 = 4,
ADC_CH_ADCIN5 = 5,
ADC_CH_CAL0 = 6,
ADC_CH_CAL1 = 7,
ADC_CH_ADCIN0_ADCIN1 = 0,
ADC_CH_ADCIN1_ADCIN0 = 1,
ADC_CH_ADCIN2_ADCIN3 = 2,
ADC_CH_ADCIN3_ADCIN2 = 3,
ADC_CH_ADCIN4_ADCIN5 = 4,
ADC_CH_ADCIN5_ADCIN4 = 5,
ADC_CH_CAL0_CAL1 = 6
} |
|
enum | ADC_PulseMode { ADC_PULSE_END_OF_ACQ_WIN = 0,
ADC_PULSE_END_OF_CONV = 1
} |
|
enum | ADC_IntNumber { ADC_INT_NUMBER1 = 0,
ADC_INT_NUMBER2 = 1,
ADC_INT_NUMBER3 = 2,
ADC_INT_NUMBER4 = 3
} |
|
enum | ADC_PPBNumber { ADC_PPB_NUMBER1 = 0,
ADC_PPB_NUMBER2 = 1,
ADC_PPB_NUMBER3 = 2,
ADC_PPB_NUMBER4 = 3
} |
|
enum | ADC_SOCNumber {
ADC_SOC_NUMBER0 = 0,
ADC_SOC_NUMBER1 = 1,
ADC_SOC_NUMBER2 = 2,
ADC_SOC_NUMBER3 = 3,
ADC_SOC_NUMBER4 = 4,
ADC_SOC_NUMBER5 = 5,
ADC_SOC_NUMBER6 = 6,
ADC_SOC_NUMBER7 = 7,
ADC_SOC_NUMBER8 = 8,
ADC_SOC_NUMBER9 = 9,
ADC_SOC_NUMBER10 = 10,
ADC_SOC_NUMBER11 = 11,
ADC_SOC_NUMBER12 = 12,
ADC_SOC_NUMBER13 = 13,
ADC_SOC_NUMBER14 = 14,
ADC_SOC_NUMBER15 = 15
} |
|
enum | ADC_IntSOCTrigger { ADC_INT_SOC_TRIGGER_NONE = 0,
ADC_INT_SOC_TRIGGER_ADCINT1 = 1,
ADC_INT_SOC_TRIGGER_ADCINT2 = 2
} |
|
enum | ADC_PriorityMode {
ADC_PRI_ALL_ROUND_ROBIN = 0,
ADC_PRI_SOC0_HIPRI = 1,
ADC_PRI_THRU_SOC1_HIPRI = 2,
ADC_PRI_THRU_SOC2_HIPRI = 3,
ADC_PRI_THRU_SOC3_HIPRI = 4,
ADC_PRI_THRU_SOC4_HIPRI = 5,
ADC_PRI_THRU_SOC5_HIPRI = 6,
ADC_PRI_THRU_SOC6_HIPRI = 7,
ADC_PRI_THRU_SOC7_HIPRI = 8,
ADC_PRI_THRU_SOC8_HIPRI = 9,
ADC_PRI_THRU_SOC9_HIPRI = 10,
ADC_PRI_THRU_SOC10_HIPRI = 11,
ADC_PRI_THRU_SOC11_HIPRI = 12,
ADC_PRI_THRU_SOC12_HIPRI = 13,
ADC_PRI_THRU_SOC13_HIPRI = 14,
ADC_PRI_THRU_SOC14_HIPRI = 15,
ADC_PRI_ALL_HIPRI = 16
} |
|
static void ADC_setPrescaler |
( |
uint32_t |
base, |
|
|
ADC_ClkPrescale |
clkPrescale |
|
) |
| |
|
inlinestatic |
Configures the analog-to-digital converter module prescaler.
- Parameters
-
base | is the base address of the ADC module. |
clkPrescale | is the ADC clock prescaler. |
This function configures the ADC module's ADCCLK.
The clkPrescale parameter specifies the value by which the input clock is divided to make the ADCCLK. The clkPrescale value can be specified with any of the following variables: ADC_CLK_DIV_1_0, ADC_CLK_DIV_2_0, ADC_CLK_DIV_2_5, ..., ADC_CLK_DIV_7_5, ADC_CLK_DIV_8_0, or ADC_CLK_DIV_8_5.
- Returns
- None.
Configures a start-of-conversion (SOC) in the ADC.
- Parameters
-
base | is the base address of the ADC module. |
socNumber | is the number of the start-of-conversion. |
trigger | the source that will cause the SOC. |
channel | is the number associated with the input signal. |
sampleWindow | is the acquisition window duration. |
This function configures the a start-of-conversion (SOC) in the ADC module.
The socNumber number is a value ADC_SOC_NUMBERX where X is a number from 0 to 15 specifying which SOC is to be configured on the ADC module specified by base.
The trigger specifies the event that causes the SOC such as software, a timer interrupt, an ePWM event, or an ADC interrupt. It should be a value in the format of ADC_TRIGGER_XXXX where XXXX is the event such as ADC_TRIGGER_SW_ONLY, ADC_TRIGGER_EPWM1_SOCA, and so on.
The channel parameter specifies the channel to be converted. In single-ended mode this is a single pin given by ADC_CH_ADCINx where x is the number identifying the pin between 0 and 5 inclusive. In differential mode, two pins are used as inputs and are passed in the channel parameter as ADC_CH_ADCIN0_ADCIN1, ADC_CH_ADCIN2_ADCIN3, ..., or ADC_CH_ADCIN14_ADCIN5.
The sampleWindow parameter is the acquisition window duration in SYSCLK cycles. It should be a value between 1 and 512 cycles inclusive. The selected duration must be at least as long as one ADCCLK cycle. Also, the datasheet will specify a minimum window duration requirement in nanoseconds.
- Returns
- None.
Configures the interrupt SOC trigger of an SOC.
- Parameters
-
base | is the base address of the ADC module. |
socNumber | is the number of the start-of-conversion. |
trigger | the interrupt source that will cause the SOC. |
This function configures the interrupt start-of-conversion trigger in the ADC module.
The socNumber number is a value ADC_SOC_NUMBERX where X is a number from 0 to 15 specifying which SOC is to be configured on the ADC module specified by base.
The trigger specifies the interrupt that causes a start of conversion or none. It should be one of the following values.
- ADC_INT_SOC_TRIGGER_NONE
- ADC_INT_SOC_TRIGGER_ADCINT1
- ADC_INT_SOC_TRIGGER_ADCINT2
This functionality is useful for creating continuous conversions.
- Returns
- None.
static bool ADC_getInterruptStatus |
( |
uint32_t |
base, |
|
|
ADC_IntNumber |
adcIntNum |
|
) |
| |
|
inlinestatic |
Gets the current ADC interrupt status.
- Parameters
-
base | is the base address of the ADC module. |
adcIntNum | is interrupt number within the ADC wrapper. |
This function returns the interrupt status for the analog-to-digital converter.
adcIntNum takes a one of the values ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be cleared.
- Returns
- true if the interrupt flag for the specified interrupt number is set and false if it is not.
static void ADC_clearInterruptStatus |
( |
uint32_t |
base, |
|
|
ADC_IntNumber |
adcIntNum |
|
) |
| |
|
inlinestatic |
Clears ADC interrupt sources.
- Parameters
-
base | is the base address of the ADC module. |
adcIntNum | is interrupt number within the ADC wrapper. |
This function clears the specified ADC interrupt sources so that they no longer assert. If not in continuous mode, this function must be called before any further interrupt pulses may occur.
adcIntNum takes a one of the values ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be cleared.
- Returns
- None.
static bool ADC_getInterruptOverflowStatus |
( |
uint32_t |
base, |
|
|
ADC_IntNumber |
adcIntNum |
|
) |
| |
|
inlinestatic |
Gets the current ADC interrupt overflow status.
- Parameters
-
base | is the base address of the ADC module. |
adcIntNum | is interrupt number within the ADC wrapper. |
This function returns the interrupt overflow status for the analog-to-digital converter. An overflow condition is generated irrespective of the continuous mode.
adcIntNum takes a one of the values ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be cleared.
- Returns
- true if the interrupt overflow flag for the specified interrupt number is set and false if it is not.
static void ADC_clearInterruptOverflowStatus |
( |
uint32_t |
base, |
|
|
ADC_IntNumber |
adcIntNum |
|
) |
| |
|
inlinestatic |
Clears ADC interrupt overflow sources.
- Parameters
-
base | is the base address of the ADC module. |
adcIntNum | is interrupt number within the ADC wrapper. |
This function clears the specified ADC interrupt overflow sources so that they no longer assert. If software tries to clear the overflow in the same cycle that hardware tries to set the overflow, then hardware has priority.
adcIntNum takes a one of the values ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be cleared.
- Returns
- None.
static void ADC_setPPBCalibrationOffset |
( |
uint32_t |
base, |
|
|
ADC_PPBNumber |
ppbNumber, |
|
|
int16_t |
offset |
|
) |
| |
|
inlinestatic |
Sets the post processing block offset correction.
- Parameters
-
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
offset | is the 10-bit signed value subtracted from ADC the output. |
This function sets the PPB offset correction value. This value can be used to digitally remove any system-level offset inherent in the ADCIN circuit before it is stored in the appropriate result register. The offset parameter is subtracted from the ADC output and is a signed value from -512 to 511 inclusive. For example, when offset = 1, ADCRESULT = ADC output - 1. When offset = -512, ADCRESULT = ADC output - (-512) or ADC output + 512.
Passing a zero in to the offset parameter will effectively disable the calculation, allowing the raw ADC result to be passed unchanged into the result register.
- Note
- If multiple PPBs are applied to the same SOC, the offset that will be applied will be that of the PPB with the highest number.
- Returns
- None
static void ADC_setPPBReferenceOffset |
( |
uint32_t |
base, |
|
|
ADC_PPBNumber |
ppbNumber, |
|
|
uint16_t |
offset |
|
) |
| |
|
inlinestatic |
Sets the post processing block reference offset.
- Parameters
-
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
offset | is the 12-bit unsigned value subtracted from ADC the output. |
This function sets the PPB reference offset value. This can be used to either calculate the feedback error or convert a unipolar signal to bipolar by subtracting a reference value. The result will be stored in the appropriate PPB result register which can be read using ADC_readPPBResult().
Passing a zero in to the offset parameter will effectively disable the calculation and will pass the ADC result to the PPB result register unchanged.
- Note
- If in 12-bit mode, you may only pass a 12-bit value into the offset parameter.
- Returns
- None
static void ADC_enablePPBEventCBCClear |
( |
uint32_t |
base, |
|
|
uint32_t |
ppbNumber |
|
) |
| |
|
inlinestatic |
Enables cycle-by-cycle clear of ADC PPB event flags.
- Parameters
-
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
This function enables the automatic cycle-by-cycle clear of ADC PPB event flags. When enabled, the desired PPB event flags are automatically cleared on the next PPBxRESULT load, unless a set condition is also occurring at the same time, in which case the set takes precedence.
- Returns
- None.
static void ADC_enableInterrupt |
( |
uint32_t |
base, |
|
|
ADC_IntNumber |
adcIntNum |
|
) |
| |
|
inlinestatic |
Enables an ADC interrupt source.
- Parameters
-
base | is the base address of the ADC module. |
adcIntNum | is interrupt number within the ADC wrapper. |
This function enables the indicated ADC interrupt source. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.
adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be enabled.
- Returns
- None.
static void ADC_disableInterrupt |
( |
uint32_t |
base, |
|
|
ADC_IntNumber |
adcIntNum |
|
) |
| |
|
inlinestatic |
Disables an ADC interrupt source.
- Parameters
-
base | is the base address of the ADC module. |
adcIntNum | is interrupt number within the ADC wrapper. |
This function disables the indicated ADC interrupt source. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.
adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module should be disabled.
- Returns
- None.
Sets the source EOC for an analog-to-digital converter interrupt.
- Parameters
-
base | is the base address of the ADC module. |
adcIntNum | is interrupt number within the ADC wrapper. |
socNumber | is the number of the start-of-conversion. |
This function sets which conversion is the source of an ADC interrupt.
The socNumber number is a value ADC_SOC_NUMBERX where X is a number from 0 to 15 specifying which EOC is to be configured on the ADC module specified by base.
adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module is being configured.
- Returns
- None.
static void ADC_enableContinuousMode |
( |
uint32_t |
base, |
|
|
ADC_IntNumber |
adcIntNum |
|
) |
| |
|
inlinestatic |
Enables continuous mode for an ADC interrupt.
- Parameters
-
base | is the base address of the ADC. |
adcIntNum | is interrupt number within the ADC wrapper. |
This function enables continuous mode for the ADC interrupt passed into adcIntNum. This means that pulses will be generated for the specified ADC interrupt whenever an EOC pulse is generated irrespective of whether or not the flag bit is set.
adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module is being configured.
- Returns
- None.
static void ADC_disableContinuousMode |
( |
uint32_t |
base, |
|
|
ADC_IntNumber |
adcIntNum |
|
) |
| |
|
inlinestatic |
Disables continuous mode for an ADC interrupt.
- Parameters
-
base | is the base address of the ADC. |
adcIntNum | is interrupt number within the ADC wrapper. |
This function disables continuous mode for the ADC interrupt passed into adcIntNum. This means that pulses will not be generated for the specified ADC interrupt until the corresponding interrupt flag for the previous interrupt occurrence has been cleared using ADC_clearInterruptStatus().
adcIntNum can take the value ADC_INT_NUMBER1, ADC_INT_NUMBER2, ADC_INT_NUMBER3, or ADC_INT_NUMBER4 to express which of the four interrupts of the ADC module is being configured.
- Returns
- None.
Configures the analog-to-digital converter resolution and signal mode.
- Parameters
-
base | is the base address of the ADC module. |
resolution | is the resolution of the converter (12 bits). |
signalMode | is the input signal mode of the converter. |
This function configures the ADC module's conversion resolution and input signal mode and ensures that the corresponding trims are loaded.
The resolution parameter specifies the resolution of the conversion. It can be 12-bit specified by ADC_RESOLUTION_12BIT
The signalMode parameter specifies the signal mode. In single-ended mode, which is indicated by ADC_MODE_SINGLE_ENDED, the input voltage is sampled on a single pin referenced to VREFLO. In differential mode, which is indicated by ADC_MODE_DIFFERENTIAL, the input voltage to the converter is sampled on a pair of input pins, a positive and a negative.
- Returns
- None.
void ADC_setPPBTripLimits |
( |
uint32_t |
base, |
|
|
ADC_PPBNumber |
ppbNumber, |
|
|
int32_t |
tripHiLimit, |
|
|
int32_t |
tripLoLimit |
|
) |
| |
Sets the windowed trip limits for a PPB.
- Parameters
-
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
tripHiLimit | is the value is the digital comparator trip high limit. |
tripLoLimit | is the value is the digital comparator trip low limit. |
This function sets the windowed trip limits for a PPB. These values set the digital comparator so that when one of the values is exceeded, either a high or low trip event will occur.
The ppbNumber is a value ADC_PPB_NUMBERX where X is a value from 1 to 4 inclusive that identifies a PPB to be configured.
In 12-bit mode, only bits 12:0 will be compared against bits 12:0 of the PPB result.
- Returns
- None.