53 .ComparatorTasks = NULL,
62 .PWMTriggerSourceSet = NULL
92 ADCON1L = (uint16_t)0x8000 & (uint16_t)0x7FFF;
102 ADCON3H = (uint16_t)0x83 & (uint16_t)0xFF00;
198 ADCON5H = (uint16_t)0x400 & (uint16_t)0xF0FF;
251 IFS5bits.ADCAN0IF = 0;
253 IEC5bits.ADCAN0IE = 1;
255 IFS5bits.ADCAN1IF = 0;
257 IEC5bits.ADCAN1IE = 1;
260 ADCON5Hbits.WARMTIME = 0xF;
262 ADCON1Lbits.ADON = 0x1;
297 ADCON1Lbits.ADON = 0;
300 IFS5bits.ADCAN0IF = 0;
301 IEC5bits.ADCAN0IE = 0;
304 IFS5bits.ADCAN1IF = 0;
305 IEC5bits.ADCAN1IE = 0;
404 ADCON5Lbits.C0PWR = 1;
405 while(ADCON5Lbits.C0RDY == 0)
408 ADCON3Hbits.C0EN = 1;
411 ADCON5Lbits.C1PWR = 1;
412 while(ADCON5Lbits.C1RDY == 0)
415 ADCON3Hbits.C1EN = 1;
425 ADCON5Lbits.SHRPWR = 1;
426 while(ADCON5Lbits.SHRRDY == 0)
429 ADCON3Hbits.SHREN = 1;
446void __attribute__ ( ( __interrupt__ , auto_psv, weak ) )
_ADCInterrupt (
void )
451 (*ADC1_CommonHandler)();
454 if(IFS6bits.ADCAN10IF == 1)
460 (*ADC1_ChannelHandler)(
FB_Vout, adcVal);
462 IFS6bits.ADCAN10IF = 0;
464 if(IFS6bits.ADCAN15IF == 1)
470 (*ADC1_ChannelHandler)(
FB_AC_N, adcVal);
472 IFS6bits.ADCAN15IF = 0;
474 if(IFS5bits.ADCAN0IF == 1)
480 (*ADC1_ChannelHandler)(
IL1_F, adcVal);
482 IFS5bits.ADCAN0IF = 0;
484 if(IFS5bits.ADCAN1IF == 1)
490 (*ADC1_ChannelHandler)(
IL2_F, adcVal);
492 IFS5bits.ADCAN1IF = 0;
501 if(IFS5bits.ADCIF == 1)
505 (*ADC1_CommonHandler)();
532 valFB_Vout = ADCBUF10;
536 (*ADC1_ChannelHandler)(
FB_Vout, valFB_Vout);
540 IFS6bits.ADCAN10IF = 0;
547 valFB_AC_N = ADCBUF15;
551 (*ADC1_ChannelHandler)(
FB_AC_N, valFB_AC_N);
555 IFS6bits.ADCAN15IF = 0;
567 (*ADC1_ChannelHandler)(
IL1_F, valIL1_F);
571 IFS5bits.ADCAN0IF = 0;
582 (*ADC1_ChannelHandler)(
IL2_F, valIL2_F);
586 IFS5bits.ADCAN1IF = 0;
597 if((
bool)ADSTATLbits.AN10RDY == 1)
604 (*ADC1_ChannelHandler)(channel, adcVal);
609 if((
bool)ADSTATLbits.AN15RDY == 1)
616 (*ADC1_ChannelHandler)(channel, adcVal);
621 if((
bool)ADSTATLbits.AN0RDY == 1)
628 (*ADC1_ChannelHandler)(channel, adcVal);
633 if((
bool)ADSTATLbits.AN1RDY == 1)
640 (*ADC1_ChannelHandler)(channel, adcVal);
This is the generated driver header file for the ADC1 driver.
static void(* ADC1_ComparatorHandler)(enum ADC_CMP comparator)
void _ADCAN15Interrupt(void)
void _ADCAN1Interrupt(void)
static void(* ADC1_CommonHandler)(void)
void _ADCAN0Interrupt(void)
void _ADCAN10Interrupt(void)
const struct ADC_MULTICORE adc1Multicore
static void(* ADC1_ChannelHandler)(enum ADC_CHANNEL channel, uint16_t adcVal)
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_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.
void(* Initialize)(void)
Pointer to ADCx_Initialize e.g. ADC1_Initialize.
Structure containing the function pointers of ADC driver.
void(* ChannelTasks)(enum ADC_CHANNEL channel)
Pointer to ADCx_ChannelTasks e.g. ADC1_ChannelTasks.