3.1.2.4 12-bit ADCC with +/- Ch. Sel.

12-bit ADC with Computation and Positive and Negative Channel Selection

3.1.2.4.1 Introduction

This Analog-to-Digital Converter with Computation (ADCC) module converts both single-ended and differential analog input signals to a 12-bit binary representation of that signal. This peripheral takes in analog signals and combines them into a Sample-and-Hold (S/H) circuit. It is then fed to a converter to turn this measurement into a 12-digit binary number and is stored in the ADC result registers. This ADCC module also features positive and negative channel grouping which allows multiple input channels to be grouped together into a single input channel.

3.1.2.4.2 Supported Device Families

PIC16F171xxPIC16F181x

3.1.2.4.3 Required header files:


#include "mcc_generated_files/adcc/adcc.h"

3.1.2.4.4 Module Documentation

Analog-to-Digital Converter (ADC)

This file provides API prototypes for the ADC driver.

Module description

This file provides API prototypes for the ADC driver.

This file provides type definitions for the ADC module.

Version: ADC Driver Version 2.0.0 ADC Package Version 2.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 12U

ADC resolution value.

IO_RA0

#define IO_RA0 ADC_CHANNEL_ANA0

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 the accumulated conversions.

Parameters:
None.
Returns:

adc_accumulate_t - Value of ADC accumulator register

ADC_AccumulatorClear()

void ADC_AccumulatorClear (void )

Clears the accumulator.

Parameters:
None.
Returns:

None.

ADC_AcquisitionTimeSet()

void ADC_AcquisitionTimeSet (uint16_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 conversion 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:
Pointer

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 )

Sets the ADC Conversion Done Interrupt Flag (ADIF) bit to '0'.

Parameters:
None.
Returns:

None.

ADC_ConversionResultGet()

adc_result_t ADC_ConversionResultGet (void )

Retrieves the result of the latest conversion.

Precondition:

Call ADC_ConversionStart(void) before using this API.

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 - Stage of the conversion stages

ADC_ConversionStart()

void ADC_ConversionStart (void )

Starts the conversion on a selected channel.

Precondition:

Select the channel(s) 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 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_DifferentialChannelSelect()

void ADC_DifferentialChannelSelect (adc_posChannel_t posChannel, adc_negChannel_t negChannel)

Sets the positive and negative channels to use for the ADC conversion.

Parameters:
posChannel

Desired positive analog channel. Refer to the adc_posChannel_t enum for the list of available analog channels.

negChannel

Desired negative analog channel. Refer to the adc_negChannel_t enum for the list of available analog channels.

Returns:

None.

ADC_DifferentialChannelSelectAndConvert()

adc_result_t ADC_DifferentialChannelSelectAndConvert (adc_posChannel_t posChannel, adc_negChannel_t negChannel)

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

Precondition:

ADC_ContinuousConversionDisable must be called prior to invoking this API.

Parameters:
posChannel

Desired positive analog channel. Refer to the adc_posChannel_t enum for the list of available analog channels.

negChannel

Desired negative analog channel. Refer to the adc_negChannel_t enum for the list of available analog channels.

Returns:

adc_result_t - The result of the conversion

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 the ADC Accumulator (ADACC) register is right shifted by the CRS bits. In Low-Pass Filter (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 the 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 the ongoing conversion is complete.

Precondition:

ADC_ConversionStart(void) is called before using this API.

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 ADC Setpoint Error (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 ADC Setpoint Error (ADERR) register is lesser 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 (ADCHxIF) flag.

Parameters:
None.
Return values:
True

ADCHxIF flag is set

False

ADCHxIF 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 (uint16_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 for the threshold interrupt.

Parameters:
*callback

The pointer to the function to be executed

Returns:

None.

ADC_ThresholdInterruptDisable()

void ADC_ThresholdInterruptDisable (void )

Sets the ADC Threshold Interrupt Disable (ADHxIE) bit to '0'.

Parameters:
None.
Returns:

None.

ADC_ThresholdInterruptEnable()

void ADC_ThresholdInterruptEnable (void )

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

Parameters:
None.
Returns:

None.

ADC_ThresholdInterruptFlagClear()

void ADC_ThresholdInterruptFlagClear (void )

Sets the ADC Threshold Interrupt Flag bit to '0'.

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_FIRST_DERIVATIVE_OF_FILTERED_VALUE

First derivative of filtered value

ADC_FILTERED_VALUE_VS_SETPOINT

Filtered value vs setpoint

adc_channel_t

enum adc_channel_t

Enumeration in Single-Ended mode that describes the available ADC channels.

ADC_CHANNEL_ADCG1

ADCG1

ADC_CHANNEL_OPA1OUT

OPA1OUT

ADC_CHANNEL_VSS

VSS

ADC_CHANNEL_TEMP

Temp

ADC_CHANNEL_DAC1OUT

DAC1OUT

ADC_CHANNEL_DAC2OUT

DAC2OUT

ADC_CHANNEL_FVR_BUFFER1

FVR_Buffer1

ADC_CHANNEL_FVR_BUFFER2

FVR_Buffer2

ADC_CHANNEL_ANC3

IO_RC3: RC3

ADC_CHANNEL_ANA0

IO_RA0: RA0

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_negChannel_t

enum adc_negChannel_t

ADC_NEGCHANNEL_OPA1OUT
ADC_NEGCHANNEL_VSS
ADC_NEGCHANNEL_TEMP
ADC_NEGCHANNEL_DAC1OUT
ADC_NEGCHANNEL_DAC2OUT
ADC_NEGCHANNEL_FVR_BUFFER1
ADC_NEGCHANNEL_FVR_BUFFER2
ADC_NEGCHANNEL_ANA0
adc_posChannel_t

enum adc_posChannel_t

ADC_POSCHANNEL_ADCG1
ADC_POSCHANNEL_OPA1OUT
ADC_POSCHANNEL_VSS
ADC_POSCHANNEL_TEMP
ADC_POSCHANNEL_DAC1OUT
ADC_POSCHANNEL_DAC2OUT
ADC_POSCHANNEL_FVR_BUFFER1
ADC_POSCHANNEL_FVR_BUFFER2
ADC_POSCHANNEL_ANA0
ADC_POSCHANNEL_ANC3
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_CCP1

CCP1

ADC_TRIGGER_SOURCE_CCP2

CCP2

ADC_TRIGGER_SOURCE_PWM1_OUT1

PWM1-OUT1

ADC_TRIGGER_SOURCE_PWM1_OUT2

PWM1-OUT2

ADC_TRIGGER_SOURCE_PWM2_OUT1

PWM2-OUT1

ADC_TRIGGER_SOURCE_PWM2_OUT2

PWM2-OUT2

ADC_TRIGGER_SOURCE_NCO1

NCO1

ADC_TRIGGER_SOURCE_CMP1

CMP1

ADC_TRIGGER_SOURCE_CMP2

CMP2

ADC_TRIGGER_SOURCE_LOGICAL_OR_OF_ALL_IOC_FLAGS

Logical OR of all IOC flags

ADC_TRIGGER_SOURCE_CLC1

CLC1

ADC_TRIGGER_SOURCE_CLC2

CLC2

ADC_TRIGGER_SOURCE_CLC3

CLC3

ADC_TRIGGER_SOURCE_CLC4

CLC4

ADC_TRIGGER_SOURCE_ADERRH

ADERRH

ADC_TRIGGER_SOURCE_ADRESH

ADRESH

ADC_TRIGGER_SOURCE_ADPCH

ADPCH

3.1.2.4.5 File Documentation

source/differential_interrupts/adc/adc.h File Reference

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

Functions

Detailed Description

ADC Generated Driver API Header File

source/differential_tasks/adc/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/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/adc.h File Reference

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

Functions

Detailed Description

ADC Generated Driver API Header File

source/differential_interrupts/adc/adc_types.h File Reference

Enumerations

Detailed Description

ADC Type Definitions Header File

source/differential_tasks/adc/adc_types.h File Reference

Enumerations

Detailed Description

ADC Type Definitions Header File

Typedef Documentation

adc_accumulate_t

typedef int32_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_FIRST_DERIVATIVE_OF_FILTERED_VALUE

First derivative of filtered value

ADC_FILTERED_VALUE_VS_SETPOINT

Filtered value vs setpoint

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_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_negChannel_t

enum adc_negChannel_t

ADC_NEGCHANNEL_OPA1OUT
ADC_NEGCHANNEL_VSS
ADC_NEGCHANNEL_TEMP
ADC_NEGCHANNEL_DAC1OUT
ADC_NEGCHANNEL_DAC2OUT
ADC_NEGCHANNEL_FVR_BUFFER1
ADC_NEGCHANNEL_FVR_BUFFER2
ADC_NEGCHANNEL_ANA0
adc_posChannel_t

enum adc_posChannel_t

ADC_POSCHANNEL_ADCG1
ADC_POSCHANNEL_OPA1OUT
ADC_POSCHANNEL_VSS
ADC_POSCHANNEL_TEMP
ADC_POSCHANNEL_DAC1OUT
ADC_POSCHANNEL_DAC2OUT
ADC_POSCHANNEL_FVR_BUFFER1
ADC_POSCHANNEL_FVR_BUFFER2
ADC_POSCHANNEL_ANA0
ADC_POSCHANNEL_ANC3
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_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_CCP1

CCP1

ADC_TRIGGER_SOURCE_CCP2

CCP2

ADC_TRIGGER_SOURCE_PWM1_OUT1

PWM1-OUT1

ADC_TRIGGER_SOURCE_PWM1_OUT2

PWM1-OUT2

ADC_TRIGGER_SOURCE_PWM2_OUT1

PWM2-OUT1

ADC_TRIGGER_SOURCE_PWM2_OUT2

PWM2-OUT2

ADC_TRIGGER_SOURCE_NCO1

NCO1

ADC_TRIGGER_SOURCE_CMP1

CMP1

ADC_TRIGGER_SOURCE_CMP2

CMP2

ADC_TRIGGER_SOURCE_LOGICAL_OR_OF_ALL_IOC_FLAGS

Logical OR of all IOC flags

ADC_TRIGGER_SOURCE_CLC1

CLC1

ADC_TRIGGER_SOURCE_CLC2

CLC2

ADC_TRIGGER_SOURCE_CLC3

CLC3

ADC_TRIGGER_SOURCE_CLC4

CLC4

ADC_TRIGGER_SOURCE_ADERRH

ADERRH

ADC_TRIGGER_SOURCE_ADRESH

ADRESH

ADC_TRIGGER_SOURCE_ADPCH

ADPCH

source/single-ended_interrupts/adc/adc_types.h File Reference

Enumerations

Detailed Description

ADC Type Definitions Header File

Typedef Documentation

adc_accumulate_t

typedef int32_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_FIRST_DERIVATIVE_OF_FILTERED_VALUE

First derivative of filtered value

ADC_FILTERED_VALUE_VS_SETPOINT

Filtered value vs setpoint

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_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_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_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_CCP1

CCP1

ADC_TRIGGER_SOURCE_CCP2

CCP2

ADC_TRIGGER_SOURCE_PWM1_OUT1

PWM1-OUT1

ADC_TRIGGER_SOURCE_PWM1_OUT2

PWM1-OUT2

ADC_TRIGGER_SOURCE_PWM2_OUT1

PWM2-OUT1

ADC_TRIGGER_SOURCE_PWM2_OUT2

PWM2-OUT2

ADC_TRIGGER_SOURCE_NCO1

NCO1

ADC_TRIGGER_SOURCE_CMP1

CMP1

ADC_TRIGGER_SOURCE_CMP2

CMP2

ADC_TRIGGER_SOURCE_LOGICAL_OR_OF_ALL_IOC_FLAGS

Logical OR of all IOC flags

ADC_TRIGGER_SOURCE_CLC1

CLC1

ADC_TRIGGER_SOURCE_CLC2

CLC2

ADC_TRIGGER_SOURCE_CLC3

CLC3

ADC_TRIGGER_SOURCE_CLC4

CLC4

ADC_TRIGGER_SOURCE_ADERRH

ADERRH

ADC_TRIGGER_SOURCE_ADRESH

ADRESH

ADC_TRIGGER_SOURCE_ADPCH

ADPCH

source/single-ended_tasks/adc/adc_types.h File Reference

Enumerations

Detailed Description

ADC Type Definitions Header File

Typedef Documentation

adc_accumulate_t

typedef int32_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_FIRST_DERIVATIVE_OF_FILTERED_VALUE

First derivative of filtered value

ADC_FILTERED_VALUE_VS_SETPOINT

Filtered value vs setpoint

adc_channel_t

enum adc_channel_t

ADC_CHANNEL_ADCG1

ADCG1

ADC_CHANNEL_OPA1OUT

OPA1OUT

ADC_CHANNEL_VSS

VSS

ADC_CHANNEL_TEMP

Temp

ADC_CHANNEL_DAC1OUT

DAC1OUT

ADC_CHANNEL_DAC2OUT

DAC2OUT

ADC_CHANNEL_FVR_BUFFER1

FVR_Buffer1

ADC_CHANNEL_FVR_BUFFER2

FVR_Buffer2

ADC_CHANNEL_ANC3

IO_RC3: RC3

ADC_CHANNEL_ANA0

IO_RA0: RA0

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_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_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_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_CCP1

CCP1

ADC_TRIGGER_SOURCE_CCP2

CCP2

ADC_TRIGGER_SOURCE_PWM1_OUT1

PWM1-OUT1

ADC_TRIGGER_SOURCE_PWM1_OUT2

PWM1-OUT2

ADC_TRIGGER_SOURCE_PWM2_OUT1

PWM2-OUT1

ADC_TRIGGER_SOURCE_PWM2_OUT2

PWM2-OUT2

ADC_TRIGGER_SOURCE_NCO1

NCO1

ADC_TRIGGER_SOURCE_CMP1

CMP1

ADC_TRIGGER_SOURCE_CMP2

CMP2

ADC_TRIGGER_SOURCE_LOGICAL_OR_OF_ALL_IOC_FLAGS

Logical OR of all IOC flags

ADC_TRIGGER_SOURCE_CLC1

CLC1

ADC_TRIGGER_SOURCE_CLC2

CLC2

ADC_TRIGGER_SOURCE_CLC3

CLC3

ADC_TRIGGER_SOURCE_CLC4

CLC4

ADC_TRIGGER_SOURCE_ADERRH

ADERRH

ADC_TRIGGER_SOURCE_ADRESH

ADRESH

ADC_TRIGGER_SOURCE_ADPCH

ADPCH

source/differential_interrupts/adc/src/adc.c File Reference

This file contains the API implementations for the ADC driver.

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

Functions

Detailed Description

This file contains the API implementations for the ADC driver.

ADC Generated Driver File

Version: ADC Driver Version 2.0.0 ADC Package Version 2.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/differential_tasks/adc/src/adc.c File Reference

This file contains the API implementations for the ADC driver.

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

Functions

Detailed Description

This file contains the API implementations for the ADC driver.

ADC Generated Driver File

Version: ADC Driver Version 2.0.0 ADC Package Version 2.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_interrupts/adc/src/adc.c File Reference

This file contains the API implementations for the ADC driver.

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

Functions

Detailed Description

This file contains the API implementations for the ADC driver.

ADC Generated Driver File

Version: ADC Driver Version 2.0.0 ADC Package Version 2.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/adc/src/adc.c File Reference

This file contains the API implementations for the ADC driver.

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

Functions

Detailed Description

This file contains the API implementations for the ADC driver.

ADC Generated Driver File

Version: ADC Driver Version 2.0.0 ADC Package Version 2.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]