github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_feather-m0-express.go (about) 1 //go:build sam && atsamd21 && feather_m0_express 2 3 package machine 4 5 // used to reset into bootloader 6 const resetMagicValue = 0xf01669ef 7 8 // GPIO Pins 9 const ( 10 D0 = PA11 // UART0 RX 11 D1 = PA10 // UART0 TX 12 D2 = NoPin // does not seem to exist 13 D3 = NoPin // does not seem to exist 14 D4 = NoPin // does not seem to exist 15 D5 = PA15 16 D6 = PA20 17 D7 = NoPin // does not seem to exist 18 D8 = PA06 // NEOPIXEL 19 D9 = PA07 20 D10 = PA18 21 D11 = PA16 22 D12 = PA19 23 D13 = PA17 24 ) 25 26 // Analog pins 27 const ( 28 A0 = PA02 // ADC/AIN[0] 29 A1 = PB08 // ADC/AIN[2] 30 A2 = PB09 // ADC/AIN[3] 31 A3 = PA04 // ADC/AIN[4] 32 A4 = PA05 // ADC/AIN[5] 33 A5 = PB02 // ADC/AIN[10] 34 ) 35 36 const ( 37 LED = D13 38 NEOPIXEL = D8 39 ) 40 41 // USBCDC pins 42 const ( 43 USBCDC_DM_PIN = PA24 44 USBCDC_DP_PIN = PA25 45 ) 46 47 // UART1 pins 48 const ( 49 UART_TX_PIN = D1 50 UART_RX_PIN = D0 51 52 UART1_TX_PIN = D10 53 UART1_RX_PIN = D12 54 ) 55 56 // UART0 on the Feather M0 Express. 57 var UART0 = &sercomUSART0 58 var UART1 = &sercomUSART1 59 60 // I2C pins 61 const ( 62 SDA_PIN = PA22 // SDA: SERCOM3/PAD[0] 63 SCL_PIN = PA23 // SCL: SERCOM3/PAD[1] 64 ) 65 66 // I2C on the Feather M0 Express. 67 var ( 68 I2C0 = sercomI2CM3 69 ) 70 71 // SPI pins 72 const ( 73 SPI0_SCK_PIN = PB11 // SCK: SERCOM4/PAD[3] 74 SPI0_SDO_PIN = PB10 // SDO: SERCOM4/PAD[2] 75 SPI0_SDI_PIN = PA12 // SDI: SERCOM4/PAD[0] 76 ) 77 78 // SPI on the Feather M0. 79 var SPI0 = sercomSPIM4 80 81 // I2S pins 82 const ( 83 I2S_SCK_PIN = PA10 84 I2S_SD_PIN = PA07 85 I2S_WS_PIN = NoPin // TODO: figure out what this is on Feather M0 Express. 86 ) 87 88 // USB CDC identifiers 89 const ( 90 usb_STRING_PRODUCT = "Adafruit Feather M0 Express" 91 usb_STRING_MANUFACTURER = "Adafruit" 92 ) 93 94 var ( 95 usb_VID uint16 = 0x239A 96 usb_PID uint16 = 0x801B 97 ) 98 99 var ( 100 DefaultUART = UART0 101 )