github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_feather_rp2040.go (about) 1 //go:build feather_rp2040 2 3 package machine 4 5 // Onboard crystal oscillator frequency, in MHz. 6 const xoscFreq = 12 // MHz 7 8 // GPIO Pins 9 const ( 10 D4 = GPIO6 11 D5 = GPIO7 12 D6 = GPIO8 13 D9 = GPIO9 14 D10 = GPIO10 15 D11 = GPIO11 16 D12 = GPIO12 17 D13 = GPIO13 18 D24 = GPIO24 19 D25 = GPIO25 20 ) 21 22 // Analog pins 23 const ( 24 A0 = GPIO26 25 A1 = GPIO27 26 A2 = GPIO28 27 A3 = GPIO29 28 ) 29 30 const LED = GPIO13 31 32 // I2C Pins. 33 const ( 34 I2C0_SDA_PIN = GPIO24 35 I2C0_SCL_PIN = GPIO25 36 37 I2C1_SDA_PIN = GPIO2 38 I2C1_SCL_PIN = GPIO3 39 40 SDA_PIN = I2C1_SDA_PIN 41 SCL_PIN = I2C1_SCL_PIN 42 ) 43 44 // SPI default pins 45 const ( 46 // Default Serial Clock Bus 0 for SPI communications 47 SPI0_SCK_PIN = GPIO18 48 // Default Serial Out Bus 0 for SPI communications 49 SPI0_SDO_PIN = GPIO19 // Tx 50 // Default Serial In Bus 0 for SPI communications 51 SPI0_SDI_PIN = GPIO20 // Rx 52 53 // Default Serial Clock Bus 1 for SPI communications 54 SPI1_SCK_PIN = GPIO10 55 // Default Serial Out Bus 1 for SPI communications 56 SPI1_SDO_PIN = GPIO11 // Tx 57 // Default Serial In Bus 1 for SPI communications 58 SPI1_SDI_PIN = GPIO12 // Rx 59 ) 60 61 // UART pins 62 const ( 63 UART0_TX_PIN = GPIO0 64 UART0_RX_PIN = GPIO1 65 UART1_TX_PIN = GPIO8 66 UART1_RX_PIN = GPIO9 67 UART_TX_PIN = UART0_TX_PIN 68 UART_RX_PIN = UART0_RX_PIN 69 ) 70 71 var DefaultUART = UART0 72 73 // USB identifiers 74 const ( 75 usb_STRING_PRODUCT = "Feather RP2040" 76 usb_STRING_MANUFACTURER = "Adafruit" 77 ) 78 79 var ( 80 usb_VID uint16 = 0x239A 81 usb_PID uint16 = 0x80F1 82 )