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

     1  //go:build nano_33_ble
     2  
     3  // This contains the pin mappings for the Arduino Nano 33 BLE [Sense] boards.
     4  // - https://store.arduino.cc/arduino-nano-33-ble
     5  // - https://store.arduino.cc/arduino-nano-33-ble-sense
     6  //
     7  // ----------------------------------------------------------------------------
     8  // Flashing
     9  //
    10  // Special version of bossac is required.
    11  // This executable can be obtained two ways:
    12  //  1. In Arduino IDE, install support for the board ("Arduino Mbed OS Nano Boards")
    13  //     Search for "tools/bossac/1.9.1-arduino2/bossac" in Arduino IDEs directory
    14  //  2. Download https://downloads.arduino.cc/packages/package_index.json
    15  //     Search for "bossac-1.9.1-arduino2" in that file
    16  //     Download tarball for your OS and unpack it
    17  //
    18  // Once you have the executable, make it accessible in your PATH as "bossac_arduino2".
    19  //
    20  // It is possible to replace original bossac with this new one (this only adds support for nrf chip).
    21  // In that case make "bossac_arduino2" symlink on it, for the board target to be able to find it.
    22  //
    23  // ----------------------------------------------------------------------------
    24  // Bluetooth
    25  //
    26  // SoftDevice (s140v7) must be flashed first to enable use of bluetooth on this board.
    27  // See https://github.com/tinygo-org/bluetooth
    28  //
    29  // SoftDevice overwrites original bootloader and flashing method described above is not avalable anymore.
    30  // Instead, please use debug probe and flash your code with "nano-33-ble-s140v7" target.
    31  package machine
    32  
    33  const HasLowFrequencyCrystal = true
    34  
    35  // Digital Pins
    36  const (
    37  	D2  Pin = P1_11
    38  	D3  Pin = P1_12
    39  	D4  Pin = P1_15
    40  	D5  Pin = P1_13
    41  	D6  Pin = P1_14
    42  	D7  Pin = P0_23
    43  	D8  Pin = P0_21
    44  	D9  Pin = P0_27
    45  	D10 Pin = P1_02
    46  	D11 Pin = P1_01
    47  	D12 Pin = P1_08
    48  	D13 Pin = P0_13
    49  )
    50  
    51  // Analog pins
    52  const (
    53  	A0 Pin = P0_04
    54  	A1 Pin = P0_05
    55  	A2 Pin = P0_30
    56  	A3 Pin = P0_29
    57  	A4 Pin = P0_31
    58  	A5 Pin = P0_02
    59  	A6 Pin = P0_28
    60  	A7 Pin = P0_03
    61  )
    62  
    63  // Onboard LEDs
    64  const (
    65  	LED         = LED_BUILTIN
    66  	LED1        = LED_RED
    67  	LED2        = LED_GREEN
    68  	LED3        = LED_BLUE
    69  	LED_BUILTIN = P0_13
    70  	LED_RED     = P0_24
    71  	LED_GREEN   = P0_16
    72  	LED_BLUE    = P0_06
    73  	LED_PWR     = P1_09
    74  )
    75  
    76  // UART0 pins
    77  const (
    78  	UART_RX_PIN = P1_10
    79  	UART_TX_PIN = P1_03
    80  )
    81  
    82  // I2C pins
    83  const (
    84  	// Defaults to internal
    85  	SDA_PIN = SDA1_PIN
    86  	SCL_PIN = SCL1_PIN
    87  
    88  	// I2C0 (external) pins
    89  	SDA0_PIN = P0_31
    90  	SCL0_PIN = P0_02
    91  
    92  	// I2C1 (internal) pins
    93  	SDA1_PIN = P0_14
    94  	SCL1_PIN = P0_15
    95  
    96  	I2C_PULLUP = P1_00 // Set high for I2C to work
    97  )
    98  
    99  // SPI pins
   100  const (
   101  	SPI0_SCK_PIN = P0_13
   102  	SPI0_SDO_PIN = P1_01
   103  	SPI0_SDI_PIN = P1_08
   104  )
   105  
   106  // Peripherals
   107  const (
   108  	APDS_INT = P0_19 // Proximity (APDS9960) interrupt pin
   109  
   110  	LSM_PWR = P0_22 // IMU (LSM9DS1) power
   111  	LPS_PWR = P0_22 // Pressure (LPS22HB) power
   112  	HTS_PWR = P0_22 // Humidity (HTS221) power
   113  
   114  	MIC_PWR = P0_17 // Microphone (MP34DT06JTR) power
   115  	MIC_CLK = P0_26
   116  	MIC_DIN = P0_25
   117  )
   118  
   119  // USB CDC identifiers
   120  const (
   121  	usb_STRING_PRODUCT      = "Nano 33 BLE"
   122  	usb_STRING_MANUFACTURER = "Arduino"
   123  )
   124  
   125  var (
   126  	usb_VID uint16 = 0x2341
   127  	usb_PID uint16 = 0x805a
   128  )