Hi
I've written an adc driver based on the sdk v1.0.0 and have since upgraded to v 1.1.0. My adc driver has stopped working. Investigation has uncovered the changes detailed below.
It seems the two most significant changes that effect me are the changes to the state_ptr and how this is now handled. Also I notice that the ADC_CONV_SIGN32_MASK has changed which leads me to believe that the mask in v1.0.0 is incorrect and this will show as a bug when reading results from diff mode conversion. (I might be wrong in this assumption)
I'm using v1.1.0 but have copied v1.0.0 adc hal and driver code into the 1.1.0 sdk. What is your advice in using v1.0.0 adc code? are there any bugs I should be aware of. Can somebody please explain what the changes are for. What was broken?
The changes:
#include "fsl_adc_features.h" removed, so no support for multiple devices?
#include "fsl_adc_common.h" removed not figured this out?
#define ADC_CONV_SIGN32_MASK (0x80000000U) Mask changed to 0xFFFF0000
static adc_state_t *volatile g_adcStatePtr[HW_ADC_INSTANCE_COUNT]; Removed. This is the biggest change. What's wrong with this method of doing things?
The functions below have been replaced with Removed replaced with ADC16_DRV_StructInitUserConfigDefault(adc16_user_config_t *userConfigPtr)
ADC_DRV_StructInitUserConfigForIntMode(adc_user_config_t *userConfigPtr)
ADC_DRV_StructInitUserConfigForBlockingMode(adc_user_config_t *userConfigPtr) Removed
ADC_DRV_StructInitUserConfigForOneTimeTriggerMode(adc_user_config_t *userConfigPtr) Removed
adc_state_t *userStatePtr has been removed therefore from the function below so Internal context g_adcStatePtr[instance] = userStatePtr; is not now supported.
ADC_DRV_Init(uint32_t instance, adc_user_config_t *userConfigPtr, adc_state_t *userStatePtr)
What is the significance of this?
how is this done in the adc16 driver
Why has the function below been moved to fsl_adc_irq.c
uint16_t ADC_DRV_GetConvValueRAWInt(uint32_t instance, uint32_t chnGroup)
The mask ADC_CONV_SIGN32_MASK used in the conversion routine below has changed why?
int32_t ADC_DRV_ConvRAWData(uint16_t convValue, bool diffEnable, adc_resolution_mode_t mode)
The callback registration mechanism has been removed and it is now upto the user of the sdk to write his/her own. Removed and moved to fsl_adc_irq.c
adc_status_t ADC_DRV_InstallCallback(uint32_t instance, uint32_t chnGroup, adc_callback_t userCallback)
You guys must have check-in logs to your repository that explains the reason for the change to each file. Could you please post this information so that we can make informed decision regarding the use of the drivers that you have kindly provided for us.
Thanks