Skip to content

Commit 61b2c93

Browse files
committed
[genpinmap] Fix STM32L47xxx/48xxx ADC pinmap
For the ADC, it is necessary to configure the GPIOx_ASCR register, only for STM32L47xxx/48xxx Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent c41950a commit 61b2c93

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/genpinmap/genpinmap_arduino.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,13 @@ def print_list_header(comment, name, l, switch):
373373

374374
def print_adc():
375375
# Check GPIO version (alternate or not)
376-
s_pin_data = "STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, "
376+
s_pin_data = "STM_PIN_DATA_EXT(STM_MODE_ANALOG"
377+
# For STM32L47xxx/48xxx, it is necessary to configure
378+
# the GPIOx_ASCR register
379+
if re.match("STM32L4[78]+", mcu_file):
380+
s_pin_data += "_ADC_CONTROL"
381+
s_pin_data += ", GPIO_NOPULL, 0, "
382+
377383
for p in adclist:
378384
if "IN" in p[2]:
379385
s1 = "%-12s" % (" {" + p[0] + ",")

0 commit comments

Comments
 (0)