github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/board_qtpy.go (about)

     1  //go:build sam && atsamd21 && qtpy
     2  
     3  package machine
     4  
     5  // used to reset into bootloader
     6  const resetMagicValue = 0xf01669ef
     7  
     8  // GPIO Pins
     9  const (
    10  	D0  = PA02 // PWM available
    11  	D1  = PA03
    12  	D2  = PA04 // PWM available
    13  	D3  = PA05 // PWM available
    14  	D4  = PA16 // PWM available
    15  	D5  = PA17 // PWM available
    16  	D6  = PA06
    17  	D7  = PA07
    18  	D8  = PA11
    19  	D9  = PA09
    20  	D10 = PA10
    21  	D11 = PA18
    22  	D12 = PA15
    23  	D13 = PA27
    24  	D14 = PA23
    25  	D15 = PA19
    26  	D16 = PA22
    27  	D17 = PA08
    28  )
    29  
    30  // Analog pins
    31  const (
    32  	A0 = D0
    33  	A1 = D1
    34  	A2 = D2
    35  	A3 = D3
    36  	A4 = D4
    37  )
    38  
    39  const (
    40  	NEOPIXELS       = D11
    41  	WS2812          = D11
    42  	NEOPIXELS_POWER = D12
    43  )
    44  
    45  // USBCDC pins
    46  const (
    47  	USBCDC_DM_PIN = PA24
    48  	USBCDC_DP_PIN = PA25
    49  )
    50  
    51  // UART1 pins
    52  const (
    53  	UART_TX_PIN = D6
    54  	UART_RX_PIN = D7
    55  )
    56  
    57  // UART1 on the QT Py M0.
    58  var UART1 = &sercomUSART0
    59  
    60  // SPI pins
    61  const (
    62  	SPI0_SCK_PIN = D8
    63  	SPI0_SDO_PIN = D10
    64  	SPI0_SDI_PIN = D9
    65  )
    66  
    67  // SPI on the QT Py M0.
    68  var SPI0 = sercomSPIM0
    69  
    70  // I2C pins
    71  const (
    72  	SDA_PIN = D4 // SDA
    73  	SCL_PIN = D5 // SCL
    74  )
    75  
    76  // I2C on the QT Py M0.
    77  var (
    78  	I2C0 = sercomI2CM1
    79  )
    80  
    81  // I2S pins
    82  const (
    83  	I2S_SCK_PIN = PA10
    84  	I2S_SD_PIN  = PA08
    85  	I2S_WS_PIN  = NoPin // TODO: figure out what this is on QT Py M0.
    86  )
    87  
    88  // USB CDC identifiers
    89  const (
    90  	usb_STRING_PRODUCT      = "Adafruit QTPy M0"
    91  	usb_STRING_MANUFACTURER = "Adafruit"
    92  )
    93  
    94  var (
    95  	usb_VID uint16 = 0x239A
    96  	usb_PID uint16 = 0x80CB
    97  )
    98  
    99  var (
   100  	DefaultUART = UART1
   101  )