github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_thumby.go (about) 1 //go:build thumby 2 3 // This contains the pin mappings for the Thumby. 4 // 5 // https://thumby.us/ 6 package machine 7 8 const ( 9 THUMBY_SCK_PIN = I2C1_SDA_PIN 10 THUMBY_SDA_PIN = I2C1_SCL_PIN 11 12 THUMBY_CS_PIN = GPIO16 13 THUMBY_DC_PIN = GPIO17 14 THUMBY_RESET_PIN = GPIO20 15 16 THUMBY_LINK_TX_PIN = UART0_TX_PIN 17 THUMBY_LINK_RX_PIN = UART0_RX_PIN 18 THUMBY_LINK_PU_PIN = GPIO2 19 20 THUMBY_BTN_LDPAD_PIN = GPIO3 21 THUMBY_BTN_RDPAD_PIN = GPIO5 22 THUMBY_BTN_UDPAD_PIN = GPIO4 23 THUMBY_BTN_DDPAD_PIN = GPIO6 24 THUMBY_BTN_B_PIN = GPIO24 25 THUMBY_BTN_A_PIN = GPIO27 26 27 THUMBY_AUDIO_PIN = GPIO28 28 29 THUMBY_SCREEN_RESET_PIN = GPIO20 30 ) 31 32 // I2C pins 33 const ( 34 I2C0_SDA_PIN Pin = NoPin 35 I2C0_SCL_PIN Pin = NoPin 36 37 I2C1_SDA_PIN Pin = GPIO18 38 I2C1_SCL_PIN Pin = GPIO19 39 ) 40 41 // SPI pins 42 const ( 43 SPI0_SCK_PIN = GPIO18 44 SPI0_SDO_PIN = GPIO19 45 SPI0_SDI_PIN = GPIO16 46 47 SPI1_SCK_PIN = NoPin 48 SPI1_SDO_PIN = NoPin 49 SPI1_SDI_PIN = NoPin 50 ) 51 52 // Onboard crystal oscillator frequency, in MHz. 53 const ( 54 xoscFreq = 12 // MHz 55 ) 56 57 // USB CDC identifiers 58 const ( 59 usb_STRING_PRODUCT = "Thumby" 60 usb_STRING_MANUFACTURER = "TinyCircuits" 61 ) 62 63 var ( 64 usb_VID uint16 = 0x2E8A 65 usb_PID uint16 = 0x0005 66 ) 67 68 // UART pins 69 const ( 70 UART0_TX_PIN = GPIO0 71 UART0_RX_PIN = GPIO1 72 UART_TX_PIN = UART0_TX_PIN 73 UART_RX_PIN = UART0_RX_PIN 74 ) 75 76 var DefaultUART = UART0