3.1.2.1 10-bit ADCC

10-bit ADC with Computation

3.1.2.1.1 Introduction

This Analog-to-Digital Converter with Computation (ADCC) module converts an analog voltage value into a 10-bit numerical value and offers different computational actions that can be performed on the result such as averaging or low-pass filtering.

3.1.2.1.2 Supported Device Families

PIC18F-Q10 PIC16F188xx

3.1.2.1.3 Required header files:


#include "mcc_generated_files/adc/adcc.h"

3.1.2.1.4 Module Documentation

Analog-to-Digital Converter (ADC)

This file contains the API prototypes and data types for the ADC driver.

Module description

This file contains the API prototypes and data types for the ADC driver.

This header file provides type definitions for the ADC module.

Version: ADC Driver Version 3.0.0 ADC Package Version 5.0.0
Enumerations
Functions

Definition Documentation

ADC_BIT_CLEAR

#define ADC_BIT_CLEAR 0U

ADC bit clear value.

ADC_BIT_SET

#define ADC_BIT_SET 1U

ADC bit set value.

ADC_RESOLUTION

#define ADC_RESOLUTION 10U

ADC resolution value.

IO_RA1

#define IO_RA1 ADC_CHANNEL_ANA1

Defines the Custom Name pin mapping for channels in adc_channel_t.

Typedef Documentation

adc_accumulate_t

adc_accumulate_t

ADC conversion accumulator type.

adc_repeat_count_t

adc_repeat_count_t

ADC conversion repeat count type.

adc_result_t

adc_result_t

ADC conversion result type.

adc_threshold_t

adc_threshold_t

ADC conversion threshold type.

Function Documentation

ADC_AccumulatedResultGet()

adc_accumulate_t ADC_AccumulatedResultGet (void )

Retrieves the value of accumulated conversions.

Parameters:
None.
Returns:

@adc_accumulate_t - The value of accumulated conversions

ADC_AccumulatorClear()

void ADC_AccumulatorClear (void )

Clears the accumulator.

Parameters:
None.
Returns:

None.

ADC_AcquisitionTimeSet()

void ADC_AcquisitionTimeSet (uint8_t acquisitionValue)

Sets the specified value for the ADC Acquisition Time Control (ADACQ) register.

Parameters:
acquisitionValue

Value to be loaded in the ADACQ register

Returns:

None.

ADC_AutoTriggerSourceSet()

void ADC_AutoTriggerSourceSet (adc_trigger_source_t triggerSource)

Sets the auto-conversion trigger source.

Parameters:
triggerSource

Desired auto-trigger source. Refer to the adc_trigger_source_t for the list of available trigger sources.

Returns:

None.

ADC_BusyStatusSet()

void ADC_BusyStatusSet (bool status)

Sets the busy status of the ADC module.

Parameters:
status

True to set the ADC status to busy, false to set it to not busy.

Returns:

None.

ADC_CalculationRightShiftSet()

void ADC_CalculationRightShiftSet (uint8_t rightShiftValue)

Sets the ADC Accumulated Calculation Right Shift Select (CRS) bits.

Parameters:
rightShiftValue

Right shift value

Returns:

None.

ADC_ChannelSelect()

void ADC_ChannelSelect (adc_channel_t channel)

Sets the channel to use for the ADC conversion.

Parameters:
channel

- Desired analog channel. Refer to the adc_channel_t enum for the list of available analog channels.

Returns:

None.

ADC_ChannelSelectAndConvert()

adc_result_t ADC_ChannelSelectAndConvert (adc_channel_t channel)

Starts the conversion and retrieves the result of the single conversion on the selected channel.

Parameters:
channel

- Desired analog channel. Refer to the adc_channel_t enum for the list of available analog channels.

Returns:

adc_result_t - The result of the conversion

ADC_ComputationModeSet()

void ADC_ComputationModeSet (adc_computation_mode_t computationMode)

Sets the Computation mode.

Parameters:
computationMode

- Desired computation mode. Refer to the adc_computation_mode_t enum for the list of available computation modes.

Returns:

None.

ADC_ContinuousConversionDisable()

void ADC_ContinuousConversionDisable (void )

Sets the Continuous Operation Enable (CONT) bit to 0.

Parameters:
None.
Returns:

None.

ADC_ContinuousConversionEnable()

void ADC_ContinuousConversionEnable (void )

Sets the Continuous Operation Enable (CONT) bit to 1.

Parameters:
None.
Returns:

None.

ADC_ConversionDoneCallbackRegister()

void ADC_ConversionDoneCallbackRegister (void(*)(void) callback)

Sets the callback function for the ADC Conversion Done Interrupt (ADI).

Parameters:
*callback

The pointer to the function to be executed

Returns:

None.

ADC_ConversionDoneInterruptDisable()

void ADC_ConversionDoneInterruptDisable (void )

Sets the ADC Interrupt Enable (ADIE) bit to 0.

Parameters:
None.
Returns:

None.

ADC_ConversionDoneInterruptEnable()

void ADC_ConversionDoneInterruptEnable (void )

Sets the ADC Interrupt Enable (ADIE) bit to 1.

Parameters:
None.
Returns:

None.

ADC_ConversionDoneInterruptFlagClear()

void ADC_ConversionDoneInterruptFlagClear (void )

Clears the ADC Conversion Done Interrupt Flag (ADIF).

Parameters:
None.
Returns:

None.

ADC_ConversionResultGet()

adc_result_t ADC_ConversionResultGet (void )

Retrieves the result of the latest conversion.

Parameters:
None.
Returns:

adc_result_t - The result of the conversion

ADC_ConversionStageStatusGet()

adc_conversion_stage_t ADC_ConversionStageStatusGet (void )

Retrieves the conversion stage status.

Parameters:
None.
Returns:

adc_conversion_stage_t - Status of conversion stages

ADC_ConversionStart()

void ADC_ConversionStart (void )

Starts the ADC conversion on a selected channel.

Precondition:

Select the channel using ADC_ChannelSelect and call ADC_Initialize(void) to initialize the ADC module before using this API.

Parameters:
None.
Returns:

None.

ADC_ConversionStop()

void ADC_ConversionStop (void )

Stops the ongoing ADC conversion.

Parameters:
None.
Returns:

None.

ADC_CurrentConversionCountGet()

adc_repeat_count_t ADC_CurrentConversionCountGet (void )

Retrieves the current value of the ADC Repeat Counter (ADCNT) register.

Parameters:
None.
Returns:

adc_repeat_count_t - Current value of the ADCNT register

ADC_Deinitialize()

void ADC_Deinitialize (void )

Deinitializes the registers to power-on Reset values.

Parameters:
None.
Returns:

None.

ADC_Disable()

void ADC_Disable (void )

Sets the ADC Enable (ADON) bit to 0.

Parameters:
None.
Returns:

None.

ADC_DoubleSamplingDisable()

void ADC_DoubleSamplingDisable (void )

Sets the Double-Sample Enable (DSEN) bit to 0.

Parameters:
None.
Returns:

None.

ADC_DoubleSamplingEnable()

void ADC_DoubleSamplingEnable (void )

Sets the Double-Sample Enable (DSEN) bit to 1.

Parameters:
None.
Returns:

None.

ADC_Enable()

void ADC_Enable (void )

Sets the ADC Enable (ADON) bit to 1.

Parameters:
None.
Returns:

None.

ADC_ErrorCalculationGet()

adc_result_t ADC_ErrorCalculationGet (void )

Retrieves the value of the ADC Setpoint Error (ADERR) register.

Parameters:
None.
Returns:

adc_result_t - Value obtained from the ADERR register

ADC_ErrorCalculationModeSet()

void ADC_ErrorCalculationModeSet (adc_calculation_mode_t errorCalculationMode)

Sets the ADC Error Calculation Mode Select (CALC) bits.

Parameters:
errorCalculationMode

Desired errorCalculationMode value. Refer to the adc_calculation_mode_t for the error calculation mode options.

Returns:

None.

ADC_FilterValueGet()

adc_result_t ADC_FilterValueGet (void )

Retrieves the value of the ADC Filter (ADFLTR) register.

Parameters:
None.
Returns:

adc_result_t - Value obtained after ADACC is right shifted by the CRS bits. In LPF mode, this is the output of the Low-Pass Filter.

ADC_HasAccumulatorOverflowed()

bool ADC_HasAccumulatorOverflowed (void )

Determines whether the accumulator has overflowed.

Parameters:
None.
Return values:
True

ADC accumulator has overflowed

False

ADC accumulator has not overflowed

ADC_Initialize()

void ADC_Initialize (void )

Initializes the registers based on configurable options in the MPLAB® Code Configurator (MCC) Melody UI for the Analog-to-Digital Converter (ADC) operation.

Parameters:
None.
Returns:

None.

ADC_IsAccumulatorClearComplete()

bool ADC_IsAccumulatorClearComplete (void )

Status of the accumulator clear operation.

Parameters:
None.
Return values:
True

ADC accumulator clear operation complete

False

ADC accumulator clear operation not complete

ADC_IsBusy()

bool ADC_IsBusy (void )

Returns the busy status of the ADC module.

Parameters:
None.
Return values:
True

The ADC is in use

False

The ADC is not in use

ADC_IsConversionDone()

bool ADC_IsConversionDone (void )

Checks if ongoing ADC conversion is complete.

Parameters:
None.
Return values:
True

- Conversion is complete.

False

- Conversion is ongoing.

ADC_IsConversionDoneInterruptFlagSet()

bool ADC_IsConversionDoneInterruptFlagSet (void )

Checks the ADC Conversion Done Interrupt Flag (ADIF) status.

Parameters:
None.
Return values:
True

ADI flag is set

False

ADI flag is not set

ADC_IsErrorGreaterThanUpperThreshold()

bool ADC_IsErrorGreaterThanUpperThreshold (void )

Determines if the value in the ADERR register is greater than the upper threshold.

Parameters:
None.
Return values:
True

ADC error is greater than the upper threshold

False

ADC error is not greater than the upper threshold

ADC_IsErrorLesserThanLowerThreshold()

bool ADC_IsErrorLesserThanLowerThreshold (void )

Determines if the value in the ADERR register is less than the lower threshold.

Parameters:
None.
Return values:
True

ADC error is less than the lower threshold

False

ADC error is not less than the lower threshold

ADC_ISR()

void ADC_ISR (void )

Implements the ADC Conversion Done Interrupt (ADI) service routine for the interrupt-driven implementations.

Parameters:
None.
Returns:

None.

ADC_IsThresholdInterruptFlagSet()

bool ADC_IsThresholdInterruptFlagSet (void )

Checks the ADC Threshold Interrupt Flag (ADTIF) status.

Parameters:
None.
Return values:
True

ADTI flag is set

False

ADTI flag is not set

ADC_LowerThresholdSet()

void ADC_LowerThresholdSet (adc_threshold_t lowerThreshold)

Sets the value of the ADC Lower Threshold (ADLTH) register.

Parameters:
lowerThreshold

Lower threshold value of the adc_threshold_t type for the ADLTH register

Returns:

None.

ADC_PrechargeTimeSet()

void ADC_PrechargeTimeSet (uint8_t prechargeTime)

Sets the specified value for the ADC Precharge Time Control (ADPRE) register.

Parameters:
prechargeTime

Value to be loaded in the ADPRE register

Returns:

None.

ADC_PreviousResultGet()

adc_result_t ADC_PreviousResultGet (void )

Retrieves the value of the ADC Previous Result (ADPREV) register.

Parameters:
None.
Returns:

adc_result_t - Value obtained from the ADPREV register

ADC_ResolutionGet()

uint8_t ADC_ResolutionGet (void )

Returns the resolution of the ADC module.

Parameters:
None.
Returns:

uint8_t Resolution value

ADC_SampleCapacitorDischarge()

void ADC_SampleCapacitorDischarge (void )

Discharges the input sample capacitor by setting the channel to AVss.

Parameters:
None.
Returns:

None.

ADC_SampleRepeatCountSet()

void ADC_SampleRepeatCountSet (adc_repeat_count_t repeatCount)

Loads the repeat counter with the specified value.

Parameters:
repeatCount

Repeat count value. Refer to the adc_repeat_count_t type.

Returns:

None.

ADC_SetPointDefine()

void ADC_SetPointDefine (adc_threshold_t setPoint)

Sets the value of the ADC Threshold Setpoint (ADSTPT) register.

Parameters:
setPoint

Value for the ADSTPT register of the adc_threshold_t type

Returns:

None.

ADC_StopOnInterruptDisable()

void ADC_StopOnInterruptDisable (void )

Sets the Stop-on-Interrupt (SOI) bit to 0.

Parameters:
None.
Returns:

None.

ADC_StopOnInterruptEnable()

void ADC_StopOnInterruptEnable (void )

Sets the Stop-on-Interrupt (SOI) bit to 1.

Precondition:

Call ADC_ContinuousConversionEnable API before using this API.

Parameters:
None.
Returns:

None.

ADC_Tasks()

void ADC_Tasks (void )

Implements the Tasks routine for the polling implementations.

Parameters:
None.
Returns:

None.

ADC_ThresholdCallbackRegister()

void ADC_ThresholdCallbackRegister (void(*)(void) callback)

Sets the callback function for the ADC Threshold Interrupt (ADTI).

Parameters:
*callback

The pointer to the function to be executed

Returns:

None.

ADC_ThresholdInterruptDisable()

void ADC_ThresholdInterruptDisable (void )

Sets the ADC Threshold Interrupt Enable (ADTI) bit to 0.

Parameters:
None.
Returns:

None.

ADC_ThresholdInterruptEnable()

void ADC_ThresholdInterruptEnable (void )

Sets the ADC Threshold Interrupt Enable (ADTI) bit to 1.

Parameters:
None.
Returns:

None.

ADC_ThresholdInterruptFlagClear()

void ADC_ThresholdInterruptFlagClear (void )

Clears the ADC Threshold Interrupt Flag (ADTIF).

Parameters:
None.
Returns:

None.

ADC_ThresholdISR()

void ADC_ThresholdISR (void )

Implements the ADC Threshold Interrupt (ADTI) service routine for the interrupt-driven implementations.

Parameters:
None.
Returns:

None.

ADC_ThresholdModeSet()

void ADC_ThresholdModeSet (adc_threshold_mode_t thresholdMode)

Sets the Conversion Threshold mode.

Parameters:
thresholdMode

Desired threshold mode. Refer to the adc_threshold_mode_t enum for the list of available threshold modes.

Returns:

None.

ADC_UpperThresholdSet()

void ADC_UpperThresholdSet (adc_threshold_t upperThreshold)

Sets the value of the ADC Upper Threshold (ADUTH) register.

Parameters:
upperThreshold

Upper threshold value of the adc_threshold_t type for the ADUTH register

Returns:

None.

Enumeration Type Documentation

adc_calculation_mode_t

enum adc_calculation_mode_t

Enumeration for the ADC error calculation modes.

ADC_FIRST_DERIVATIVE_OF_SINGLE_MEASUREMENT

First derivative of single measurement

ADC_ACTUAL_RESULT_VS_SETPOINT

Actual result vs setpoint

ADC_ACTUAL_RESULT_VS_FILTERED_VALUE

Actual result vs filtered value

ADC_PREVIOUS_RESULT_VALUE_ABOVE_OR_BELOW_SETPOINT

Previous result value above or below setpoint

ADC_FIRST_DERIVATIVE_OF_FILTERED_VALUE

First derivative of filtered value

ADC_FILTERED_VALUE_VS_SETPOINT

Filtered value vs setpoint

ADC_ACTUAL_RESULT_VS_THRESHOLD_VALUE

Actual result vs threshold value

ADC_FILTERED_VALUE_VS_THRESHOLD_VALUE

Filtered value vs threshold value

ADC_FIRST_DERIVATIVE_OF_SINGLE_MEASUREMENT

First derivative of single measurement

ADC_ACTUAL_RESULT_VS_SETPOINT

Actual result vs setpoint

ADC_ACTUAL_RESULT_VS_FILTERED_VALUE

Actual result vs filtered value

ADC_PREVIOUS_RESULT_VALUE_ABOVE_OR_BELOW_SETPOINT

Previous result value above or below setpoint

ADC_FIRST_DERIVATIVE_OF_FILTERED_VALUE

First derivative of filtered value

ADC_FILTERED_VALUE_VS_SETPOINT

Filtered value vs setpoint

ADC_ACTUAL_RESULT_VS_THRESHOLD_VALUE

Actual result vs threshold value

ADC_FILTERED_VALUE_VS_THRESHOLD_VALUE

Filtered value vs threshold value

adc_channel_t

enum adc_channel_t

Enumeration defining all available channels for ADC conversion.

ADC_CHANNEL_VSS

VSS

ADC_CHANNEL_TEMP

Temp

ADC_CHANNEL_DAC1

DAC1

ADC_CHANNEL_FVR_BUF1

FVR_buf1

ADC_CHANNEL_ANA1

IO_RA1: RA1

adc_computation_mode_t

enum adc_computation_mode_t

Enumeration for the ADC computation modes.

ADC_BASIC

Basic mode

ADC_SERIES_ACCUMULATE

Series Accumulate mode

ADC_SERIES_AVERAGE

Series Average mode

ADC_BURST_AVERAGE

Burst Average mode

ADC_LOW_PASS_FILTER

Low-Pass Filter mode

adc_conversion_stage_t

enum adc_conversion_stage_t

Enumeration for the ADC conversion stage statuses.

ADC_NOT_CONVERTING

Not converting

ADC_1ST_PRECHARGE

1st precharge

ADC_1ST_ACQUISITION

1st acquisition

ADC_1ST_CONVERSION

1st conversion

ADC_SUSPENDED_BETWEEN_1ST_AND_2ND_SAMPLE

Suspended between 1st and 2nd sample

ADC_2ND_PRECHARGE

2nd precharge

ADC_2ND_ACQUISITION

2nd acquisition

ADC_2ND_CONVERSION

2nd conversion

adc_threshold_mode_t

enum adc_threshold_mode_t

Enumeration for the ADC threshold modes.

ADC_NEVER_INTERRUPT

Disabled

ADC_BELOW_LOWER_THRESHOLD

ADERR < ADLTH

ADC_ABOVE_LOWER_THRESHOLD

ADERR >= ADLTH

ADC_INSIDE_LOWER_AND_UPPER_THRESHOLD

ADERR > ADLTH and ADERR < ADUTH

ADC_OUTSIDE_LOWER_AND_UPPER_THRESHOLD

ADERR < ADLTH or ADERR > ADUTH

ADC_BELOW_UPPER_THRESHOLD

ADERR <= ADUTH

ADC_ABOVE_UPPER_THRESHOLD

ADERR > ADUTH

ADC_ALWAYS_INTERRUPT

Enabled

adc_trigger_source_t

enum adc_trigger_source_t

Enumeration for the ADC auto-trigger sources.

ADC_TRIGGER_SOURCE_DISABLED

Disabled

ADC_TRIGGER_SOURCE_ADACTPPS

ADACTPPS

ADC_TRIGGER_SOURCE_TMR0

TMR0

ADC_TRIGGER_SOURCE_TMR1

TMR1

ADC_TRIGGER_SOURCE_TMR2

TMR2

ADC_TRIGGER_SOURCE_TMR3

TMR3

ADC_TRIGGER_SOURCE_TMR4

TMR4

ADC_TRIGGER_SOURCE_TMR5

TMR5

ADC_TRIGGER_SOURCE_TMR6

TMR6

ADC_TRIGGER_SOURCE_CCP1

CCP1

ADC_TRIGGER_SOURCE_CCP2

CCP2

ADC_TRIGGER_SOURCE_PWM3

PWM3

ADC_TRIGGER_SOURCE_PWM4

PWM4

ADC_TRIGGER_SOURCE_C1OUT

C1OUT

ADC_TRIGGER_SOURCE_C2OUT

C2OUT

ADC_TRIGGER_SOURCE_IOC

IOC

ADC_TRIGGER_SOURCE_CLC1

CLC1

ADC_TRIGGER_SOURCE_CLC2

CLC2

ADC_TRIGGER_SOURCE_CLC3

CLC3

ADC_TRIGGER_SOURCE_CLC4

CLC4

ADC_TRIGGER_SOURCE_CLC5

CLC5

ADC_TRIGGER_SOURCE_CLC6

CLC6

ADC_TRIGGER_SOURCE_CLC7

CLC7

ADC_TRIGGER_SOURCE_CLC8

CLC8

ADC_TRIGGER_SOURCE_ADERR

ADERR

ADC_TRIGGER_SOURCE_ADRESH

ADRESH

ADC_TRIGGER_SOURCE_ADPCH

ADPCH

3.1.2.1.5 File Documentation

source/Single-Ended_Interrupts/adc.h File Reference

#include <stdint.h>
#include <stdbool.h>
#include "./adc_types.h"

Functions

Detailed Description

ADC Generated Driver API Header File

source/Single-Ended_Tasks/adc.h File Reference

#include <stdint.h>
#include <stdbool.h>
#include "./adc_types.h"

Functions

Detailed Description

ADC Generated Driver API Header File

source/Single-Ended_Interrupts/adc_types.h File Reference

Enumerations

Detailed Description

ADC Type Definitions Header File

source/Single-Ended_Tasks/adc_types.h File Reference

Enumerations

Detailed Description

ADC Type Definitions Header File

Typedef Documentation

adc_accumulate_t

typedef uint16_t adc_accumulate_t

adc_repeat_count_t

typedef uint8_t adc_repeat_count_t

adc_result_t

typedef int16_t adc_result_t

adc_threshold_t

typedef int16_t adc_threshold_t

Enumeration Type Documentation

adc_calculation_mode_t

enum adc_calculation_mode_t

ADC_FIRST_DERIVATIVE_OF_SINGLE_MEASUREMENT

First derivative of single measurement

ADC_ACTUAL_RESULT_VS_SETPOINT

Actual result vs setpoint

ADC_ACTUAL_RESULT_VS_FILTERED_VALUE

Actual result vs filtered value

ADC_PREVIOUS_RESULT_VALUE_ABOVE_OR_BELOW_SETPOINT

Previous result value above or below setpoint

ADC_FIRST_DERIVATIVE_OF_FILTERED_VALUE

First derivative of filtered value

ADC_FILTERED_VALUE_VS_SETPOINT

Filtered value vs setpoint

ADC_ACTUAL_RESULT_VS_THRESHOLD_VALUE

Actual result vs threshold value

ADC_FILTERED_VALUE_VS_THRESHOLD_VALUE

Filtered value vs threshold value

ADC_FIRST_DERIVATIVE_OF_SINGLE_MEASUREMENT

First derivative of single measurement

ADC_ACTUAL_RESULT_VS_SETPOINT

Actual result vs setpoint

ADC_ACTUAL_RESULT_VS_FILTERED_VALUE

Actual result vs filtered value

ADC_PREVIOUS_RESULT_VALUE_ABOVE_OR_BELOW_SETPOINT

Previous result value above or below setpoint

ADC_FIRST_DERIVATIVE_OF_FILTERED_VALUE

First derivative of filtered value

ADC_FILTERED_VALUE_VS_SETPOINT

Filtered value vs setpoint

ADC_ACTUAL_RESULT_VS_THRESHOLD_VALUE

Actual result vs threshold value

ADC_FILTERED_VALUE_VS_THRESHOLD_VALUE

Filtered value vs threshold value

adc_channel_t

enum adc_channel_t

ADC_CHANNEL_VSS

VSS

ADC_CHANNEL_TEMP

Temp

ADC_CHANNEL_DAC1

DAC1

ADC_CHANNEL_FVR_BUF1

FVR_buf1

ADC_CHANNEL_ANA1

IO_RA1: RA1

ADC_CHANNEL_VSS

VSS

ADC_CHANNEL_TEMP

Temp

ADC_CHANNEL_DAC1

DAC1

ADC_CHANNEL_FVR_BUF1

FVR_buf1

ADC_CHANNEL_ANA1

IO_RA1: RA1

adc_computation_mode_t

enum adc_computation_mode_t

ADC_BASIC

Basic mode

ADC_SERIES_ACCUMULATE

Series Accumulate mode

ADC_SERIES_AVERAGE

Series Average mode

ADC_BURST_AVERAGE

Burst Average mode

ADC_LOW_PASS_FILTER

Low-Pass Filter mode

ADC_BASIC

Basic mode

ADC_SERIES_ACCUMULATE

Series Accumulate mode

ADC_SERIES_AVERAGE

Series Average mode

ADC_BURST_AVERAGE

Burst Average mode

ADC_LOW_PASS_FILTER

Low-Pass Filter mode

adc_conversion_stage_t

enum adc_conversion_stage_t

ADC_NOT_CONVERTING

Not converting

ADC_1ST_PRECHARGE

1st precharge

ADC_1ST_ACQUISITION

1st acquisition

ADC_1ST_CONVERSION

1st conversion

ADC_SUSPENDED_BETWEEN_1ST_AND_2ND_SAMPLE

Suspended between 1st and 2nd sample

ADC_2ND_PRECHARGE

2nd precharge

ADC_2ND_ACQUISITION

2nd acquisition

ADC_2ND_CONVERSION

2nd conversion

ADC_NOT_CONVERTING

Not converting

ADC_1ST_PRECHARGE

1st precharge

ADC_1ST_ACQUISITION

1st acquisition

ADC_1ST_CONVERSION

1st conversion

ADC_SUSPENDED_BETWEEN_1ST_AND_2ND_SAMPLE

Suspended between 1st and 2nd sample

ADC_2ND_PRECHARGE

2nd precharge

ADC_2ND_ACQUISITION

2nd acquisition

ADC_2ND_CONVERSION

2nd conversion

adc_threshold_mode_t

enum adc_threshold_mode_t

ADC_NEVER_INTERRUPT

Disabled

ADC_BELOW_LOWER_THRESHOLD

ADERR < ADLTH

ADC_ABOVE_LOWER_THRESHOLD

ADERR >= ADLTH

ADC_INSIDE_LOWER_AND_UPPER_THRESHOLD

ADERR > ADLTH and ADERR < ADUTH

ADC_OUTSIDE_LOWER_AND_UPPER_THRESHOLD

ADERR < ADLTH or ADERR > ADUTH

ADC_BELOW_UPPER_THRESHOLD

ADERR <= ADUTH

ADC_ABOVE_UPPER_THRESHOLD

ADERR > ADUTH

ADC_ALWAYS_INTERRUPT

Enabled

ADC_NEVER_INTERRUPT

Disabled

ADC_BELOW_LOWER_THRESHOLD

ADERR < ADLTH

ADC_ABOVE_LOWER_THRESHOLD

ADERR >= ADLTH

ADC_INSIDE_LOWER_AND_UPPER_THRESHOLD

ADERR > ADLTH and ADERR < ADUTH

ADC_OUTSIDE_LOWER_AND_UPPER_THRESHOLD

ADERR < ADLTH or ADERR > ADUTH

ADC_BELOW_UPPER_THRESHOLD

ADERR <= ADUTH

ADC_ABOVE_UPPER_THRESHOLD

ADERR > ADUTH

ADC_ALWAYS_INTERRUPT

Enabled

adc_trigger_source_t

enum adc_trigger_source_t

ADC_TRIGGER_SOURCE_DISABLED

Disabled

ADC_TRIGGER_SOURCE_ADACTPPS

ADACTPPS

ADC_TRIGGER_SOURCE_TMR0

TMR0

ADC_TRIGGER_SOURCE_TMR1

TMR1

ADC_TRIGGER_SOURCE_TMR2

TMR2

ADC_TRIGGER_SOURCE_TMR3

TMR3

ADC_TRIGGER_SOURCE_TMR4

TMR4

ADC_TRIGGER_SOURCE_TMR5

TMR5

ADC_TRIGGER_SOURCE_TMR6

TMR6

ADC_TRIGGER_SOURCE_CCP1

CCP1

ADC_TRIGGER_SOURCE_CCP2

CCP2

ADC_TRIGGER_SOURCE_PWM3

PWM3

ADC_TRIGGER_SOURCE_PWM4

PWM4

ADC_TRIGGER_SOURCE_C1OUT

C1OUT

ADC_TRIGGER_SOURCE_C2OUT

C2OUT

ADC_TRIGGER_SOURCE_IOC

IOC

ADC_TRIGGER_SOURCE_CLC1

CLC1

ADC_TRIGGER_SOURCE_CLC2

CLC2

ADC_TRIGGER_SOURCE_CLC3

CLC3

ADC_TRIGGER_SOURCE_CLC4

CLC4

ADC_TRIGGER_SOURCE_CLC5

CLC5

ADC_TRIGGER_SOURCE_CLC6

CLC6

ADC_TRIGGER_SOURCE_CLC7

CLC7

ADC_TRIGGER_SOURCE_CLC8

CLC8

ADC_TRIGGER_SOURCE_ADERR

ADERR

ADC_TRIGGER_SOURCE_ADRESH

ADRESH

ADC_TRIGGER_SOURCE_ADPCH

ADPCH

ADC_TRIGGER_SOURCE_DISABLED

Disabled

ADC_TRIGGER_SOURCE_ADACTPPS

ADACTPPS

ADC_TRIGGER_SOURCE_TMR0

TMR0

ADC_TRIGGER_SOURCE_TMR1

TMR1

ADC_TRIGGER_SOURCE_TMR2

TMR2

ADC_TRIGGER_SOURCE_TMR3

TMR3

ADC_TRIGGER_SOURCE_TMR4

TMR4

ADC_TRIGGER_SOURCE_TMR5

TMR5

ADC_TRIGGER_SOURCE_TMR6

TMR6

ADC_TRIGGER_SOURCE_CCP1

CCP1

ADC_TRIGGER_SOURCE_CCP2

CCP2

ADC_TRIGGER_SOURCE_PWM3

PWM3

ADC_TRIGGER_SOURCE_PWM4

PWM4

ADC_TRIGGER_SOURCE_C1OUT

C1OUT

ADC_TRIGGER_SOURCE_C2OUT

C2OUT

ADC_TRIGGER_SOURCE_IOC

IOC

ADC_TRIGGER_SOURCE_CLC1

CLC1

ADC_TRIGGER_SOURCE_CLC2

CLC2

ADC_TRIGGER_SOURCE_CLC3

CLC3

ADC_TRIGGER_SOURCE_CLC4

CLC4

ADC_TRIGGER_SOURCE_CLC5

CLC5

ADC_TRIGGER_SOURCE_CLC6

CLC6

ADC_TRIGGER_SOURCE_CLC7

CLC7

ADC_TRIGGER_SOURCE_CLC8

CLC8

ADC_TRIGGER_SOURCE_ADERR

ADERR

ADC_TRIGGER_SOURCE_ADRESH

ADRESH

ADC_TRIGGER_SOURCE_ADPCH

ADPCH

source/Single-Ended_Interrupts/src/adc.c File Reference

This file contains the API implementations for the ADC driver.

#include <xc.h>
#include "../adc.h"

Functions

Detailed Description

This file contains the API implementations for the ADC driver.

ADC Generated Driver File

Version: ADC Driver Version 3.0.0 ADC Package Version 5.0.0

Variable Documentation

adc_busy_status

bool adc_busy_status[static]

ADC_ConversionDoneCallback

void(* ADC_ConversionDoneCallback) (void)[static]

ADC_ThresholdCallback

void(* ADC_ThresholdCallback) (void)[static]

source/Single-Ended_Tasks/src/adc.c File Reference

This file contains the API implementations for the ADC driver.

#include <xc.h>
#include "../adc.h"

Functions

Detailed Description

This file contains the API implementations for the ADC driver.

ADC Generated Driver File

Version: ADC Driver Version 3.0.0 ADC Package Version 5.0.0

Variable Documentation

adc_busy_status

bool adc_busy_status[static]

ADC_ConversionDoneCallback

void(* ADC_ConversionDoneCallback) (void)[static]

ADC_ThresholdCallback

void(* ADC_ThresholdCallback) (void)[static]