Skip to content

Conversation

@cybertale
Copy link
Contributor

For STM32L47x/48x series devices, if we want to configure one
GPIO line as ADC input, we have to set the corresponding
bit in GPIOx_ASCR register to get ADC and GPIO line connected.

Signed-off-by: Song Qiang [email protected]

@codecov-io
Copy link

codecov-io commented Mar 7, 2019

Codecov Report

Merging #14131 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #14131   +/-   ##
=======================================
  Coverage   51.97%   51.97%           
=======================================
  Files         309      309           
  Lines       45582    45582           
  Branches    10555    10555           
=======================================
  Hits        23691    23691           
  Misses      17082    17082           
  Partials     4809     4809

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d9e212d...0af5040. Read the comment docs.

@cybertale
Copy link
Contributor Author

@erwango

@cybertale
Copy link
Contributor Author

cybertale commented Mar 10, 2019

@erwango Should we call someone else to get this merged? Or after #13447 is merged?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment in the code explaining why we're doing this would be nice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the comment inside the #if def ?
I prefer this way because it could happen sometime that people add code between comment and code so we don't know anymore what is the comment related to. If comment is inside the ifdef this is less likely to happen.

Also, please rephrase to "For STM32L47xx/48xx, register ASCR should be configured to connect analog switch of gpio lines to the ADC."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be done for every pin, and any configuration?
I mean, if I configure a led or an uart pin, I'll run into this code, is this correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this is wrong, my mistake... should be only configured in analog mode.

@cybertale cybertale force-pushed the stm32-gpio-l4-analog branch from 5e2352f to bb072cc Compare March 13, 2019 02:44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the comment inside the #if def ?
I prefer this way because it could happen sometime that people add code between comment and code so we don't know anymore what is the comment related to. If comment is inside the ifdef this is less likely to happen.

Also, please rephrase to "For STM32L47xx/48xx, register ASCR should be configured to connect analog switch of gpio lines to the ADC."

@cybertale
Copy link
Contributor Author

@erwango Sorry for the delay, my computer is out of order and has been sent for repair, so I'll make the change about 2-4 days later.

@erwango erwango added this to the v1.15.0 milestone Mar 18, 2019
@erwango
Copy link
Member

erwango commented Mar 18, 2019

@erwango Sorry for the delay, my computer is out of order and has been sent for repair, so I'll make the change about 2-4 days later.

No hurry, this is for 1.15

@cybertale cybertale force-pushed the stm32-gpio-l4-analog branch from bb072cc to 0af5040 Compare March 20, 2019 12:15
For STM32L47x/48x series devices, register ASCR should be configured to
connect analog switch of gpio lines to the ADC.

Signed-off-by: Song Qiang <[email protected]>
@galak galak force-pushed the stm32-gpio-l4-analog branch from 0af5040 to ab0368c Compare April 17, 2019 20:16
@galak galak merged commit 3751275 into zephyrproject-rtos:master Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants