This module contains APIs to program and use the ADC module.
Functions | |
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) |
Macros | |
#define | ADC_EVT_TRIPHI (0x0001U) |
Header Files. More... | |
#define | ADC_EVT_TRIPLO (0x0002U) |
Trip Low Event. More... | |
#define | ADC_EVT_ZERO (0x0004U) |
Zero Crossing Event. More... | |
#define | ADC_FORCE_SOC0 (0x0001U) |
SW trigger ADC SOC 0. More... | |
#define | ADC_FORCE_SOC1 (0x0002U) |
SW trigger ADC SOC 1. More... | |
#define | ADC_FORCE_SOC2 (0x0004U) |
SW trigger ADC SOC 2. More... | |
#define | ADC_FORCE_SOC3 (0x0008U) |
SW trigger ADC SOC 3. More... | |
#define | ADC_FORCE_SOC4 (0x0010U) |
SW trigger ADC SOC 4. More... | |
#define | ADC_FORCE_SOC5 (0x0020U) |
SW trigger ADC SOC 5. More... | |
#define | ADC_FORCE_SOC6 (0x0040U) |
SW trigger ADC SOC 6. More... | |
#define | ADC_FORCE_SOC7 (0x0080U) |
SW trigger ADC SOC 7. More... | |
#define | ADC_FORCE_SOC8 (0x0100U) |
SW trigger ADC SOC 8. More... | |
#define | ADC_FORCE_SOC9 (0x0200U) |
SW trigger ADC SOC 9. More... | |
#define | ADC_FORCE_SOC10 (0x0400U) |
SW trigger ADC SOC 10. More... | |
#define | ADC_FORCE_SOC11 (0x0800U) |
SW trigger ADC SOC 11. More... | |
#define | ADC_FORCE_SOC12 (0x1000U) |
SW trigger ADC SOC 12. More... | |
#define | ADC_FORCE_SOC13 (0x2000U) |
SW trigger ADC SOC 13. More... | |
#define | ADC_FORCE_SOC14 (0x4000U) |
SW trigger ADC SOC 14. More... | |
#define | ADC_FORCE_SOC15 (0x8000U) |
SW trigger ADC SOC 15. More... | |
#define | ADC_ADCSOCxCTL_STEP (CSL_ADC_ADCSOC1CTL - CSL_ADC_ADCSOC0CTL) |
Defines used by the driver. More... | |
#define | ADC_ADCINTSELxNy_STEP (CSL_ADC_ADCINTSEL3N4 - CSL_ADC_ADCINTSEL1N2) |
Register offset difference between 2 ADCINTSELxNy registers. More... | |
#define | ADC_ADCPPBx_STEP (CSL_ADC_ADCPPB2CONFIG - CSL_ADC_ADCPPB1CONFIG) |
Register offset difference between 2 ADCPPBxCONFIG registers. More... | |
#define | ADC_ADCPPBTRIP_MASK |
ADC PPB Trip Mask. More... | |
#define | ADC_RESULT_ADCPPBxRESULT_STEP |
Register offset difference between 2 ADCPPBxRESULT registers. More... | |
#define | ADC_RESULT_ADCRESULTx_STEP |
Register offset difference between 2 ADCRESULTx registers. More... | |
#define ADC_EVT_TRIPHI (0x0001U) |
Header Files.
Trip High Event
#define ADC_EVT_TRIPLO (0x0002U) |
Trip Low Event.
#define ADC_EVT_ZERO (0x0004U) |
Zero Crossing Event.
#define ADC_FORCE_SOC0 (0x0001U) |
SW trigger ADC SOC 0.
#define ADC_FORCE_SOC1 (0x0002U) |
SW trigger ADC SOC 1.
#define ADC_FORCE_SOC2 (0x0004U) |
SW trigger ADC SOC 2.
#define ADC_FORCE_SOC3 (0x0008U) |
SW trigger ADC SOC 3.
#define ADC_FORCE_SOC4 (0x0010U) |
SW trigger ADC SOC 4.
#define ADC_FORCE_SOC5 (0x0020U) |
SW trigger ADC SOC 5.
#define ADC_FORCE_SOC6 (0x0040U) |
SW trigger ADC SOC 6.
#define ADC_FORCE_SOC7 (0x0080U) |
SW trigger ADC SOC 7.
#define ADC_FORCE_SOC8 (0x0100U) |
SW trigger ADC SOC 8.
#define ADC_FORCE_SOC9 (0x0200U) |
SW trigger ADC SOC 9.
#define ADC_FORCE_SOC10 (0x0400U) |
SW trigger ADC SOC 10.
#define ADC_FORCE_SOC11 (0x0800U) |
SW trigger ADC SOC 11.
#define ADC_FORCE_SOC12 (0x1000U) |
SW trigger ADC SOC 12.
#define ADC_FORCE_SOC13 (0x2000U) |
SW trigger ADC SOC 13.
#define ADC_FORCE_SOC14 (0x4000U) |
SW trigger ADC SOC 14.
#define ADC_FORCE_SOC15 (0x8000U) |
SW trigger ADC SOC 15.
#define ADC_ADCSOCxCTL_STEP (CSL_ADC_ADCSOC1CTL - CSL_ADC_ADCSOC0CTL) |
Defines used by the driver.
Register offset difference between 2 ADCSOCxCTL registers
#define ADC_ADCINTSELxNy_STEP (CSL_ADC_ADCINTSEL3N4 - CSL_ADC_ADCINTSEL1N2) |
Register offset difference between 2 ADCINTSELxNy registers.
#define ADC_ADCPPBx_STEP (CSL_ADC_ADCPPB2CONFIG - CSL_ADC_ADCPPB1CONFIG) |
Register offset difference between 2 ADCPPBxCONFIG registers.
#define ADC_ADCPPBTRIP_MASK |
ADC PPB Trip Mask.
#define ADC_RESULT_ADCPPBxRESULT_STEP |
Register offset difference between 2 ADCPPBxRESULT registers.
#define ADC_RESULT_ADCRESULTx_STEP |
Register offset difference between 2 ADCRESULTx registers.
enum ADC_ClkPrescale |
Values that can be passed to ADC_setPrescaler() as the clkPrescale parameter.
enum ADC_Resolution |
Values that can be passed to ADC_setMode() as the resolution parameter.
Enumerator | |
---|---|
ADC_RESOLUTION_12BIT | 12-bit conversion resolution |
enum ADC_SignalMode |
Values that can be passed to ADC_setMode() as the signalMode parameter.
Enumerator | |
---|---|
ADC_MODE_SINGLE_ENDED | Sample on single pin with VREFLO. |
ADC_MODE_DIFFERENTIAL | Sample on pair of pins. |
enum ADC_Trigger |
Values that can be passed to ADC_setupSOC() as the trigger parameter to specify the event that will trigger a conversion to start. It is also used with ADC_setBurstModeConfig().
enum ADC_Channel |
Values that can be passed to ADC_setupSOC() as the channel parameter. This is the input pin on which the signal to be converted is located.
enum ADC_PulseMode |
Values that can be passed to ADC_setInterruptPulseMode() as the pulseMode parameter.
Enumerator | |
---|---|
ADC_PULSE_END_OF_ACQ_WIN | Occurs at the end of the acquisition window. |
ADC_PULSE_END_OF_CONV | Occurs at the end of the conversion. |
enum ADC_IntNumber |
Values that can be passed to ADC_enableInterrupt(), ADC_disableInterrupt(), ADC_clearInterruptStatus(), ADC_getInterruptOverflowStatus(), ADC_clearInterruptOverflowStatus(), ADC_setInterruptSource(), ADC_enableContinuousMode(), ADC_disableContinuousMode() and ADC_getInterruptStatus() as the adcIntNum parameter.
Enumerator | |
---|---|
ADC_INT_NUMBER1 | ADCINT1 Interrupt. |
ADC_INT_NUMBER2 | ADCINT2 Interrupt. |
ADC_INT_NUMBER3 | ADCINT3 Interrupt. |
ADC_INT_NUMBER4 | ADCINT4 Interrupt. |
enum ADC_PPBNumber |
enum ADC_SOCNumber |
Values that can be passed in as the socNumber parameter for several functions. This value identifies the start-of-conversion (SOC) that a function is configuring or accessing. Note that in some cases (for example, ADC_setInterruptSource()) socNumber is used to refer to the corresponding end-of-conversion (EOC).
enum ADC_IntSOCTrigger |
Values that can be passed in as the trigger parameter for the ADC_setInterruptSOCTrigger() function.
Enumerator | |
---|---|
ADC_INT_SOC_TRIGGER_NONE | No ADCINT will trigger the SOC. |
ADC_INT_SOC_TRIGGER_ADCINT1 | ADCINT1 will trigger the SOC. |
ADC_INT_SOC_TRIGGER_ADCINT2 | ADCINT2 will trigger the SOC. |
enum ADC_PriorityMode |
Values that can be passed to ADC_setSOCPriority() as the priMode parameter.
|
inlinestatic |
Configures the analog-to-digital converter module prescaler.
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.
|
inlinestatic |
Configures a start-of-conversion (SOC) in the ADC.
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.
|
inlinestatic |
Configures the interrupt SOC trigger of an SOC.
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.
This functionality is useful for creating continuous conversions.
|
inlinestatic |
Sets the timing of the end-of-conversion pulse
base | is the base address of the ADC module. |
pulseMode | is the generation mode of the EOC pulse. |
This function configures the end-of-conversion (EOC) pulse generated by ADC. This pulse will be generated either at the end of the acquisition window plus a number of SYSCLK cycles configured by ADC_setInterruptCycleOffset() (pass ADC_PULSE_END_OF_ACQ_WIN into pulseMode) or at the end of the voltage conversion, one cycle prior to the ADC result latching into it's result register (pass ADC_PULSE_END_OF_CONV into pulseMode).
|
inlinestatic |
Sets the timing of early interrupt generation.
base | is the base address of the ADC module. |
cycleOffset | is the cycles from an SOC falling edge to an early interrupt pulse. |
This function configures cycle offset between the negative edge of a sample pulse and an early interrupt pulse being generated. This number of cycles is specified with the cycleOffset parameter.
This function only applies when early interrupt generation is enabled. That means the ADC_setInterruptPulseMode() function pulseMode parameter is configured as ADC_PULSE_END_OF_ACQ_WIN.
|
inlinestatic |
Powers up the analog-to-digital converter core.
base | is the base address of the ADC module. |
This function powers up the analog circuitry inside the analog core.
|
inlinestatic |
Powers down the analog-to-digital converter module.
base | is the base address of the ADC module. |
This function powers down the analog circuitry inside the analog core.
|
inlinestatic |
Forces a SOC flag to a 1 in the analog-to-digital converter.
base | is the base address of the ADC module. |
socNumber | is the number of the start-of-conversion. |
This function forces the SOC flag associated with the SOC specified by socNumber. This initiates a conversion once that SOC is given priority. This software trigger can be used whether or not the SOC has been configured to accept some other specific trigger.
|
inlinestatic |
Forces multiple SOC flags to 1 in the analog-to-digital converter.
base | is the base address of the ADC module. |
socMask | is the SOCs to be forced through software |
This function forces the SOCFRC1 flags associated with the SOCs specified by socMask. This initiates a conversion once the desired SOCs are given priority. This software trigger can be used whether or not the SOC has been configured to accept some other specific trigger. Valid values for socMask parameter can be any of the individual ADC_FORCE_SOCx values or any of their OR'd combination to trigger multiple SOCs.
|
inlinestatic |
Gets the current ADC interrupt status.
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.
|
inlinestatic |
Clears ADC interrupt sources.
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.
|
inlinestatic |
Gets the current ADC interrupt overflow status.
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.
|
inlinestatic |
Clears ADC interrupt overflow sources.
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.
|
inlinestatic |
Reads the conversion result.
resultBase | is the base address of the ADC results. |
socNumber | is the number of the start-of-conversion. |
This function returns the conversion result that corresponds to the base address passed into resultBase and the SOC passed into socNumber.
The socNumber number is a value ADC_SOC_NUMBERX where X is a number from 0 to 15 specifying which SOC's result is to be read.
|
inlinestatic |
Determines whether the ADC is busy or not.
base | is the base address of the ADC. |
This function allows the caller to determine whether or not the ADC is busy and can sample another channel.
|
inlinestatic |
Set SOC burst mode.
base | is the base address of the ADC. |
trigger | the source that will cause the burst conversion sequence. |
burstSize | is the number of SOCs converted during a burst sequence. |
This function configures the burst trigger and burstSize of an ADC module. Burst mode allows a single trigger to walk through the round-robin SOCs one or more at a time. When burst mode is enabled, the trigger selected by the ADC_setupSOC() API will no longer have an effect on the SOCs in round-robin mode. Instead, the source specified through the trigger parameter will cause a burst of burstSize conversions to occur.
The trigger parameter takes the same values as the ADC_setupSOC() API The burstSize parameter should be a value between 1 and 16 inclusive.
|
inlinestatic |
Enables SOC burst mode.
base | is the base address of the ADC. |
This function enables SOC burst mode operation of the ADC. Burst mode allows a single trigger to walk through the round-robin SOCs one or more at a time. When burst mode is enabled, the trigger selected by the ADC_setupSOC() API will no longer have an effect on the SOCs in round-robin mode. Use ADC_setBurstMode() to configure the burst trigger and size.
|
inlinestatic |
Disables SOC burst mode.
base | is the base address of the ADC. |
This function disables SOC burst mode operation of the ADC. SOCs in round-robin mode will be triggered by the trigger configured using the ADC_setupSOC() API.
|
inlinestatic |
Sets the priority mode of the SOCs.
base | is the base address of the ADC. |
priMode | is the priority mode of the SOCs. |
This function sets the priority mode of the SOCs. There are three main modes that can be passed in the priMode parameter
|
inlinestatic |
Configures a post-processing block (PPB) in the ADC.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
socNumber | is the number of the start-of-conversion. |
This function associates a post-processing block with a SOC.
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. 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.
|
inlinestatic |
Enables individual ADC PPB event sources.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
evtFlags | is a bit mask of the event sources to be enabled. |
This function enables the indicated ADC PPB event sources. This will allow the specified events to propagate through the X-BAR to a pin or to an ePWM module.
|
inlinestatic |
Disables individual ADC PPB event sources.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
evtFlags | is a bit mask of the event sources to be enabled. |
This function disables the indicated ADC PPB event sources. This will stop the specified events from propagating through the X-BAR to other modules.
|
inlinestatic |
Enables individual ADC PPB event interrupt sources.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
intFlags | is a bit mask of the interrupt sources to be enabled. |
This function enables the indicated ADC PPB interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.
|
inlinestatic |
Disables individual ADC PPB event interrupt sources.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
intFlags | is a bit mask of the interrupt source to be disabled. |
This function disables the indicated ADC PPB interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.
|
inlinestatic |
Gets the current ADC event status.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
This function returns the event status for the analog-to-digital converter.
|
inlinestatic |
Clears ADC event flags.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
evtFlags | is a bit mask of the event source to be cleared. |
This function clears the indicated ADC PPB event flags. After an event occurs this function must be called to allow additional events to be produced.
|
inlinestatic |
Reads the processed conversion result from the PPB.
resultBase | is the base address of the ADC results. |
ppbNumber | is the number of the post-processing block. |
This function returns the processed conversion result that corresponds to the base address passed into resultBase and the PPB passed into ppbNumber.
|
inlinestatic |
Reads sample delay time stamp from a PPB.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
This function returns the sample delay time stamp. This delay is the number of system clock cycles between the SOC being triggered and when it began converting.
|
inlinestatic |
Sets the post processing block offset correction.
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.
|
inlinestatic |
Sets the post processing block reference offset.
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.
|
inlinestatic |
Enables two's complement capability in the PPB.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
This function enables two's complement in the post-processing block specified by the ppbNumber parameter. When enabled, a two's complement will be performed on the output of the offset subtraction before it is stored in the appropriate PPB result register. In other words, the PPB result will be the reference offset value minus the the ADC result value (ADCPPBxRESULT = ADCSOCxOFFREF - ADCRESULTx).
|
inlinestatic |
Disables two's complement capability in the PPB.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
This function disables two's complement in the post-processing block specified by the ppbNumber parameter. When disabled, a two's complement will NOT be performed on the output of the offset subtraction before it is stored in the appropriate PPB result register. In other words, the PPB result will be the ADC result value minus the reference offset value (ADCPPBxRESULT = ADCRESULTx - ADCSOCxOFFREF).
|
inlinestatic |
Enables cycle-by-cycle clear of ADC PPB event flags.
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.
|
inlinestatic |
Disables cycle-by-cycle clear of ADC PPB event flags.
base | is the base address of the ADC module. |
ppbNumber | is the number of the post-processing block. |
This function disables the cycle-by-cycle clear of ADC PPB event flags. When disabled, the desired PPB event flags are to be cleared explicitly in software inorder to generate next set of interrupts/events.
|
inlinestatic |
Enables an ADC interrupt source.
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.
|
inlinestatic |
Disables an ADC interrupt source.
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.
|
inlinestatic |
Sets the source EOC for an analog-to-digital converter interrupt.
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.
|
inlinestatic |
Enables continuous mode for an ADC interrupt.
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.
|
inlinestatic |
Disables continuous mode for an ADC interrupt.
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.
void ADC_setMode | ( | uint32_t | base, |
ADC_Resolution | resolution, | ||
ADC_SignalMode | signalMode | ||
) |
Configures the analog-to-digital converter resolution and signal mode.
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.
void ADC_setPPBTripLimits | ( | uint32_t | base, |
ADC_PPBNumber | ppbNumber, | ||
int32_t | tripHiLimit, | ||
int32_t | tripLoLimit | ||
) |
Sets the windowed trip limits for a PPB.
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.