Skip to content

Commit ca5444e

Browse files
committed
stmhal - add pin mapping, gpio, exti, usrsw
1 parent 0a64c92 commit ca5444e

17 files changed

Lines changed: 949 additions & 32 deletions

File tree

py/mkrules.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ vpath %.c . $(TOP)
4545
$(BUILD)/%.o: %.c
4646
$(call compile_c)
4747

48+
$(BUILD)/%.pp: %.c
49+
$(ECHO) "PreProcess $<"
50+
$(Q)$(CC) $(CFLAGS) -E -Wp,-C,-dD,-dI -o $@ $<
51+
4852
# The following rule uses | to create an order only prereuisite. Order only
4953
# prerequisites only get built if they don't exist. They don't cause timestamp
5054
# checkng to be performed.

stmhal/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ SRC_C = \
6262
systick.c \
6363
led.c \
6464
pin.c \
65+
pin_map.c \
66+
pin_named_pins.c \
6567
usart.c \
6668
usb.c \
6769
printf.c \
@@ -72,8 +74,10 @@ SRC_C = \
7274
pybmodule.c \
7375
import.c \
7476
lexerfatfs.c \
77+
gpio.c \
78+
exti.c \
79+
usrsw.c \
7580

76-
# gpio.c \
7781
# lcd.c \
7882
# servo.c \
7983
# flash.c \
@@ -86,10 +90,6 @@ SRC_C = \
8690
# adc.c \
8791
# rtc.c \
8892
# file.c \
89-
# pin_named_pins.c \
90-
# pin_map.c \
91-
# exti.c \
92-
# usrsw.c \
9393
# pybwlan.c \
9494
9595
SRC_S = \

stmhal/boards/NETDUINO_PLUS_2/mpconfigboard.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
// USRSW is pulled low. Pressing the button makes the input go high.
2222
#define USRSW_PIN (pin_B11)
23-
#define USRSW_PUPD (GPIO_PuPd_NOPULL)
24-
#define USRSW_EXTI_EDGE (EXTI_Trigger_Rising)
23+
#define USRSW_PULL (GPIO_NOPULL)
24+
#define USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
2525
#define USRSW_PRESSED (1)
2626

2727
/* LED */

stmhal/boards/PYBOARD3/mpconfigboard.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
// USRSW has no pullup or pulldown, and pressing the switch makes the input go low
1818
#define USRSW_PIN (pin_A13)
19-
#define USRSW_PUPD (GPIO_PuPd_UP)
20-
#define USRSW_EXTI_EDGE (EXTI_Trigger_Falling)
19+
#define USRSW_PULL (GPIO_PULLUP)
20+
#define USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING)
2121
#define USRSW_PRESSED (0)
2222

2323
/* LED */

stmhal/boards/PYBOARD4/mpconfigboard.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
// USRSW has no pullup or pulldown, and pressing the switch makes the input go low
1818
#define USRSW_PIN (pin_B3)
19-
#define USRSW_PUPD (GPIO_PuPd_UP)
20-
#define USRSW_EXTI_EDGE (EXTI_Trigger_Falling)
19+
#define USRSW_PULL (GPIO_PULLUP)
20+
#define USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING)
2121
#define USRSW_PRESSED (0)
2222

2323
/* LED */

stmhal/boards/STM32F4DISC/mpconfigboard.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
// USRSW is pulled low. Pressing the button makes the input go high.
1818
#define USRSW_PIN (pin_A0)
19-
#define USRSW_PUPD (GPIO_PuPd_NOPULL)
20-
#define USRSW_EXTI_EDGE (EXTI_Trigger_Rising)
19+
#define USRSW_PULL (GPIO_NOPULL)
20+
#define USRSW_EXTI_MODE (GPIO_MODE_IT_RISING)
2121
#define USRSW_PRESSED (1)
2222

2323
/* LED */

0 commit comments

Comments
 (0)