Skip to content

Commit c7d8223

Browse files
deadprogramaykevl
authored andcommitted
machine/esp32, targets/esp32: correct board definitions for actual boards not processor variants, also define all labeled pins
Signed-off-by: deadprogram <[email protected]>
1 parent 3eb33df commit c7d8223

File tree

6 files changed

+96
-11
lines changed

6 files changed

+96
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ ifneq ($(AVR), 0)
363363
@$(MD5SUM) test.hex
364364
endif
365365
ifneq ($(XTENSA), 0)
366-
$(TINYGO) build -size short -o test.bin -target=esp32-wroom-32 examples/blinky1
366+
$(TINYGO) build -size short -o test.bin -target=esp32-mini32 examples/blinky1
367367
@$(MD5SUM) test.bin
368368
$(TINYGO) build -size short -o test.bin -target=nodemcu examples/blinky1
369369
@$(MD5SUM) test.bin
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// +build esp32_coreboard_v2
2+
3+
package machine
4+
5+
// Built-in LED on some ESP32 boards.
6+
const LED = IO2
7+
8+
const (
9+
CLK Pin = 6
10+
CMD Pin = 11
11+
IO0 Pin = 0
12+
IO1 Pin = 1
13+
IO10 Pin = 10
14+
IO16 Pin = 16
15+
IO17 Pin = 17
16+
IO18 Pin = 18
17+
IO19 Pin = 19
18+
IO2 Pin = 2
19+
IO21 Pin = 21
20+
IO22 Pin = 22
21+
IO23 Pin = 23
22+
IO25 Pin = 25
23+
IO26 Pin = 26
24+
IO27 Pin = 27
25+
IO3 Pin = 3
26+
IO32 Pin = 32
27+
IO33 Pin = 33
28+
IO34 Pin = 34
29+
IO35 Pin = 35
30+
IO36 Pin = 36
31+
IO39 Pin = 39
32+
IO4 Pin = 4
33+
IO5 Pin = 5
34+
IO9 Pin = 9
35+
RXD Pin = 3
36+
SD0 Pin = 7
37+
SD1 Pin = 8
38+
SD2 Pin = 9
39+
SD3 Pin = 10
40+
SVN Pin = 39
41+
SVP Pin = 36
42+
TCK Pin = 13
43+
TD0 Pin = 15
44+
TDI Pin = 12
45+
TMS Pin = 14
46+
TXD Pin = 1
47+
)
48+
49+
// SPI pins
50+
const (
51+
SPI0_SCK_PIN = IO18
52+
SPI0_SDO_PIN = IO23
53+
SPI0_SDI_PIN = IO19
54+
SPI0_CS0_PIN = IO5
55+
)
56+
57+
// I2C pins
58+
const (
59+
SDA_PIN = IO21
60+
SCL_PIN = IO22
61+
)
62+
63+
// ADC pins
64+
const (
65+
ADC0 Pin = IO34
66+
ADC1 Pin = IO35
67+
ADC2 Pin = IO36
68+
ADC3 Pin = IO39
69+
)
70+
71+
// UART0 pins
72+
const (
73+
UART_TX_PIN = IO1
74+
UART_RX_PIN = IO3
75+
)
76+
77+
// UART1 pins
78+
const (
79+
UART1_TX_PIN = IO9
80+
UART1_RX_PIN = IO10
81+
)
82+
83+
// PWM pins
84+
const (
85+
PWM0_PIN Pin = IO2
86+
PWM1_PIN Pin = IO0
87+
PWM2_PIN Pin = IO4
88+
)

src/machine/board_esp32-wroom-32.go

Lines changed: 0 additions & 6 deletions
This file was deleted.

targets/esp32-coreboard-v2.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"inherits": ["esp32"],
3+
"build-tags": ["esp32_coreboard_v2"]
4+
}

targets/esp32-mini32.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"inherits": ["esp32-coreboard-v2"]
3+
}

targets/esp32-wroom-32.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)