aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/board_nano-33-ble.go
blob: 911be0add57c37008f1f4a506cccc59176c9e8be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//go:build nano_33_ble

// This contains the pin mappings for the Arduino Nano 33 BLE [Sense] boards.
// - https://store.arduino.cc/arduino-nano-33-ble
// - https://store.arduino.cc/arduino-nano-33-ble-sense
//
// ----------------------------------------------------------------------------
// Flashing
//
// Special version of bossac is required.
// This executable can be obtained two ways:
//  1. In Arduino IDE, install support for the board ("Arduino Mbed OS Nano Boards")
//     Search for "tools/bossac/1.9.1-arduino2/bossac" in Arduino IDEs directory
//  2. Download https://downloads.arduino.cc/packages/package_index.json
//     Search for "bossac-1.9.1-arduino2" in that file
//     Download tarball for your OS and unpack it
//
// Once you have the executable, make it accessible in your PATH as "bossac_arduino2".
//
// It is possible to replace original bossac with this new one (this only adds support for nrf chip).
// In that case make "bossac_arduino2" symlink on it, for the board target to be able to find it.
//
// ----------------------------------------------------------------------------
// Bluetooth
//
// SoftDevice (s140v7) must be flashed first to enable use of bluetooth on this board.
// See https://github.com/tinygo-org/bluetooth
//
// SoftDevice overwrites original bootloader and flashing method described above is not avalable anymore.
// Instead, please use debug probe and flash your code with "nano-33-ble-s140v7" target.
package machine

const HasLowFrequencyCrystal = true

// Digital Pins
const (
	D2  Pin = P1_11
	D3  Pin = P1_12
	D4  Pin = P1_15
	D5  Pin = P1_13
	D6  Pin = P1_14
	D7  Pin = P0_23
	D8  Pin = P0_21
	D9  Pin = P0_27
	D10 Pin = P1_02
	D11 Pin = P1_01
	D12 Pin = P1_08
	D13 Pin = P0_13
)

// Analog pins
const (
	A0 Pin = P0_04
	A1 Pin = P0_05
	A2 Pin = P0_30
	A3 Pin = P0_29
	A4 Pin = P0_31
	A5 Pin = P0_02
	A6 Pin = P0_28
	A7 Pin = P0_03
)

// Onboard LEDs
const (
	LED         = LED_BUILTIN
	LED1        = LED_RED
	LED2        = LED_GREEN
	LED3        = LED_BLUE
	LED_BUILTIN = P0_13
	LED_RED     = P0_24
	LED_GREEN   = P0_16
	LED_BLUE    = P0_06
	LED_PWR     = P1_09
)

// UART0 pins
const (
	UART_RX_PIN = P1_10
	UART_TX_PIN = P1_03
)

// I2C pins
const (
	// Defaults to internal
	SDA_PIN = SDA1_PIN
	SCL_PIN = SCL1_PIN

	// I2C0 (external) pins
	SDA0_PIN = P0_31
	SCL0_PIN = P0_02

	// I2C1 (internal) pins
	SDA1_PIN = P0_14
	SCL1_PIN = P0_15

	I2C_PULLUP = P1_00 // Set high for I2C to work
)

// SPI pins
const (
	SPI0_SCK_PIN = P0_13
	SPI0_SDO_PIN = P1_01
	SPI0_SDI_PIN = P1_08
)

// Peripherals
const (
	APDS_INT = P0_19 // Proximity (APDS9960) interrupt pin

	LSM_PWR = P0_22 // IMU (LSM9DS1) power
	LPS_PWR = P0_22 // Pressure (LPS22HB) power
	HTS_PWR = P0_22 // Humidity (HTS221) power

	MIC_PWR = P0_17 // Microphone (MP34DT06JTR) power
	MIC_CLK = P0_26
	MIC_DIN = P0_25
)

// USB CDC identifiers
const (
	usb_STRING_PRODUCT      = "Nano 33 BLE"
	usb_STRING_MANUFACTURER = "Arduino"
)

var (
	usb_VID uint16 = 0x2341
	usb_PID uint16 = 0x805a
)