Hi,
Thanks for reply….. I didn’t find reply option on community so replying through mail….
Sorry but I am getting confused now…. ☹
I have tried to write basic initialization code for ADC (continuous conversion only) as below:
void adc_init()
{
adc16_converter_config_t userConvConfig;
adc16_chn_config_t userChnConfig;
//uint16_t sampleValue;
//uint32_t i;
#if FSL_FEATURE_ADC16_HAS_CALIBRATION
adc16_calibration_param_t userCalConfig;
#endif /* FSL_FEATURE_ADC16_HAS_CALIBRATION */
// Execute the auto-calibration.
userConvConfig.lowPowerEnable = false;
userConvConfig.clkDividerMode = kAdc16ClkDividerOf8; //check clock settings then decide
userConvConfig.longSampleTimeEnable = false;
userConvConfig.clkSrc = kAdc16ClkSrcOfBusClk;
userConvConfig.asyncClkEnable = false;
userConvConfig.highSpeedEnable = false;
userConvConfig.longSampleCycleMode = kAdc16LongSampleCycleOf24;
userConvConfig.hwTriggerEnable = false;
userConvConfig.refVoltSrc = kAdc16RefVoltSrcOfVref;
userConvConfig.continuousConvEnable = true;
#if (FSL_FEATURE_ADC16_MAX_RESOLUTION >= 16)
userConvConfig.resolution = kAdc16ResolutionBitOf16;
#endif
ADC16_DRV_Init(ADC16_INSTANCE, &userConvConfig);
}
Doubts:
I want to include library files (HAL/peripheral)in project. How should I include it.
I am confused about ADC16_HAL_drv and ADC16_Peripheral_drv sections in 1.3 API reference manual. adc16_chn_config_t structure is different in both sections. .diffconvenable parameter is there in HAL driver and not in peripheral driver.
Which library needs to be used : HAL or peripheral. Please guide how to do project settings. I can see my settings are included directly while project creation only.
I have written above function taking reference of examples in 1.3 demo_examples folder ADC_low_power.
Request to reply I am lagging in my work due to confusion.
Thanks.