Skip to content

AnalogReference #403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Yannick-Marietti opened this issue Jan 7, 2019 · 2 comments · Fixed by #535
Closed

AnalogReference #403

Yannick-Marietti opened this issue Jan 7, 2019 · 2 comments · Fixed by #535
Assignees
Milestone

Comments

@Yannick-Marietti
Copy link

For compatibility concerns, is it possible to implement a "dummy" analogReference() function ?

This function is often used by teachers to explain ADC principle using Arduino UNO boards.
Of course, if STM32 ADC can be set to a level different than 3.3 Volts, a future working implementation would be a must-have for teachers.

BR

Yannick

@fpistm fpistm self-assigned this Jan 7, 2019
@fpistm fpistm added this to the 1.6.0 milestone Jun 5, 2019
fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this issue Jun 5, 2019
fpistm added a commit that referenced this issue Jun 5, 2019
@firexx
Copy link

firexx commented Apr 11, 2023

in the current version 2.5.0 used
void analogReference(eAnalogReference ulMode)
prototype, instead of original in Arduino:
void analogReference(uint8_t mode);
so the compatibility is not provided

@fpistm
Copy link
Member

fpistm commented Apr 11, 2023

Original was with eAnalogReference which is an enum.
Example in the samd core:
https://github.com/arduino/ArduinoCore-sam/blob/790ff2c852bf159787a9966bddee4d9f55352d15/cores/arduino/wiring_analog.h#L40

Now within the Arduino Core API:
https://github.com/arduino/ArduinoCore-API/blob/master/api/Common.h#L100

anyway, the mode always defined as an enum but with different name like with the mbed core:
https://github.com/arduino/ArduinoCore-mbed/blob/0504d34ada3d5aac69eacb481bcdc64860aebca9/variants/NICLA/pins_arduino.h#L13

As the function is provided just for compatibility (be able to build) and do nothing as the arguments is unused and also match an uint8_t value it is compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants