arduino_nano_connect/lib.rs
1#![no_std]
2
3pub extern crate rp2040_hal as hal;
4
5#[cfg(feature = "rt")]
6pub use rp2040_hal::entry;
7
8/// The linker will place this boot block at the start of our program image. We
9/// need this to help the ROM bootloader get our code up and running.
10///
11/// According to [the Arduino store]
12/// the board should contain a AT25SF128A flash chip. But
13/// there are [reports] of board with different flash chips,
14/// where the boot loader BOOT_LOADER_AT25SF128A does not
15/// work.
16///
17/// Therefore, the generic boot loader is used by default. For a specific
18/// board, the flash performance can be increased by switching to the
19/// matching boot loader.
20///
21/// [the Arduino store]: https://store.arduino.cc/products/arduino-nano-rp2040-connect
22/// [reports]: https://github.com/rp-rs/rp-hal/issues/503
23///
24#[cfg(feature = "boot2")]
25#[link_section = ".boot2"]
26#[no_mangle]
27#[used]
28pub static BOOT2_FIRMWARE: [u8; 256] = rp2040_boot2::BOOT_LOADER_GENERIC_03H;
29// pub static BOOT2_FIRMWARE: [u8; 256] = rp2040_boot2::BOOT_LOADER_AT25SF128A;
30
31pub use hal::pac;
32
33// borrowed some pin defs from rp-pico from a dicussion on the bsp_pins! macro
34// stripped out functions from connected lines that are no available through
35// any of the header pins
36hal::bsp_pins!(
37 /// GPIO 0 supports following functions:
38 /// | Default | UART0 TX (arduino nano connect)
39 /// | Function | Alias with applied function |
40 /// |--------------|-----------------------------|
41 /// | `SPI0 RX` | [crate::Gp0Spi0Rx] |
42 /// | `UART0 TX` | [crate::Gp0Uart0Tx] |
43 /// | `I2C0 SDA` | [crate::Gp0I2C0Sda] |
44 /// | `PWM0 A` | [crate::Gp0Pwm0A] |
45 /// | `PIO0` | [crate::Gp0Pio0] |
46 /// | `PIO1` | [crate::Gp0Pio1] |
47 Gpio0 {
48 name: tx,
49 aliases:
50 {
51 /// UART Function alias for pin [crate::Pins::gpio0].
52 FunctionUart, PullNone: Gp0Uart0Tx
53 }
54 },
55
56 /// GPIO 1 supports following functions:
57 /// | Default | UART0 RX (arduino nano connect)
58 /// | Function | Alias with applied function |
59 /// |--------------|-----------------------------|
60 /// | `SPI0 CSn` | [crate::Gp1Spi0Csn] |
61 /// | `UART0 RX` | [crate::Gp1Uart0Rx] |
62 /// | `I2C0 SCL` | [crate::Gp1I2C0Scl] |
63 /// | `PWM0 B` | [crate::Gp1Pwm0B] |
64 /// | `PIO0` | [crate::Gp1Pio0] |
65 /// | `PIO1` | [crate::Gp1Pio1] |
66 Gpio1 {
67 name: rx,
68 aliases: {
69 /// UART Function alias for pin [crate::Pins::gpio1].
70 FunctionUart, PullNone: Gp1Uart0Rx
71 }
72 },
73
74 /// GPIO 2 supports following functions:
75 /// | Default | GPIO0 on nina, relates to BLE CTS
76 /// | Function | Alias with applied function |
77 /// |--------------|-----------------------------|
78 /// | `SPI0 SCK` | [crate::Gp2Spi0Sck] |
79 /// | `UART0 CTS` | [crate::Gp2Uart0Cts] |
80 /// | `I2C1 SDA` | [crate::Gp2I2C1Sda] |
81 /// | `PWM1 A` | [crate::Gp2Pwm1A] |
82 /// | `PIO0` | [crate::Gp2Pio0] |
83 /// | `PIO1` | [crate::Gp2Pio1] |
84 Gpio2 {
85 // name indicates BLE CTS on nina module, so outgoing line is bleRts using UART
86 name: ble_rts,
87 aliases: {
88 /// UART Function alias for pin [crate::Pins::gpio2].
89 FunctionUart, PullNone: Gp2Uart0Cts
90 }
91 },
92
93 /// GPIO 3 supports following functions:
94 /// | Default | Line for reset of Nina Wifi Module
95 /// | Function | Alias with applied function |
96 /// |--------------|-----------------------------|
97 /// | `SPI0 TX` | [crate::Gp3Spi0Tx] |
98 /// | `UART0 RTS` | [crate::Gp3Uart0Rts] |
99 /// | `I2C1 SCL` | [crate::Gp3I2C1Scl] |
100 /// | `PWM1 B` | [crate::Gp3Pwm1B] |
101 /// | `PIO0` | [crate::Gp3Pio0] |
102 /// | `PIO1` | [crate::Gp3Pio1] |
103 Gpio3 {
104 name: nina_reset_n
105 },
106
107 /// GPIO 4 supports following functions:
108 /// | Default | SpiRx
109 /// | Function | Alias with applied function |
110 /// |--------------|-----------------------------|
111 /// | `SPI0 RX` | [crate::Gp4Spi0Rx] |
112 /// | `UART1 TX` | [crate::Gp4Uart1Tx] |
113 /// | `I2C0 SDA` | [crate::Gp4I2C0Sda] |
114 /// | `PWM2 A` | [crate::Gp4Pwm2A] |
115 /// | `PIO0` | [crate::Gp4Pio0] |
116 /// | `PIO1` | [crate::Gp4Pio1] |
117 Gpio4 {
118 // Conflicting information between schematic and 'latest' pinnout diagram.
119 // MISO in schematic, CIPO in 'latest' arduino pinnout diagram. same thing really
120 // SPIRX in schematic line label.
121 name: cipo,
122 aliases: {
123 /// UART Function alias for pin [crate::Pins::gpio4].
124 FunctionUart, PullNone: Gp4Uart1Tx,
125 /// SPI Function alias for pin [crate::Pins::gpio4].
126 FunctionSpi, PullNone: Gp4Spi0Rx,
127 /// I2C Function alias for pin [crate::Pins::gpio4].
128 FunctionI2C, PullUp: Gp4I2C0Sda,
129 /// PWM Function alias for pin [crate::Pins::gpio4].
130 FunctionPwm, PullNone: Gp4Pwm2A,
131 /// PIO0 Function alias for pin [crate::Pins::gpio4].
132 FunctionPio0, PullNone: Gp4Pio0,
133 /// PIO1 Function alias for pin [crate::Pins::gpio4].
134 FunctionPio1, PullNone: Gp4Pio1
135 }
136 },
137
138 /// GPIO 5 supports following functions:
139 /// | Default | Generic Digital pin D10
140 /// | Function | Alias with applied function |
141 /// |--------------|-----------------------------|
142 /// | `SPI0 CSn` | [crate::Gp5Spi0Csn] |
143 /// | `UART1 RX` | [crate::Gp5Uart1Rx] |
144 /// | `I2C0 SCL` | [crate::Gp5I2C0Scl] |
145 /// | `PWM2 B` | [crate::Gp5Pwm2B] |
146 /// | `PIO0` | [crate::Gp5Pio0] |
147 /// | `PIO1` | [crate::Gp5Pio1] |
148 Gpio5 {
149 name: d10,
150 aliases: {
151 /// UART Function alias for pin [crate::Pins::gpio5].
152 FunctionUart, PullNone: Gp5Uart1Rx,
153 /// SPI Function alias for pin [crate::Pins::gpio5].
154 FunctionSpi, PullNone: Gp5Spi0Csn,
155 /// I2C Function alias for pin [crate::Pins::gpio5].
156 FunctionI2C, PullUp: Gp5I2C0Scl,
157 /// PWM Function alias for pin [crate::Pins::gpio5].
158 FunctionPwm, PullNone: Gp5Pwm2B,
159 /// PIO0 Function alias for pin [crate::Pins::gpio5].
160 FunctionPio0, PullNone: Gp5Pio0,
161 /// PIO1 Function alias for pin [crate::Pins::gpio5].
162 FunctionPio1, PullNone: Gp5Pio1
163 }
164 },
165
166 /// GPIO 6 supports following functions:
167 /// | Default | SPI0 SCK (tied to on board led)
168 /// | Function | Alias with applied function |
169 /// |--------------|-----------------------------|
170 /// | `SPI0 SCK` | [crate::Gp6Spi0Sck] |
171 /// | `UART1 CTS` | [crate::Gp6Uart1Cts] |
172 /// | `I2C1 SDA` | [crate::Gp6I2C1Sda] |
173 /// | `PWM3 A` | [crate::Gp6Pwm3A] |
174 /// | `PIO0` | [crate::Gp6Pio0] |
175 /// | `PIO1` | [crate::Gp6Pio1] |
176 Gpio6 {
177 // also tied to on board led, on pin 13
178 name: sck0,
179 aliases: {
180 /// UART Function alias for pin [crate::Pins::gpio6].
181 FunctionUart, PullNone: Gp6Uart1Cts,
182 /// SPI Function alias for pin [crate::Pins::gpio6].
183 FunctionSpi, PullNone: Gp6Spi0Sck,
184 /// I2C Function alias for pin [crate::Pins::gpio6].
185 FunctionI2C, PullUp: Gp6I2C1Sda,
186 /// PWM Function alias for pin [crate::Pins::gpio6].
187 FunctionPwm, PullNone: Gp6Pwm3A,
188 /// PIO0 Function alias for pin [crate::Pins::gpio6].
189 FunctionPio0, PullNone: Gp6Pio0,
190 /// PIO1 Function alias for pin [crate::Pins::gpio6].
191 FunctionPio1, PullNone: Gp6Pio1
192 }
193 },
194
195 /// GPIO 7 supports following functions:
196 /// | Default | SPI0 TX
197 /// | Function | Alias with applied function |
198 /// |--------------|-----------------------------|
199 /// | `SPI0 TX` | [crate::Gp7Spi0Tx] |
200 /// | `UART1 RTS` | [crate::Gp7Uart1Rts] |
201 /// | `I2C1 SCL` | [crate::Gp7I2C1Scl] |
202 /// | `PWM3 B` | [crate::Gp7Pwm3B] |
203 /// | `PIO0` | [crate::Gp7Pio0] |
204 /// | `PIO1` | [crate::Gp7Pio1] |
205 Gpio7 {
206 // Conflicting information between schematic and 'latest' pinnout diagram.
207 // MOSI in schematic, COPI in 'latest' arduino pinnout diagram.
208 // SPITX in schematic line label.
209 name: copi,
210 aliases: {
211 /// UART Function alias for pin [crate::Pins::gpio7].
212 FunctionUart, PullNone: Gp7Uart1Rts,
213 /// SPI Function alias for pin [crate::Pins::gpio7].
214 FunctionSpi, PullNone: Gp7Spi0Tx,
215 /// I2C Function alias for pin [crate::Pins::gpio7].
216 FunctionI2C, PullUp: Gp7I2C1Scl,
217 /// PWM Function alias for pin [crate::Pins::gpio7].
218 FunctionPwm, PullNone: Gp7Pwm3B,
219 /// PIO0 Function alias for pin [crate::Pins::gpio7].
220 FunctionPio0, PullNone: Gp7Pio0,
221 /// PIO1 Function alias for pin [crate::Pins::gpio7].
222 FunctionPio1, PullNone: Gp7Pio1
223 }
224 },
225
226 /// GPIO 8 supports following functions:
227 /// | Default | SPI1 CIPO / UART1 TX connection to Nina Module
228 /// | Function | Alias with applied function |
229 /// |--------------|-----------------------------|
230 /// | `SPI1 RX` | [crate::Gp8Spi1Rx] |
231 /// | `UART1 TX` | [crate::Gp8Uart1Tx] |
232 /// | `I2C0 SDA` | [crate::Gp8I2C0Sda] |
233 /// | `PWM4 A` | [crate::Gp8Pwm4A] |
234 /// | `PIO0` | [crate::Gp8Pio0] |
235 /// | `PIO1` | [crate::Gp8Pio1] |
236 Gpio8 {
237 // name indicates port to BLE RX on nina module and SPI CIPO for wifi
238 name: ble_tx_cipo,
239 aliases: {
240 /// UART Function alias for pin [crate::Pins::gpio8].
241 FunctionUart, PullNone: Gp8Uart1Tx,
242 /// SPI Function alias for pin [crate::Pins::gpio8].
243 FunctionSpi, PullNone: Gp8Spi1Rx
244 }
245 },
246
247 /// GPIO 9 supports following functions:
248 /// | Default | SPI1 CS / UART1 RX
249 /// | Function | Alias with applied function |
250 /// |--------------|-----------------------------|
251 /// | `SPI1 CSn` | [crate::Gp9Spi1Csn] |
252 /// | `UART1 RX` | [crate::Gp9Uart1Rx] |
253 /// | `I2C0 SCL` | [crate::Gp9I2C0Scl] |
254 /// | `PWM4 B` | [crate::Gp9Pwm4B] |
255 /// | `PIO0` | [crate::Gp9Pio0] |
256 /// | `PIO1` | [crate::Gp9Pio1] |
257 Gpio9 {
258 // name indicates BLE TX on nina module and spi1 cs signal to wifi
259 name: ble_rx_cs,
260 aliases: {
261 /// UART Function alias for pin [crate::Pins::gpio9].
262 FunctionUart, PullNone: Gp9Uart1Rx,
263 /// SPI Function alias for pin [crate::Pins::gpio9].
264 FunctionSpi, PullNone: Gp9Spi1Csn
265 }
266 },
267
268 /// GPIO 10 supports following functions:
269 /// | Default | SPI1 ACK / UART1 CTS
270 /// | Function | Alias with applied function |
271 /// |--------------|-----------------------------|
272 /// | `SPI1 SCK` | [crate::Gp10Spi1Sck] |
273 /// | `UART1 CTS` | [crate::Gp10Uart1Cts] |
274 /// | `I2C1 SDA` | [crate::Gp10I2C1Sda] |
275 /// | `PWM5 A` | [crate::Gp10Pwm5A] |
276 /// | `PIO0` | [crate::Gp10Pio0] |
277 /// | `PIO1` | [crate::Gp10Pio1] |
278 Gpio10 {
279 // name indicates BLE RTS on nina module and spi1 ack
280 name: ble_cts_ack,
281 aliases: {
282 /// UART Function alias for pin [crate::Pins::gpio10].
283 FunctionUart, PullNone: Gp10Uart1Cts,
284 /// SPI Function alias for pin [crate::Pins::gpio10].
285 FunctionSpi, PullNone: Gp10Spi1Sck
286 }
287 },
288
289 /// GPIO 11 supports following functions:
290 /// | Default | SPI1 COPI / UART1 RTS
291 /// | Function | Alias with applied function |
292 /// |--------------|-----------------------------|
293 /// | `SPI1 TX` | [crate::Gp11Spi1Tx] |
294 /// | `UART1 RTS` | [crate::Gp11Uart1Rts] |
295 /// | `I2C1 SCL` | [crate::Gp11I2C1Scl] |
296 /// | `PWM5 B` | [crate::Gp11Pwm5B] |
297 /// | `PIO0` | [crate::Gp11Pio0] |
298 /// | `PIO1` | [crate::Gp11Pio1] |
299 Gpio11 {
300 // ninaCOPI is
301 name: nina_copi,
302 aliases: {
303 /// UART Function alias for pin [crate::Pins::gpio11].
304 FunctionUart, PullNone: Gp11Uart1Rts,
305 /// SPI Function alias for pin [crate::Pins::gpio11].
306 FunctionSpi, PullNone: Gp11Spi1Tx
307 }
308 },
309
310 /// GPIO 12 supports following functions:
311 /// | Default | I2C0 SDA / A4 ~ goes to pullups and auth
312 /// | Function | Alias with applied function |
313 /// |--------------|-----------------------------|
314 /// | `SPI1 RX` | [crate::Gp12Spi1Rx] |
315 /// | `UART0 TX` | [crate::Gp12Uart0Tx] |
316 /// | `I2C0 SDA` | [crate::Gp12I2C0Sda] |
317 /// | `PWM6 A` | [crate::Gp12Pwm6A] |
318 /// | `PIO0` | [crate::Gp12Pio0] |
319 /// | `PIO1` | [crate::Gp12Pio1] |
320 Gpio12 {
321 // Also SDA Crypto
322 name: a4,
323 aliases: {
324 /// UART Function alias for pin [crate::Pins::gpio12].
325 FunctionUart, PullNone: Gp12Uart0Tx,
326 /// SPI Function alias for pin [crate::Pins::gpio12].
327 FunctionSpi, PullNone: Gp12Spi1Rx,
328 /// I2C Function alias for pin [crate::Pins::gpio12].
329 FunctionI2C, PullUp: Gp12I2C0Sda,
330 /// PWM Function alias for pin [crate::Pins::gpio12].
331 FunctionPwm, PullNone: Gp12Pwm6A,
332 /// PIO0 Function alias for pin [crate::Pins::gpio12].
333 FunctionPio0, PullNone: Gp12Pio0,
334 /// PIO1 Function alias for pin [crate::Pins::gpio12].
335 FunctionPio1, PullNone: Gp12Pio1
336 }
337 },
338
339 /// GPIO 13 supports following functions:
340 /// | Default | I2C0 SCL / A5 ~ goes to pullups
341 /// | Function | Alias with applied function |
342 /// |--------------|-----------------------------|
343 /// | `SPI1 CSn` | [crate::Gp13Spi1Csn] |
344 /// | `UART0 RX` | [crate::Gp13Uart0Rx] |
345 /// | `I2C0 SCL` | [crate::Gp13I2C0Scl] |
346 /// | `PWM6 B` | [crate::Gp13Pwm6B] |
347 /// | `PIO0` | [crate::Gp13Pio0] |
348 /// | `PIO1` | [crate::Gp13Pio1] |
349 Gpio13 {
350 // Also SCL Crypto
351 name: a5,
352 aliases: {
353 /// UART Function alias for pin [crate::Pins::gpio13].
354 FunctionUart, PullNone: Gp13Uart0Rx,
355 /// SPI Function alias for pin [crate::Pins::gpio13].
356 FunctionSpi, PullNone: Gp13Spi1Csn,
357 /// I2C Function alias for pin [crate::Pins::gpio13].
358 FunctionI2C, PullUp: Gp13I2C0Scl,
359 /// PWM Function alias for pin [crate::Pins::gpio13].
360 FunctionPwm, PullNone: Gp13Pwm6B,
361 /// PIO0 Function alias for pin [crate::Pins::gpio13].
362 FunctionPio0, PullNone: Gp13Pio0,
363 /// PIO1 Function alias for pin [crate::Pins::gpio13].
364 FunctionPio1, PullNone: Gp13Pio1
365 }
366 },
367
368 /// GPIO 14 supports following functions:
369 /// | Default | SPI1 SCK ~ nina SCK
370 /// | Function | Alias with applied function |
371 /// |--------------|-----------------------------|
372 /// | `SPI1 SCK` | [crate::Gp14Spi1Sck] |
373 /// | `UART0 CTS` | [crate::Gp14Uart0Cts] |
374 /// | `I2C1 SDA` | [crate::Gp14I2C1Sda] |
375 /// | `PWM7 A` | [crate::Gp14Pwm7A] |
376 /// | `PIO0` | [crate::Gp14Pio0] |
377 /// | `PIO1` | [crate::Gp14Pio1] |
378 Gpio14 {
379 name: nina_sck,
380 aliases: {
381 /// SPI Function alias for pin [crate::Pins::gpio14].
382 FunctionSpi, PullNone: Gp14Spi1Sck
383 }
384 },
385
386 /// GPIO 15 supports following functions:
387 /// | Default | General Digital pin D3
388 /// | Function | Alias with applied function |
389 /// |--------------|-----------------------------|
390 /// | `SPI1 TX` | [crate::Gp15Spi1Tx] |
391 /// | `UART0 RTS` | [crate::Gp15Uart0Rts] |
392 /// | `I2C1 SCL` | [crate::Gp15I2C1Scl] |
393 /// | `PWM7 B` | [crate::Gp15Pwm7B] |
394 /// | `PIO0` | [crate::Gp15Pio0] |
395 /// | `PIO1` | [crate::Gp15Pio1] |
396 Gpio15 {
397 name: d3,
398 aliases: {
399 /// UART Function alias for pin [crate::Pins::gpio15].
400 FunctionUart, PullNone: Gp15Uart0Rts,
401 /// SPI Function alias for pin [crate::Pins::gpio15].
402 FunctionSpi, PullNone: Gp15Spi1Tx,
403 /// I2C Function alias for pin [crate::Pins::gpio15].
404 FunctionI2C, PullUp: Gp15I2C1Scl,
405 /// PWM Function alias for pin [crate::Pins::gpio15].
406 FunctionPwm, PullNone: Gp15Pwm7B,
407 /// PIO0 Function alias for pin [crate::Pins::gpio15].
408 FunctionPio0, PullNone: Gp15Pio0,
409 /// PIO1 Function alias for pin [crate::Pins::gpio15].
410 FunctionPio1, PullNone: Gp15Pio1
411 }
412 },
413
414 /// GPIO 16 supports following functions:
415 /// | Default | General Digital pin D4
416 /// | Function | Alias with applied function |
417 /// |--------------|-----------------------------|
418 /// | `SPI0 RX` | [crate::Gp16Spi0Rx] |
419 /// | `UART0 TX` | [crate::Gp16Uart0Tx] |
420 /// | `I2C0 SDA` | [crate::Gp16I2C0Sda] |
421 /// | `PWM0 A` | [crate::Gp16Pwm0A] |
422 /// | `PIO0` | [crate::Gp16Pio0] |
423 /// | `PIO1` | [crate::Gp16Pio1] |
424 Gpio16 {
425 name: d4,
426 aliases: {
427 /// UART Function alias for pin [crate::Pins::gpio16].
428 FunctionUart, PullNone: Gp16Uart0Tx,
429 /// SPI Function alias for pin [crate::Pins::gpio16].
430 FunctionSpi, PullNone: Gp16Spi0Rx,
431 /// I2C Function alias for pin [crate::Pins::gpio16].
432 FunctionI2C, PullUp: Gp16I2C0Sda,
433 /// PWM Function alias for pin [crate::Pins::gpio16].
434 FunctionPwm, PullNone: Gp16Pwm0A,
435 /// PIO0 Function alias for pin [crate::Pins::gpio16].
436 FunctionPio0, PullNone: Gp16Pio0,
437 /// PIO1 Function alias for pin [crate::Pins::gpio16].
438 FunctionPio1, PullNone: Gp16Pio1
439 }
440 },
441
442 /// GPIO 17 supports following functions:
443 /// | Default | General Digital pin D5
444 /// | Function | Alias with applied function |
445 /// |--------------|-----------------------------|
446 /// | `SPI0 CSn` | [crate::Gp17Spi0Csn] |
447 /// | `UART0 RX` | [crate::Gp17Uart0Rx] |
448 /// | `I2C0 SCL` | [crate::Gp17I2C0Scl] |
449 /// | `PWM0 B` | [crate::Gp17Pwm0B] |
450 /// | `PIO0` | [crate::Gp17Pio0] |
451 /// | `PIO1` | [crate::Gp17Pio1] |
452 Gpio17 {
453 name: d5,
454 aliases: {
455 /// UART Function alias for pin [crate::Pins::gpio17].
456 FunctionUart, PullNone: Gp17Uart0Rx,
457 /// SPI Function alias for pin [crate::Pins::gpio17].
458 FunctionSpi, PullNone: Gp17Spi0Csn,
459 /// I2C Function alias for pin [crate::Pins::gpio17].
460 FunctionI2C, PullUp: Gp17I2C0Scl,
461 /// PWM Function alias for pin [crate::Pins::gpio17].
462 FunctionPwm, PullNone: Gp17Pwm0B,
463 /// PIO0 Function alias for pin [crate::Pins::gpio17].
464 FunctionPio0, PullNone: Gp17Pio0,
465 /// PIO1 Function alias for pin [crate::Pins::gpio17].
466 FunctionPio1, PullNone: Gp17Pio1
467 }
468 },
469
470 /// GPIO 18 supports following functions:
471 /// | Default | General Digital pin D6
472 /// | Function | Alias with applied function |
473 /// |--------------|-----------------------------|
474 /// | `SPI0 SCK` | [crate::Gp18Spi0Sck] |
475 /// | `UART0 CTS` | [crate::Gp18Uart0Cts] |
476 /// | `I2C1 SDA` | [crate::Gp18I2C1Sda] |
477 /// | `PWM1 A` | [crate::Gp18Pwm1A] |
478 /// | `PIO0` | [crate::Gp18Pio0] |
479 /// | `PIO1` | [crate::Gp18Pio1] |
480 Gpio18 {
481 name: d6,
482 aliases: {
483 /// UART Function alias for pin [crate::Pins::gpio18].
484 FunctionUart, PullNone: Gp18Uart0Cts,
485 /// SPI Function alias for pin [crate::Pins::gpio18].
486 FunctionSpi, PullNone: Gp18Spi0Sck,
487 /// I2C Function alias for pin [crate::Pins::gpio18].
488 FunctionI2C, PullUp: Gp18I2C1Sda,
489 /// PWM Function alias for pin [crate::Pins::gpio18].
490 FunctionPwm, PullNone: Gp18Pwm1A,
491 /// PIO0 Function alias for pin [crate::Pins::gpio18].
492 FunctionPio0, PullNone: Gp18Pio0,
493 /// PIO1 Function alias for pin [crate::Pins::gpio18].
494 FunctionPio1, PullNone: Gp18Pio1
495 }
496 },
497
498 /// GPIO 19 supports following functions:
499 /// | Default | General Digital Pin D7
500 /// | Function | Alias with applied function |
501 /// |--------------|-----------------------------|
502 /// | `SPI0 TX` | [crate::Gp19Spi0Tx] |
503 /// | `UART0 RTS` | [crate::Gp19Uart0Rts] |
504 /// | `I2C1 SCL` | [crate::Gp19I2C1Scl] |
505 /// | `PWM1 B` | [crate::Gp19Pwm1B] |
506 /// | `PIO0` | [crate::Gp19Pio0] |
507 /// | `PIO1` | [crate::Gp19Pio1] |
508 Gpio19 {
509 name: d7,
510 aliases: {
511 /// UART Function alias for pin [crate::Pins::gpio19].
512 FunctionUart, PullNone: Gp19Uart0Rts,
513 /// SPI Function alias for pin [crate::Pins::gpio19].
514 FunctionSpi, PullNone: Gp19Spi0Tx,
515 /// I2C Function alias for pin [crate::Pins::gpio19].
516 FunctionI2C, PullUp: Gp19I2C1Scl,
517 /// PWM Function alias for pin [crate::Pins::gpio19].
518 FunctionPwm, PullNone: Gp19Pwm1B,
519 /// PIO0 Function alias for pin [crate::Pins::gpio19].
520 FunctionPio0, PullNone: Gp19Pio0,
521 /// PIO1 Function alias for pin [crate::Pins::gpio19].
522 FunctionPio1, PullNone: Gp19Pio1
523 }
524 },
525
526 /// GPIO 20 supports following functions:
527 /// | Default | General Digital pin D8
528 /// | Function | Alias with applied function |
529 /// |--------------|-----------------------------|
530 /// | `SPI0 RX` | [crate::Gp20Spi0Rx] |
531 /// | `UART1 TX` | [crate::Gp20Uart1Tx] |
532 /// | `I2C0 SDA` | [crate::Gp20I2C0Sda] |
533 /// | `PWM2 A` | [crate::Gp20Pwm2A] |
534 /// | `PIO0` | [crate::Gp20Pio0] |
535 /// | `PIO1` | [crate::Gp20Pio1] |
536 Gpio20 {
537 name: d8,
538 aliases: {
539 /// UART Function alias for pin [crate::Pins::gpio20].
540 FunctionUart, PullNone: Gp20Uart1Tx,
541 /// SPI Function alias for pin [crate::Pins::gpio20].
542 FunctionSpi, PullNone: Gp20Spi0Rx,
543 /// I2C Function alias for pin [crate::Pins::gpio20].
544 FunctionI2C, PullUp: Gp20I2C0Sda,
545 /// PWM Function alias for pin [crate::Pins::gpio20].
546 FunctionPwm, PullNone: Gp20Pwm2A,
547 /// PIO0 Function alias for pin [crate::Pins::gpio20].
548 FunctionPio0, PullNone: Gp20Pio0,
549 /// PIO1 Function alias for pin [crate::Pins::gpio20].
550 FunctionPio1, PullNone: Gp20Pio1
551 }
552 },
553
554 /// GPIO 21 supports following functions:
555 /// | Default | General Digital pin D9
556 /// | Function | Alias with applied function |
557 /// |--------------|-----------------------------|
558 /// | `SPI0 CSn` | [crate::Gp21Spi0Csn] |
559 /// | `UART1 RX` | [crate::Gp21Uart1Rx] |
560 /// | `I2C0 SCL` | [crate::Gp21I2C0Scl] |
561 /// | `PWM2 B` | [crate::Gp21Pwm2B] |
562 /// | `PIO0` | [crate::Gp21Pio0] |
563 /// | `PIO1` | [crate::Gp21Pio1] |
564 Gpio21 {
565 name: d9,
566 aliases: {
567 /// UART Function alias for pin [crate::Pins::gpio21].
568 FunctionUart, PullNone: Gp21Uart1Rx,
569 /// SPI Function alias for pin [crate::Pins::gpio21].
570 FunctionSpi, PullNone: Gp21Spi0Csn,
571 /// I2C Function alias for pin [crate::Pins::gpio21].
572 FunctionI2C, PullUp: Gp21I2C0Scl,
573 /// PWM Function alias for pin [crate::Pins::gpio21].
574 FunctionPwm, PullNone: Gp21Pwm2B,
575 /// PIO0 Function alias for pin [crate::Pins::gpio21].
576 FunctionPio0, PullNone: Gp21Pio0,
577 /// PIO1 Function alias for pin [crate::Pins::gpio21].
578 FunctionPio1, PullNone: Gp21Pio1
579 }
580 },
581
582 /// GPIO 22 supports following functions:
583 /// | Default | PDMDIN
584 /// | Function | Alias with applied function |
585 /// |--------------|-----------------------------|
586 /// | `SPI0 SCK` | [crate::Gp22Spi0Sck] |
587 /// | `UART1 CTS` | [crate::Gp22Uart1Cts] |
588 /// | `I2C1 SDA` | [crate::Gp22I2C1Sda] |
589 /// | `PWM3 A` | [crate::Gp22Pwm3A] |
590 /// | `PIO0` | [crate::Gp22Pio0] |
591 /// | `PIO1` | [crate::Gp22Pio1] |
592 Gpio22 {
593 // this connects to the microphone module
594 name: pdmdin
595 },
596
597 /// GPIO 23 supports following functions:
598 /// | Default | PDMCLK
599 /// | Function | Alias with applied function |
600 /// |--------------|-----------------------------|
601 /// | `SPI0 TX` | [crate::Gp23Spi0Tx] |
602 /// | `UART1 RTS` | [crate::Gp23Uart1Rts] |
603 /// | `I2C1 SCL` | [crate::Gp23I2C1Scl] |
604 /// | `PWM3 B` | [crate::Gp23Pwm3B] |
605 /// | `PIO0` | [crate::Gp23Pio0] |
606 /// | `PIO1` | [crate::Gp23Pio1] |
607 Gpio23 {
608 name: pdmclk
609 },
610
611 /// GPIO 24 supports following functions:
612 /// | Default | INT1 ~ connected to INT1 on the IMU
613 /// | Function | Alias with applied function |
614 /// |--------------|-----------------------------|
615 /// | `SPI1 RX` | [crate::Gp24Spi1Rx] |
616 /// | `UART1 TX` | [crate::Gp24Uart1Tx] |
617 /// | `I2C0 SDA` | [crate::Gp24I2C0Sda] |
618 /// | `PWM4 A` | [crate::Gp24Pwm4A] |
619 /// | `PIO0` | [crate::Gp24Pio0] |
620 /// | `PIO1` | [crate::Gp24Pio1] |
621 Gpio24 {
622 name: int1
623 },
624
625 /// GPIO 25 supports following functions:
626 /// | Default |
627 /// | Function | Alias with applied function |
628 /// |--------------|-----------------------------|
629 /// | `SPI1 CSn` | [crate::Gp25Spi1Csn] |
630 /// | `UART1 RX` | [crate::Gp25Uart1Rx] |
631 /// | `I2C0 SCL` | [crate::Gp25I2C0Scl] |
632 /// | `PWM4 B` | [crate::Gp25Pwm4B] |
633 /// | `PIO0` | [crate::Gp25Pio0] |
634 /// | `PIO1` | [crate::Gp25Pio1] |
635 Gpio25 {
636 name: d2,
637 aliases: {
638 /// UART Function alias for pin [crate::Pins::gpio25].
639 FunctionUart, PullNone: Gp25Uart1Rx,
640 /// SPI Function alias for pin [crate::Pins::gpio25].
641 FunctionSpi, PullNone: Gp25Spi1Csn,
642 /// I2C Function alias for pin [crate::Pins::gpio25].
643 FunctionI2C, PullUp: Gp25I2C0Scl,
644 /// PWM Function alias for pin [crate::Pins::gpio25].
645 FunctionPwm, PullNone: Gp25Pwm4B,
646 /// PIO0 Function alias for pin [crate::Pins::gpio25].
647 FunctionPio0, PullNone: Gp25Pio0,
648 /// PIO1 Function alias for pin [crate::Pins::gpio25].
649 FunctionPio1, PullNone: Gp25Pio1
650 }
651 },
652
653 /// GPIO 26 supports following functions:
654 ///
655 /// | Function | Alias with applied function |
656 /// |--------------|-----------------------------|
657 /// | `SPI1 SCK` | [crate::Gp26Spi1Sck] |
658 /// | `UART1 CTS` | [crate::Gp26Uart1Cts] |
659 /// | `I2C1 SDA` | [crate::Gp26I2C1Sda] |
660 /// | `PWM5 A` | [crate::Gp26Pwm5A] |
661 /// | `PIO0` | [crate::Gp26Pio0] |
662 /// | `PIO1` | [crate::Gp26Pio1] |
663 Gpio26 {
664 name: a0,
665 aliases: {
666 /// UART Function alias for pin [crate::Pins::gpio26].
667 FunctionUart, PullNone: Gp26Uart1Cts,
668 /// SPI Function alias for pin [crate::Pins::gpio26].
669 FunctionSpi, PullNone: Gp26Spi1Sck,
670 /// I2C Function alias for pin [crate::Pins::gpio26].
671 FunctionI2C, PullUp: Gp26I2C1Sda,
672 /// PWM Function alias for pin [crate::Pins::gpio26].
673 FunctionPwm, PullNone: Gp26Pwm5A,
674 /// PIO0 Function alias for pin [crate::Pins::gpio26].
675 FunctionPio0, PullNone: Gp26Pio0,
676 /// PIO1 Function alias for pin [crate::Pins::gpio26].
677 FunctionPio1, PullNone: Gp26Pio1
678 }
679 },
680
681 /// GPIO 27 supports following functions:
682 ///
683 /// | Function | Alias with applied function |
684 /// |--------------|-----------------------------|
685 /// | `SPI1 TX` | [crate::Gp27Spi1Tx] |
686 /// | `UART1 RTS` | [crate::Gp27Uart1Rts] |
687 /// | `I2C1 SCL` | [crate::Gp27I2C1Scl] |
688 /// | `PWM5 B` | [crate::Gp27Pwm5B] |
689 /// | `PIO0` | [crate::Gp27Pio0] |
690 /// | `PIO1` | [crate::Gp27Pio1] |
691 Gpio27 {
692 name: a1,
693 aliases: {
694 /// UART Function alias for pin [crate::Pins::gpio27].
695 FunctionUart, PullNone: Gp27Uart1Rts,
696 /// SPI Function alias for pin [crate::Pins::gpio27].
697 FunctionSpi, PullNone: Gp27Spi1Tx,
698 /// I2C Function alias for pin [crate::Pins::gpio27].
699 FunctionI2C, PullUp: Gp27I2C1Scl,
700 /// PWM Function alias for pin [crate::Pins::gpio27].
701 FunctionPwm, PullNone: Gp27Pwm5B,
702 /// PIO0 Function alias for pin [crate::Pins::gpio27].
703 FunctionPio0, PullNone: Gp27Pio0,
704 /// PIO1 Function alias for pin [crate::Pins::gpio27].
705 FunctionPio1, PullNone: Gp27Pio1
706 }
707 },
708
709 /// GPIO 28 supports following functions:
710 ///
711 /// | Function | Alias with applied function |
712 /// |--------------|-----------------------------|
713 /// | `SPI1 RX` | [crate::Gp28Spi1Rx] |
714 /// | `UART0 TX` | [crate::Gp28Uart0Tx] |
715 /// | `I2C0 SDA` | [crate::Gp28I2C0Sda] |
716 /// | `PWM6 A` | [crate::Gp28Pwm6A] |
717 /// | `PIO0` | [crate::Gp28Pio0] |
718 /// | `PIO1` | [crate::Gp28Pio1] |
719 Gpio28 {
720 name: a2,
721 aliases: {
722 /// UART Function alias for pin [crate::Pins::gpio28].
723 FunctionUart, PullNone: Gp28Uart0Tx,
724 /// SPI Function alias for pin [crate::Pins::gpio28].
725 FunctionSpi, PullNone: Gp28Spi1Rx,
726 /// I2C Function alias for pin [crate::Pins::gpio28].
727 FunctionI2C, PullUp: Gp28I2C0Sda,
728 /// PWM Function alias for pin [crate::Pins::gpio28].
729 FunctionPwm, PullNone: Gp28Pwm6A,
730 /// PIO0 Function alias for pin [crate::Pins::gpio28].
731 FunctionPio0, PullNone: Gp28Pio0,
732 /// PIO1 Function alias for pin [crate::Pins::gpio28].
733 FunctionPio1, PullNone: Gp28Pio1
734 }
735 },
736
737 /// GPIO 29 supports following functions:
738 ///
739 /// | Function | Alias with applied function |
740 /// |--------------|-----------------------------|
741 /// | `SPI1 CS` | [crate::Gp29Spi1CSn] |
742 /// | `UART0 RX` | [crate::Gp29Uart0Rx] |
743 /// | `I2C0 SCL` | [crate::Gp29I2C0Scl] |
744 /// | `PWM6 B` | [crate::Gp29Pwm6B] |
745 /// | `PIO0` | [crate::Gp29Pio0] |
746 /// | `PIO1` | [crate::Gp29Pio1] |
747 Gpio29 {
748 name: a3,
749 aliases: {
750 /// UART Function alias for pin [crate::Pins::gpio28].
751 FunctionUart, PullNone: Gp29Uart0Rx,
752 /// SPI Function alias for pin [crate::Pins::gpio28].
753 FunctionSpi, PullNone: Gp29Spi1CSn,
754 /// I2C Function alias for pin [crate::Pins::gpio28].
755 FunctionI2C, PullUp: Gp29I2C0Scl,
756 /// PWM Function alias for pin [crate::Pins::gpio28].
757 FunctionPwm, PullNone: Gp29Pwm6B,
758 /// PIO0 Function alias for pin [crate::Pins::gpio28].
759 FunctionPio0, PullNone: Gp29Pio0,
760 /// PIO1 Function alias for pin [crate::Pins::gpio28].
761 FunctionPio1, PullNone: Gp29Pio1
762 }
763 },
764);
765
766pub const XOSC_CRYSTAL_FREQ: u32 = 12_000_000;