diff options
author | Ayke van Laethem <[email protected]> | 2022-06-29 13:56:20 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-07-15 14:46:33 +0200 |
commit | 411333327efdb3bc46d1e05fef11bebfc24325a2 (patch) | |
tree | 96279696fdf5c3448ba5d0abe27bc3b71a557793 | |
parent | 159f7ebbc395478567344c6eed052223c4acdc5e (diff) | |
download | tinygo-411333327efdb3bc46d1e05fef11bebfc24325a2.tar.gz tinygo-411333327efdb3bc46d1e05fef11bebfc24325a2.zip |
esp32c3: provide hardware pin constants
-rw-r--r-- | src/machine/board_esp32c3-12f.go | 30 | ||||
-rw-r--r-- | src/machine/board_m5stamp_c3.go | 44 | ||||
-rw-r--r-- | src/machine/machine_esp32c3.go | 25 |
3 files changed, 62 insertions, 37 deletions
diff --git a/src/machine/board_esp32c3-12f.go b/src/machine/board_esp32c3-12f.go index fd853526b..a9d4075a2 100644 --- a/src/machine/board_esp32c3-12f.go +++ b/src/machine/board_esp32c3-12f.go @@ -12,21 +12,21 @@ const ( ) const ( - IO0 Pin = 0 - IO1 Pin = 1 - IO10 Pin = 10 - IO18 Pin = 18 - IO19 Pin = 19 - IO2 Pin = 2 - IO3 Pin = 3 - IO4 Pin = 4 - IO5 Pin = 5 - IO6 Pin = 6 - IO7 Pin = 7 - IO8 Pin = 8 - IO9 Pin = 9 - RXD Pin = 20 - TXD Pin = 21 + IO0 = GPIO0 + IO1 = GPIO1 + IO2 = GPIO2 + IO3 = GPIO3 + IO4 = GPIO4 + IO5 = GPIO5 + IO6 = GPIO6 + IO7 = GPIO7 + IO8 = GPIO8 + IO9 = GPIO9 + IO10 = GPIO10 + IO18 = GPIO18 + IO19 = GPIO19 + RXD = GPIO20 + TXD = GPIO21 ) // ADC pins diff --git a/src/machine/board_m5stamp_c3.go b/src/machine/board_m5stamp_c3.go index 0178f6439..dbb0e345e 100644 --- a/src/machine/board_m5stamp_c3.go +++ b/src/machine/board_m5stamp_c3.go @@ -4,28 +4,28 @@ package machine const ( - IO0 Pin = 0 - IO1 Pin = 1 - IO2 Pin = 2 - IO3 Pin = 3 - IO4 Pin = 4 - IO5 Pin = 5 - IO6 Pin = 6 - IO7 Pin = 7 - IO8 Pin = 8 - IO9 Pin = 9 - IO10 Pin = 10 - IO11 Pin = 11 - IO12 Pin = 12 - IO13 Pin = 13 - IO14 Pin = 14 - IO15 Pin = 15 - IO16 Pin = 16 - IO17 Pin = 17 - IO18 Pin = 18 - IO19 Pin = 19 - IO20 Pin = 20 - IO21 Pin = 21 + IO0 = GPIO0 + IO1 = GPIO1 + IO2 = GPIO2 + IO3 = GPIO3 + IO4 = GPIO4 + IO5 = GPIO5 + IO6 = GPIO6 + IO7 = GPIO7 + IO8 = GPIO8 + IO9 = GPIO9 + IO10 = GPIO10 + IO11 = GPIO11 + IO12 = GPIO12 + IO13 = GPIO13 + IO14 = GPIO14 + IO15 = GPIO15 + IO16 = GPIO16 + IO17 = GPIO17 + IO18 = GPIO18 + IO19 = GPIO19 + IO20 = GPIO20 + IO21 = GPIO21 XTAL_32K_P = IO0 XTAL_32K_N = IO1 diff --git a/src/machine/machine_esp32c3.go b/src/machine/machine_esp32c3.go index cb9f2d6f8..71fcbbc40 100644 --- a/src/machine/machine_esp32c3.go +++ b/src/machine/machine_esp32c3.go @@ -30,6 +30,31 @@ const ( PinInputPulldown ) +const ( + GPIO0 Pin = 0 + GPIO1 Pin = 1 + GPIO2 Pin = 2 + GPIO3 Pin = 3 + GPIO4 Pin = 4 + GPIO5 Pin = 5 + GPIO6 Pin = 6 + GPIO7 Pin = 7 + GPIO8 Pin = 8 + GPIO9 Pin = 9 + GPIO10 Pin = 10 + GPIO11 Pin = 11 + GPIO12 Pin = 12 + GPIO13 Pin = 13 + GPIO14 Pin = 14 + GPIO15 Pin = 15 + GPIO16 Pin = 16 + GPIO17 Pin = 17 + GPIO18 Pin = 18 + GPIO19 Pin = 19 + GPIO20 Pin = 20 + GPIO21 Pin = 21 +) + type PinChange uint8 // Pin change interrupt constants for SetInterrupt. |