github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_feather-m4.go (about) 1 //go:build feather_m4 2 3 package machine 4 5 // used to reset into bootloader 6 const resetMagicValue = 0xf01669ef 7 8 // GPIO Pins 9 const ( 10 D0 = PB17 // UART0 RX/PWM available 11 D1 = PB16 // UART0 TX/PWM available 12 D4 = PA14 // PWM available 13 D5 = PA16 // PWM available 14 D6 = PA18 // PWM available 15 D8 = PB03 // built-in neopixel 16 D9 = PA19 // PWM available 17 D10 = PA20 // can be used for PWM or UART1 TX 18 D11 = PA21 // can be used for PWM or UART1 RX 19 D12 = PA22 // PWM available 20 D13 = PA23 // PWM available 21 D21 = PA13 // PWM available 22 D22 = PA12 // PWM available 23 D23 = PB22 // PWM available 24 D24 = PB23 // PWM available 25 D25 = PA17 // PWM available 26 ) 27 28 // Analog pins 29 const ( 30 A0 = PA02 // ADC/AIN[0] 31 A1 = PA05 // ADC/AIN[2] 32 A2 = PB08 // ADC/AIN[3] 33 A3 = PB09 // ADC/AIN[4] 34 A4 = PA04 // ADC/AIN[5] 35 A5 = PA06 // ADC/AIN[10] 36 ) 37 38 const ( 39 LED = D13 40 WS2812 = D8 41 ) 42 43 // USBCDC pins 44 const ( 45 USBCDC_DM_PIN = PA24 46 USBCDC_DP_PIN = PA25 47 ) 48 49 const ( 50 UART_TX_PIN = D1 51 UART_RX_PIN = D0 52 ) 53 54 const ( 55 UART2_TX_PIN = A4 56 UART2_RX_PIN = A5 57 ) 58 59 var ( 60 UART1 = &sercomUSART5 61 UART2 = &sercomUSART0 62 63 DefaultUART = UART1 64 ) 65 66 // I2C pins 67 const ( 68 SDA_PIN = D22 // SDA: SERCOM2/PAD[0] 69 SCL_PIN = D21 // SCL: SERCOM2/PAD[1] 70 ) 71 72 // I2C on the Feather M4. 73 var ( 74 I2C0 = sercomI2CM2 75 ) 76 77 // SPI pins 78 const ( 79 SPI0_SCK_PIN = D25 // SCK: SERCOM1/PAD[1] 80 SPI0_SDO_PIN = D24 // SDO: SERCOM1/PAD[3] 81 SPI0_SDI_PIN = D23 // SDI: SERCOM1/PAD[2] 82 ) 83 84 // SPI on the Feather M4. 85 var SPI0 = sercomSPIM1 86 87 // USB CDC identifiers 88 const ( 89 usb_STRING_PRODUCT = "Adafruit Feather M4" 90 usb_STRING_MANUFACTURER = "Adafruit" 91 ) 92 93 var ( 94 usb_VID uint16 = 0x239A 95 usb_PID uint16 = 0x8022 96 )