48#include "adc_interface.h"
61#define ADC1_SCAN_MODE_SELECTED true
67#define ADC1_RESOLUTION 12
111 ADCON1Lbits.ADON = 1;
124 ADCON1Lbits.ADON = 0;
137 ADCON3Lbits.SWCTRG = 1;
150 ADCON3Lbits.SWCTRG = 0;
181 uint16_t result = 0x0U;
222 status = ADSTATLbits.AN10RDY;
225 status = ADSTATLbits.AN15RDY;
228 status = ADSTATLbits.AN0RDY;
231 status = ADSTATLbits.AN1RDY;
249 ADCORE0Hbits.RES = resolution;
250 ADCORE1Hbits.RES = resolution;
251 ADCON1Hbits.SHRRES = resolution;
295 IPC22bits.ADCIP = (uint16_t)0x7 & priorityValue;
341 IEC6bits.ADCAN10IE = 1;
345 IEC6bits.ADCAN15IE = 1;
349 IEC5bits.ADCAN0IE = 1;
353 IEC5bits.ADCAN1IE = 1;
372 IEC6bits.ADCAN10IE = 0;
376 IEC6bits.ADCAN15IE = 0;
380 IEC5bits.ADCAN0IE = 0;
384 IEC5bits.ADCAN1IE = 0;
403 IFS6bits.ADCAN10IF = 0;
406 IFS6bits.ADCAN15IF = 0;
409 IFS5bits.ADCAN0IF = 0;
412 IFS5bits.ADCAN1IF = 0;
431 IPC25bits.ADCAN10IP = priorityValue;
434 IPC26bits.ADCAN15IP = priorityValue;
437 IPC22bits.ADCAN0IP = priorityValue;
440 IPC23bits.ADCAN1IP = priorityValue;
This is the generated driver types header file for the ADC driver.
static bool ADC1_IsConversionComplete(enum ADC_CHANNEL channel)
This inline function returns the status of conversion.This function is used to determine if conversio...
static void ADC1_InterruptFlagClear(void)
Clears interrupt flag manually.
ADC_RESOLUTION_TYPE
Defines the supported ADC resolution types.
void ADC1_CommonCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
static void ADC1_IndividualChannelInterruptPrioritySet(enum ADC_CHANNEL channel, enum INTERRUPT_PRIORITY priorityValue)
This inline function allows selection of priority for individual channel interrupt.
static void ADC1_ResolutionSet(enum ADC_RESOLUTION_TYPE resolution)
This inline function helps to configure all cores with same resolution.
static void ADC1_IndividualChannelInterruptDisable(enum ADC_CHANNEL channel)
This inline function disables individual channel interrupt.
void ADC1_ComparatorCallback(enum ADC_CMP comparator)
Comparator callback function.
void ADC1_Deinitialize(void)
Deinitializes the ADC1 to POR values.
void ADC1_SharedCorePowerEnable(void)
Enables power for ADC1 shared Core This function is used to set the analog and digital power for ADC1...
static void ADC1_IndividualChannelInterruptEnable(enum ADC_CHANNEL channel)
This inline function enables individual channel interrupt.
void ADC1_Tasks(void)
This function is used to implement the tasks for polled implementations.
ADC_CMP
Defines the ADC comparators that are available for the module to use.
static void ADC1_Enable(void)
This inline function enables the ADC1 module.
void ADC1_ComparatorCallbackRegister(void(*callback)(enum ADC_CMP comparator))
This function can be used to override default callback and to define custom callback for ADC1_Compara...
const struct ADC_INTERFACE ADC1
Structure object of type ADC_INTERFACE with the custom name given by the user in the Melody Driver Us...
static void ADC1_InterruptEnable(void)
This inline function enables the ADC1 interrupt.
static void ADC1_InterruptPrioritySet(uint16_t priorityValue)
This inline function allows selection of priority for interrupt.
static void ADC1_IndividualChannelInterruptFlagClear(enum ADC_CHANNEL channel)
This inline function clears individual channel interrupt flag.
void ADC1_ChannelTasks(enum ADC_CHANNEL channel)
This function call used only in polling mode, if channel conversion is done for requested channel,...
void ADC1_ChannelCallback(enum ADC_CHANNEL channel, uint16_t adcVal)
This is the default callback function for all the analog channels. This callback is triggered once th...
static void ADC1_SoftwareTriggerDisable(void)
This inline function resets software common trigger.
ADC_DEDICATED_CORE
Defines the ADC cores that are available for the module to use.
static void ADC1_Disable(void)
This inline function disables the ADC1 module.
void ADC1_Initialize(void)
Initializes ADC1 module, using the given initialization data This function must be called before any ...
static void ADC1_InterruptDisable(void)
This inline function disables the ADC1 interrupt.
static void ADC1_ChannelSelect(enum ADC_CHANNEL channel)
This inline function allows selection of a channel for conversion.
static void ADC1_SoftwareTriggerEnable(void)
This inline function sets software common trigger.
ADC_CHANNEL
Defines the ADC channles that are selected from the MCC Melody User Interface for the ADC conversions...
void ADC1_CommonCallbackRegister(void(*callback)(void))
This function can be used to override default callback and to define custom callback for ADC1 Common ...
void ADC1_CorePowerEnable(enum ADC_DEDICATED_CORE core)
Enables analog and digital power for ADC1 dedicated core.
static uint16_t ADC1_ConversionResultGet(enum ADC_CHANNEL channel)
Returns the conversion value for the channel selected.
void ADC1_ChannelCallbackRegister(void(*callback)(enum ADC_CHANNEL channel, uint16_t adcVal))
This function can be used to override default callback ADC1_ChannelCallback and to define custom call...
Structure containing the function pointers of ADC driver.