2014-07-21 06:54 AM
Hello,
I just ran into a trap with STM32F0xx_StdPeriph_Lib_V1.3.1 and have a suggestion for a fix. In function ADC_ChannelConfig() of file stm32f0xx_adc.c, the line 724ADCx->CHSELR |= (uint32_t)ADC_Channel;
activates the selected channel. Previously selected channels remain selected. In my opinion this behaviour is misleading, also considering the function documentation header. Furthermore there is no function to de-select the previously selected channels, so I have to break with hardware abstraction in my code and clear CHSEL manually.
My suggestion is to change line 724 to
ADCx->CHSELR = (uint32_t)ADC_Channel;
which actually configures the selection passed by parameter without having a ''memory effect''.
This is already changed in Cube FW, so it would also be consistent with it.
Oliver
2015-01-26 07:40 AM
Hi Oliver,
Thanks for the valuable feedback. I've logged your fix suggestion under the STM32 SPL F0 bugs list. Keep an eye for next updates.Regards,Heisenberg.