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

     1  //go:build xiao_ble
     2  
     3  // This file contains the pin mappings for the Seeed XIAO BLE nRF52840 [Sense] boards.
     4  //
     5  // Seeed XIAO BLE is an ultra-small size, ultra-low power Bluetooth development board based on the Nordic nRF52840.
     6  // It features an onboard Bluetooth antenna, onboard battery charging chip, and 21*17.5mm thumb size, which makes it ideal for IoT projects.
     7  //
     8  // Seeed XIAO BLE nRF52840 Sense is a tiny Bluetooth LE development board designed for IoT and AI applications.
     9  // It features an onboard antenna, 6 Dof IMU, microphone, all of which make it an ideal board to run AI using TinyML and TensorFlow Lite.
    10  //
    11  // SoftDevice (s140v7) is pre-flashed on this board already.
    12  // See https://github.com/tinygo-org/bluetooth
    13  //
    14  // - https://www.seeedstudio.com/Seeed-XIAO-BLE-nRF52840-p-5201.html
    15  // - https://www.seeedstudio.com/Seeed-XIAO-BLE-Sense-nRF52840-p-5253.html
    16  //
    17  // - https://wiki.seeedstudio.com/XIAO_BLE/
    18  // - https://github.com/Seeed-Studio/ArduinoCore-mbed/tree/master/variants/SEEED_XIAO_NRF52840_SENSE
    19  package machine
    20  
    21  const HasLowFrequencyCrystal = true
    22  
    23  // Digital Pins
    24  const (
    25  	D0  Pin = P0_02
    26  	D1  Pin = P0_03
    27  	D2  Pin = P0_28
    28  	D3  Pin = P0_29
    29  	D4  Pin = P0_04
    30  	D5  Pin = P0_05
    31  	D6  Pin = P1_11
    32  	D7  Pin = P1_12
    33  	D8  Pin = P1_13
    34  	D9  Pin = P1_14
    35  	D10 Pin = P1_15
    36  )
    37  
    38  // Analog pins
    39  const (
    40  	A0 Pin = P0_02
    41  	A1 Pin = P0_03
    42  	A2 Pin = P0_28
    43  	A3 Pin = P0_29
    44  	A4 Pin = P0_04
    45  	A5 Pin = P0_05
    46  )
    47  
    48  // Onboard LEDs
    49  const (
    50  	LED       = LED_CHG
    51  	LED1      = LED_RED
    52  	LED2      = LED_GREEN
    53  	LED3      = LED_BLUE
    54  	LED_CHG   = P0_17
    55  	LED_RED   = P0_26
    56  	LED_GREEN = P0_30
    57  	LED_BLUE  = P0_06
    58  )
    59  
    60  // UART0 pins
    61  const (
    62  	UART_RX_PIN = P1_12
    63  	UART_TX_PIN = P1_11
    64  )
    65  
    66  // I2C pins
    67  const (
    68  	// Defaults to internal
    69  	SDA_PIN = SDA1_PIN
    70  	SCL_PIN = SCL1_PIN
    71  
    72  	// I2C0 (external) pins
    73  	SDA0_PIN = P0_04
    74  	SCL0_PIN = P0_05
    75  
    76  	// I2C1 (internal) pins
    77  	SDA1_PIN = P0_07
    78  	SCL1_PIN = P0_27
    79  )
    80  
    81  // SPI pins
    82  const (
    83  	SPI0_SCK_PIN = P1_13
    84  	SPI0_SDO_PIN = P1_14
    85  	SPI0_SDI_PIN = P1_15
    86  )
    87  
    88  // Peripherals
    89  const (
    90  	LSM_PWR = P1_08 // IMU (LSM6DS3TR) power
    91  	LSM_INT = P0_11 // IMU (LSM6DS3TR) interrupt
    92  
    93  	MIC_PWR = P1_10 // Microphone (MSM261D3526H1CPM) power
    94  	MIC_CLK = P1_00
    95  	MIC_DIN = P0_16
    96  )
    97  
    98  // USB CDC identifiers
    99  const (
   100  	usb_STRING_PRODUCT      = "XIAO nRF52840 Sense"
   101  	usb_STRING_MANUFACTURER = "Seeed"
   102  )
   103  
   104  var (
   105  	usb_VID uint16 = 0x2886
   106  	usb_PID uint16 = 0x8045
   107  )
   108  
   109  var (
   110  	DefaultUART = UART0
   111  )