github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_challenger_rp2040.go (about) 1 //go:build challenger_rp2040 2 3 package machine 4 5 const ( 6 LED = GPIO24 7 8 // Onboard crystal oscillator frequency, in MHz. 9 xoscFreq = 12 // MHz 10 ) 11 12 // GPIO Pins 13 const ( 14 D5 = GPIO2 15 D6 = GPIO3 16 D9 = GPIO4 17 D10 = GPIO5 18 D11 = GPIO6 19 D12 = GPIO7 20 D13 = GPIO8 21 ) 22 23 // Analog pins 24 const ( 25 A0 = ADC0 26 A1 = ADC1 27 A2 = ADC2 28 A3 = ADC3 29 ) 30 31 // I2C Pins. 32 const ( 33 I2C0_SDA_PIN = GPIO24 34 I2C0_SCL_PIN = GPIO25 35 36 I2C1_SDA_PIN = GPIO2 37 I2C1_SCL_PIN = GPIO3 38 39 SDA_PIN = I2C1_SDA_PIN 40 SCL_PIN = I2C1_SCL_PIN 41 ) 42 43 // SPI default pins 44 const ( 45 // Default Serial Clock Bus 0 for SPI communications 46 SPI0_SCK_PIN = GPIO22 47 // Default Serial Out Bus 0 for SPI communications 48 SPI0_SDO_PIN = GPIO23 // Tx 49 // Default Serial In Bus 0 for SPI communications 50 SPI0_SDI_PIN = GPIO20 // Rx 51 52 // Default Serial Clock Bus 1 for SPI communications 53 SPI1_SCK_PIN = GPIO10 54 // Default Serial Out Bus 1 for SPI communications 55 SPI1_SDO_PIN = GPIO11 // Tx 56 // Default Serial In Bus 1 for SPI communications 57 SPI1_SDI_PIN = GPIO12 // Rx 58 ) 59 60 // LoRa default pins 61 const ( 62 LORA_CS = GPIO9 63 LORA_SCK = GPIO10 64 LORA_SDO = GPIO11 65 LORA_SDI = GPIO12 66 LORA_RESET = GPIO13 67 LORA_DIO0 = GPIO14 68 LORA_DIO1 = GPIO15 69 LORA_DIO2 = GPIO18 70 ) 71 72 // UART pins 73 const ( 74 UART0_TX_PIN = GPIO16 75 UART0_RX_PIN = GPIO17 76 UART1_TX_PIN = GPIO4 77 UART1_RX_PIN = GPIO5 78 UART_TX_PIN = UART0_TX_PIN 79 UART_RX_PIN = UART0_RX_PIN 80 ) 81 82 var DefaultUART = UART0 83 84 // USB identifiers 85 const ( 86 usb_STRING_PRODUCT = "Challenger 2040 LoRa" 87 usb_STRING_MANUFACTURER = "iLabs" 88 ) 89 90 var ( 91 usb_VID uint16 = 0x2e8a 92 usb_PID uint16 = 0x1023 93 )