Skip to content

Analog pins definition #37

Closed
Closed
@fpistm

Description

@fpistm

Hi all,
I would like to open a discussion around the analog pins definition Ax
Currently, we mainly defined A0 to A5 but STM2 MCU provide more than 6 ADC.
And in PinMap_ADC we make available more than A0-A5.
So, constant NUM_ANALOG_INPUTS is not aligned.

Questions are:
Is it required to define more than A0 to A5 by default ?
If not then, only comment the other pins in PinMap_ADC.
If yes, extend the Ax to the same number of pins defined in PinMap_ADC. This will imply to duplicate some pin definitions in digital_arduino array or reordering it.

Furthermore, after discussion with Arduino developper, the AnalogRead(A0) == AnalogRead(0) should be the same while AnalogWrite(0) == AnalogWrite(D0).

For constant value, it should be changed to not use sizeof to avoid issue:

#define NUM_ANALOG_INPUTS       (AEND - A0)

Any feedback are welcome here on in the stm32duino forum dedicated topics

Note: I took as example the Nucleo F429ZI but it is valid far all variant.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wanted 🙏Extra attention is neededquestion ❓Usually converted as a discussion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions