github.com/aykevl/tinygo@v0.5.0/src/machine/board_itsybitsy-m0.go (about) 1 // +build sam,atsamd21,itsybitsy_m0 2 3 package machine 4 5 import "device/sam" 6 7 // GPIO Pins 8 const ( 9 D0 = PA11 // UART0 RX 10 D1 = PA10 // UART0 TX 11 D2 = PA14 12 D3 = PA09 // PWM available 13 D4 = PA08 // PWM available 14 D5 = PA15 // PWM available 15 D6 = PA20 // PWM available 16 D7 = PA21 // PWM available 17 D8 = PA06 // PWM available 18 D9 = PA07 // PWM available 19 D10 = PA18 // can be used for PWM or UART1 TX 20 D11 = PA16 // can be used for PWM or UART1 RX 21 D12 = PA19 // PWM available 22 D13 = PA17 // PWM available 23 ) 24 25 // Analog pins 26 const ( 27 A0 = PA02 // ADC/AIN[0] 28 A1 = PB08 // ADC/AIN[2] 29 A2 = PB09 // ADC/AIN[3] 30 A3 = PA04 // ADC/AIN[4] 31 A4 = PA05 // ADC/AIN[5] 32 A5 = PB02 // ADC/AIN[10] 33 ) 34 35 const ( 36 LED = D13 37 ) 38 39 // UART0 aka USBCDC pins 40 const ( 41 USBCDC_DM_PIN = PA24 42 USBCDC_DP_PIN = PA25 43 ) 44 45 // UART1 pins 46 const ( 47 UART_TX_PIN = D10 48 UART_RX_PIN = D11 49 ) 50 51 // I2C pins 52 const ( 53 SDA_PIN = PA22 // SDA: SERCOM3/PAD[0] 54 SCL_PIN = PA23 // SCL: SERCOM3/PAD[1] 55 ) 56 57 // I2C on the ItsyBitsy M0. 58 var ( 59 I2C0 = I2C{Bus: sam.SERCOM3_I2CM, 60 SDA: SDA_PIN, 61 SCL: SCL_PIN, 62 PinMode: GPIO_SERCOM} 63 ) 64 65 // SPI pins 66 const ( 67 SPI0_SCK_PIN = PB11 // SCK: SERCOM4/PAD[3] 68 SPI0_MOSI_PIN = PB10 // MOSI: SERCOM4/PAD[2] 69 SPI0_MISO_PIN = PA12 // MISO: SERCOM4/PAD[0] 70 ) 71 72 // SPI on the ItsyBitsy M0. 73 var ( 74 SPI0 = SPI{Bus: sam.SERCOM4_SPI} 75 )