github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_gopher-badge.go (about) 1 //go:build gopher_badge 2 3 // This contains the pin mappings for the Gopher Badge. 4 // 5 // For more information, see: https://gopherbadge.com/ 6 package machine 7 8 const ( 9 /*ADC0 Pin = GPIO26 10 ADC1 Pin = GPIO27 11 ADC2 Pin = GPIO28 12 GPIO4 Pin = GPIO4 13 GPIO5 Pin = GPIO5 14 GPIO6 Pin = GPIO6 15 GPIO7 Pin = GPIO7 16 GPIO8 Pin = GPIO8 17 GPIO9 Pin = GPIO9*/ 18 19 PENIRQ Pin = GPIO13 20 21 LED Pin = GPIO2 22 NEOPIXELS Pin = GPIO15 23 WS2812 Pin = GPIO15 24 25 BUTTON_A Pin = GPIO10 26 BUTTON_B Pin = GPIO11 27 BUTTON_LEFT Pin = GPIO25 28 BUTTON_UP Pin = GPIO24 29 BUTTON_RIGHT Pin = GPIO22 30 BUTTON_DOWN Pin = GPIO23 31 32 TFT_RST Pin = GPIO21 33 TFT_SDI Pin = GPIO19 34 TFT_SDO Pin = GPIO16 35 TFT_CS Pin = GPIO17 36 TFT_SCL Pin = GPIO18 37 TFT_WRX Pin = GPIO20 38 TFT_BACKLIGHT Pin = GPIO12 39 40 SPEAKER Pin = GPIO14 41 SPEAKER_ENABLE Pin = GPIO3 42 ) 43 44 // I2C pins 45 const ( 46 I2C0_SDA_PIN Pin = GPIO0 47 I2C0_SCL_PIN Pin = GPIO1 48 49 I2C1_SDA_PIN Pin = NoPin 50 I2C1_SCL_PIN Pin = NoPin 51 ) 52 53 // SPI pins. 54 const ( 55 SPI0_SCK_PIN Pin = GPIO18 56 SPI0_SDO_PIN Pin = GPIO19 57 SPI0_SDI_PIN Pin = GPIO16 58 59 SPI1_SCK_PIN Pin = NoPin 60 SPI1_SDO_PIN Pin = NoPin 61 SPI1_SDI_PIN Pin = NoPin 62 ) 63 64 // Onboard crystal oscillator frequency, in MHz. 65 const ( 66 xoscFreq = 12 // MHz 67 ) 68 69 // USB CDC identifiers 70 const ( 71 usb_STRING_PRODUCT = "Gopher Badge" 72 usb_STRING_MANUFACTURER = "TinyGo" 73 ) 74 75 var ( 76 usb_VID uint16 = 0x2e8a 77 usb_PID uint16 = 0x0003 78 ) 79 80 // UART pins 81 const ( 82 UART0_TX_PIN = GPIO0 83 UART0_RX_PIN = GPIO1 84 UART1_TX_PIN = GPIO4 85 UART1_RX_PIN = GPIO5 86 UART_TX_PIN = UART0_TX_PIN 87 UART_RX_PIN = UART0_RX_PIN 88 ) 89 90 var DefaultUART = UART1