77 .ComparatorTasks = NULL,
116 ADCON1L = (uint16_t)0x8000 & (uint16_t)0x7FFF;
126 ADCON3H = (uint16_t)0x8383 & (uint16_t)0xFF00;
224 ADCON5H = (uint16_t)0x400 & (uint16_t)0xF0FF;
275 IFS5bits.ADCAN0IF = 0;
277 IEC5bits.ADCAN0IE = 1;
280 ADCON5Hbits.WARMTIME = 0xF;
282 ADCON1Lbits.ADON = 0x1;
317 ADCON1Lbits.ADON = 0;
320 IFS5bits.ADCAN0IF = 0;
321 IEC5bits.ADCAN0IE = 0;
419 ADCON5Lbits.C0PWR = 1;
420 while(ADCON5Lbits.C0RDY == 0)
423 ADCON3Hbits.C0EN = 1;
426 ADCON5Lbits.C1PWR = 1;
427 while(ADCON5Lbits.C1RDY == 0)
430 ADCON3Hbits.C1EN = 1;
440 ADCON5Lbits.SHRPWR = 1;
441 while(ADCON5Lbits.SHRRDY == 0)
444 ADCON3Hbits.SHREN = 1;
449 uint16_t adcTriggerSourceValue = 0x0U;
535 return adcTriggerSourceValue;
540 uint16_t adcTriggerValue;
545 ADTRIG0Hbits.TRGSRC2 = adcTriggerValue;
548 ADTRIG2Lbits.TRGSRC9 = adcTriggerValue;
551 ADTRIG2Hbits.TRGSRC10 = adcTriggerValue;
554 ADTRIG3Hbits.TRGSRC14 = adcTriggerValue;
557 ADTRIG3Hbits.TRGSRC15 = adcTriggerValue;
560 ADTRIG4Hbits.TRGSRC19 = adcTriggerValue;
563 ADTRIG0Lbits.TRGSRC0 = adcTriggerValue;
566 ADTRIG0Lbits.TRGSRC1 = adcTriggerValue;
587void __attribute__ ( ( __interrupt__ , auto_psv, weak ) ) _ADCInterrupt (
void )
592 (*ADC1_CommonHandler)();
595 if(IFS5bits.ADCAN2IF == 1)
601 (*ADC1_ChannelHandler)(
FB_VOUT, adcVal);
603 IFS5bits.ADCAN2IF = 0;
605 if(IFS6bits.ADCAN9IF == 1)
611 (*ADC1_ChannelHandler)(
FB_VCAP, adcVal);
613 IFS6bits.ADCAN9IF = 0;
615 if(IFS6bits.ADCAN10IF == 1)
623 IFS6bits.ADCAN10IF = 0;
625 if(IFS6bits.ADCAN14IF == 1)
631 (*ADC1_ChannelHandler)(
FB_TEMP, adcVal);
633 IFS6bits.ADCAN14IF = 0;
635 if(IFS6bits.ADCAN15IF == 1)
643 IFS6bits.ADCAN15IF = 0;
645 if(IFS6bits.ADCAN19IF == 1)
651 (*ADC1_ChannelHandler)(
FB_5V, adcVal);
653 IFS6bits.ADCAN19IF = 0;
655 if(IFS5bits.ADCAN0IF == 1)
663 IFS5bits.ADCAN0IF = 0;
665 if(IFS5bits.ADCAN1IF == 1)
673 IFS5bits.ADCAN1IF = 0;
682 if(IFS5bits.ADCIF == 1)
686 (*ADC1_CommonHandler)();
709void __attribute__ ( ( __interrupt__ , auto_psv, weak ) ) _ADCAN2Interrupt (
void )
713 valFB_VOUT = ADCBUF2;
717 (*ADC1_ChannelHandler)(
FB_VOUT, valFB_VOUT);
721 IFS5bits.ADCAN2IF = 0;
724void __attribute__ ( ( __interrupt__ , auto_psv, weak ) ) _ADCAN9Interrupt (
void )
728 valFB_VCAP = ADCBUF9;
732 (*ADC1_ChannelHandler)(
FB_VCAP, valFB_VCAP);
736 IFS6bits.ADCAN9IF = 0;
739void __attribute__ ( ( __interrupt__ , auto_psv, weak ) ) _ADCAN10Interrupt (
void )
741 uint16_t valVIN_INT_AN;
743 valVIN_INT_AN = ADCBUF10;
747 (*ADC1_ChannelHandler)(
VIN_INT_AN, valVIN_INT_AN);
751 IFS6bits.ADCAN10IF = 0;
754void __attribute__ ( ( __interrupt__ , auto_psv, weak ) ) _ADCAN14Interrupt (
void )
758 valFB_TEMP = ADCBUF14;
762 (*ADC1_ChannelHandler)(
FB_TEMP, valFB_TEMP);
766 IFS6bits.ADCAN14IF = 0;
769void __attribute__ ( ( __interrupt__ , auto_psv, weak ) ) _ADCAN15Interrupt (
void )
771 uint16_t valChannel_AN15;
773 valChannel_AN15 = ADCBUF15;
781 IFS6bits.ADCAN15IF = 0;
784void __attribute__ ( ( __interrupt__ , auto_psv, weak ) ) _ADCAN19Interrupt (
void )
792 (*ADC1_ChannelHandler)(
FB_5V, valFB_5V);
796 IFS6bits.ADCAN19IF = 0;
800void __attribute__ ( ( __interrupt__ , auto_psv, weak ) ) _ADCAN0Interrupt (
void )
802 uint16_t valFB_P_CT_FILT;
804 valFB_P_CT_FILT = ADCBUF0;
812 IFS5bits.ADCAN0IF = 0;
815void __attribute__ ( ( __interrupt__ , auto_psv, weak ) ) _ADCAN1Interrupt (
void )
817 uint16_t valI_SEC_AVG_FILT;
819 valI_SEC_AVG_FILT = ADCBUF1;
827 IFS5bits.ADCAN1IF = 0;
838 if((
bool)ADSTATLbits.AN2RDY == 1)
845 (*ADC1_ChannelHandler)(channel, adcVal);
850 if((
bool)ADSTATLbits.AN9RDY == 1)
857 (*ADC1_ChannelHandler)(channel, adcVal);
862 if((
bool)ADSTATLbits.AN10RDY == 1)
869 (*ADC1_ChannelHandler)(channel, adcVal);
874 if((
bool)ADSTATLbits.AN14RDY == 1)
881 (*ADC1_ChannelHandler)(channel, adcVal);
886 if((
bool)ADSTATLbits.AN15RDY == 1)
893 (*ADC1_ChannelHandler)(channel, adcVal);
898 if((
bool)ADSTATHbits.AN19RDY == 1)
905 (*ADC1_ChannelHandler)(channel, adcVal);
910 if((
bool)ADSTATLbits.AN0RDY == 1)
917 (*ADC1_ChannelHandler)(channel, adcVal);
922 if((
bool)ADSTATLbits.AN1RDY == 1)
929 (*ADC1_ChannelHandler)(channel, adcVal);
This is the generated driver header file for the ADC1 driver.
void __attribute__((weak))
static void(* ADC1_ComparatorHandler)(enum ADC_CMP comparator)
static void(* ADC1_CommonHandler)(void)
const struct ADC_MULTICORE adc1Multicore
static uint16_t ADC1_TriggerSourceValueGet(enum ADC_PWM_INSTANCE pwmInstance, enum ADC_PWM_TRIGGERS triggerNumber)
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.
ADC_PWM_TRIGGERS
Defines the PWM triggers that are available in each individual PWM.
void ADC1_CommonCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
ADC_PWM_TRIG_SRCS
Defines the PWM ADC TRIGGER sources available for the module to use.
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.
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.
ADC_PWM_INSTANCE
Defines the ADC PWM trigger sources that are available for the module to use.
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.
Structure containing the function pointers of ADC driver.