Browse Source

esp8266: provide hardware pin constants like GPIO2

pull/2995/head
Ayke van Laethem 2 years ago
committed by Ron Evans
parent
commit
153ff09cc5
  1. 18
      src/machine/board_nodemcu.go
  2. 21
      src/machine/machine_esp8266.go

18
src/machine/board_nodemcu.go

@ -7,15 +7,15 @@ package machine
// GPIO pins on the NodeMCU board. // GPIO pins on the NodeMCU board.
const ( const (
D0 Pin = 16 D0 = GPIO16
D1 Pin = 5 D1 = GPIO5
D2 Pin = 4 D2 = GPIO4
D3 Pin = 0 D3 = GPIO0
D4 Pin = 2 D4 = GPIO2
D5 Pin = 14 D5 = GPIO14
D6 Pin = 12 D6 = GPIO12
D7 Pin = 13 D7 = GPIO13
D8 Pin = 15 D8 = GPIO15
) )
// Onboard blue LED (on the AI-Thinker module). // Onboard blue LED (on the AI-Thinker module).

21
src/machine/machine_esp8266.go

@ -19,6 +19,27 @@ const (
PinInput PinInput
) )
// Hardware pin numbers
const (
GPIO0 Pin = iota
GPIO1
GPIO2
GPIO3
GPIO4
GPIO5
GPIO6
GPIO7
GPIO8
GPIO9
GPIO10
GPIO11
GPIO12
GPIO13
GPIO14
GPIO15
GPIO16
)
// Pins that are fixed by the chip. // Pins that are fixed by the chip.
const ( const (
UART_TX_PIN Pin = 1 UART_TX_PIN Pin = 1

Loading…
Cancel
Save