/*FUNCTION********************************************************************** * * Function Name : SIM_HAL_SetAdcTriggerModeOneStep * Description : Set ADCx trigger setting. * This function sets ADC alternate trigger, pre-trigger mode and trigger mode. * *END**************************************************************************/ void SIM_HAL_SetAdcTriggerModeOneStep(SIM_Type* base, uint32_t instance, bool altTrigEn, sim_adc_pretrg_sel_t preTrigSel, sim_adc_trg_sel_t trigSel) { assert(instance < ADC_INSTANCE_COUNT); switch (instance) { case 0: SIM_BWR_SOPT7_ADC0ALTTRGEN(base, altTrigEn ? 1 : 0); SIM_BWR_SOPT7_ADC0PRETRGSEL(base, preTrigSel); break; default: break; } if (altTrigEn) { switch (instance) { case 0: SIM_BWR_SOPT7_ADC0TRGSEL(base, trigSel); break; default: break; } } }
/*FUNCTION********************************************************************** * * Function Name : SIM_HAL_SetAdcAlternativeTriggerCmd * Description : Set ADCx alternate trigger enable setting * This function will enable/disable alternative conversion triggers for ADCx. * *END**************************************************************************/ void SIM_HAL_SetAdcAlternativeTriggerCmd(SIM_Type * base, uint32_t instance, bool enable) { assert(instance < ADC_INSTANCE_COUNT); switch (instance) { case 0: SIM_BWR_SOPT7_ADC0ALTTRGEN(base, enable ? 1 : 0); break; default: break; } }
/*FUNCTION********************************************************************** * * Function Name : SIM_HAL_SetAdcAlternativeTriggerMode * Description : Sets the ADCx alternate trigger select setting * This function selects the alternative conversion triggers for ADCx * *END**************************************************************************/ void SIM_HAL_SetAdcAlternativeTriggerMode(SIM_Type * base, uint32_t instance, sim_adc_alttrg_sel_t select) { assert(instance < ADC_INSTANCE_COUNT); switch (instance) { case 0: SIM_BWR_SOPT7_ADC0ALTTRGEN(base, select); break; case 1: SIM_BWR_SOPT7_ADC1ALTTRGEN(base, select); break; default: break; } }
/*FUNCTION********************************************************************** * * Function Name : SIM_HAL_SetAdcAlternativeTriggerCmd * Description : Set ADCx alternate trigger enable setting * This function will enable/disable alternative conversion triggers for ADCx. * *END**************************************************************************/ void SIM_HAL_SetAdcAlternativeTriggerCmd(SIM_Type * base, uint32_t instance, bool enable) { assert(instance < ADC_INSTANCE_COUNT); SIM_BWR_SOPT7_ADC0ALTTRGEN(base, enable ? 1 : 0); }