On the Freedom K64F board, some ADC channels don’t have to be muxed to a pin
It is not possible to use them as the AnalogIn API expects a PinName argument
You can fake them. There was similar case for DAC which did not have actually any pin, so was set to 0xFFFFFFE to be distinguish.
What else is it required to be changed in mbed-hal-ksdk-mcu/analogin.c file ? You can create an issue with a proposal for the fix in the ksdk mcu hal repository.
If we go the “fake pins” route, it would make sense to add every ADC channel (ADCn_xxx).
Don’t you think it is cleaner to add a constructor to the AnalogIn class as I did? I understand changing the API is a bigger deal…
I’m new to mbed and I’m disappointed that I cannot use ADC0_DP1, ADC0_DM1, ADC1_DP1 and ADC1_DM1 with AnalogIn() out of the box. I tried to compile within the Compiler Deprecation | Mbed environment the code that Julien has publish but I cannot compile the source obtaining errors in CallChain.cpp (unknown symbols for _size and _elements…). I obtained the same results if I’m importing to my Programs any mbed-src library even without Julien’s modifications. How can I solve the error while compiling mbed-src and use Julien’s modifications to access the 16-bits ADC converter and start my testing.