47#include "adc_interface.h"
60#define ADC1_SCAN_MODE_SELECTED true
66#define ADC1_RESOLUTION 12
110 ADCON1Lbits.ADON = 1;
123 ADCON1Lbits.ADON = 0;
136 ADCON3Lbits.SWCTRG = 1;
149 ADCON3Lbits.SWCTRG = 0;
180 uint16_t result = 0x0U;
230 status = ADSTATLbits.AN2RDY;
233 status = ADSTATLbits.AN7RDY;
236 status = ADSTATLbits.AN10RDY;
239 status = ADSTATLbits.AN14RDY;
242 status = ADSTATHbits.AN19RDY;
245 status = ADSTATLbits.AN0RDY;
248 status = ADSTATLbits.AN1RDY;
266 ADCORE0Hbits.RES = resolution;
267 ADCORE1Hbits.RES = resolution;
268 ADCON1Hbits.SHRRES = resolution;
312 IPC22bits.ADCIP = (uint16_t)0x7 & priorityValue;
358 IEC5bits.ADCAN2IE = 1;
362 IEC6bits.ADCAN7IE = 1;
366 IEC6bits.ADCAN10IE = 1;
370 IEC6bits.ADCAN14IE = 1;
374 IEC6bits.ADCAN19IE = 1;
378 IEC5bits.ADCAN0IE = 1;
382 IEC5bits.ADCAN1IE = 1;
401 IEC5bits.ADCAN2IE = 0;
405 IEC6bits.ADCAN7IE = 0;
409 IEC6bits.ADCAN10IE = 0;
413 IEC6bits.ADCAN14IE = 0;
417 IEC6bits.ADCAN19IE = 0;
421 IEC5bits.ADCAN0IE = 0;
425 IEC5bits.ADCAN1IE = 0;
444 IFS5bits.ADCAN2IF = 0;
447 IFS6bits.ADCAN7IF = 0;
450 IFS6bits.ADCAN10IF = 0;
453 IFS6bits.ADCAN14IF = 0;
456 IFS6bits.ADCAN19IF = 0;
459 IFS5bits.ADCAN0IF = 0;
462 IFS5bits.ADCAN1IF = 0;
481 IPC23bits.ADCAN2IP = priorityValue;
484 IPC24bits.ADCAN7IP = priorityValue;
487 IPC25bits.ADCAN10IP = priorityValue;
490 IPC26bits.ADCAN14IP = priorityValue;
493 IPC27bits.ADCAN19IP = priorityValue;
496 IPC22bits.ADCAN0IP = priorityValue;
499 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.
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_PWMTriggerSourceSet(enum ADC_CHANNEL channel, enum ADC_PWM_INSTANCE pwmInstance, enum ADC_PWM_TRIGGERS triggerNumber)
Sets PWM trigger source for corresponding analog input.
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.
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.
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.
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.