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

     1  //go:build arduino_mkrwifi1010
     2  
     3  // This contains the pin mappings for the Arduino MKR WiFi 1010 board.
     4  //
     5  // For more information, see: https://store.arduino.cc/usa/mkr-wifi-1010
     6  package machine
     7  
     8  // used to reset into bootloader
     9  const resetMagicValue = 0x07738135
    10  
    11  // GPIO Pins
    12  const (
    13  	D0 Pin = PA22 // PWM available
    14  	D1 Pin = PA23 // PWM available
    15  	D2 Pin = PA10 // PWM available
    16  	D3 Pin = PA11 // PWM available
    17  	D4 Pin = PB10 // PWM available
    18  	D5 Pin = PB11 // PWM available
    19  
    20  	D6  Pin = PA20 // PWM available
    21  	D7  Pin = PA21 // PWM available
    22  	D8  Pin = PA16 // PWM available
    23  	D9  Pin = PA17
    24  	D10 Pin = PA19 // PWM available
    25  	D11 Pin = PA08 // SDA
    26  	D12 Pin = PA09 // PWM available, SCL
    27  	D13 Pin = PB23 // RX
    28  	D14 Pin = PB22 // TX
    29  
    30  	RX0 Pin = PB23 // UART1 RX
    31  	TX1 Pin = PB22 // UART1 TX
    32  )
    33  
    34  // Analog pins
    35  const (
    36  	A0 Pin = PA02 // ADC0/AIN[0]
    37  	A1 Pin = PB02 // AIN[10]
    38  	A2 Pin = PB03 // AIN[11]
    39  	A3 Pin = PA04 // AIN[04]
    40  	A4 Pin = PA05 // AIN[05]
    41  	A5 Pin = PA06 // AIN[06]
    42  	A6 Pin = PA07 // AIN[07]
    43  )
    44  
    45  const (
    46  	LED = D6
    47  )
    48  
    49  // USBCDC pins
    50  const (
    51  	USBCDC_DM_PIN Pin = PA24
    52  	USBCDC_DP_PIN Pin = PA25
    53  )
    54  
    55  // UART1 pins
    56  const (
    57  	UART_TX_PIN Pin = PB22
    58  	UART_RX_PIN Pin = PB23
    59  )
    60  
    61  // I2C pins
    62  const (
    63  	SDA_PIN Pin = D11 // SDA
    64  	SCL_PIN Pin = D12 // SCL
    65  )
    66  
    67  // SPI pins
    68  const (
    69  	SPI0_SCK_PIN Pin = D9  // SCK: S1
    70  	SPI0_SDO_PIN Pin = D8  // SDO: S1
    71  	SPI0_SDI_PIN Pin = D10 // SDI: S1
    72  )
    73  
    74  // I2S pins
    75  const (
    76  	I2S_SCK_PIN Pin = PA10
    77  	I2S_SD_PIN  Pin = PA07
    78  	I2S_WS_PIN      = NoPin // TODO: figure out what this is on Arduino MKR WiFi 1010.
    79  )
    80  
    81  // NINA-W102 Pins
    82  const (
    83  	NINA_SDO    Pin = PA12
    84  	NINA_SDI    Pin = PA13
    85  	NINA_CS     Pin = PA14
    86  	NINA_SCK    Pin = PA15
    87  	NINA_GPIO0  Pin = PA27
    88  	NINA_RESETN Pin = PB08
    89  	NINA_ACK    Pin = PA28
    90  	NINA_TX     Pin = PA22
    91  	NINA_RX     Pin = PA23
    92  )
    93  
    94  // UART on the Arduino MKR WiFi 1010.
    95  var UART1 = &sercomUSART5
    96  
    97  // I2C on the Arduino MKR WiFi 1010.
    98  var (
    99  	I2C0 = sercomI2CM2
   100  )
   101  
   102  // SPI on the Arduino MKR WiFi 1010.
   103  var (
   104  	SPI0 = sercomSPIM1
   105  
   106  	SPI1     = sercomSPIM4
   107  	NINA_SPI = SPI1
   108  )
   109  
   110  // USB CDC identifiers
   111  const (
   112  	usb_STRING_PRODUCT      = "Arduino MKR WiFi 1010"
   113  	usb_STRING_MANUFACTURER = "Arduino"
   114  )
   115  
   116  var (
   117  	usb_VID uint16 = 0x2341
   118  	usb_PID uint16 = 0x8054
   119  )
   120  
   121  var (
   122  	DefaultUART = UART1
   123  )