Skip to content

Commit 706c4b2

Browse files
authored
Merge pull request #10287 from ross-satchell/development
Microchip Curiosity CircuitPython Nano board
2 parents 9f2fed5 + b7997ec commit 706c4b2

File tree

4 files changed

+147
-0
lines changed

4 files changed

+147
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "supervisor/board.h"
8+
9+
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
#pragma once
3+
4+
#define MICROPY_HW_BOARD_NAME "Microchip Curiosity CircuitPython"
5+
#define MICROPY_HW_MCU_NAME "same51j20"
6+
#define CIRCUITPY_MCU_FAMILY samd51
7+
8+
#define MICROPY_HW_LED_STATUS (&pin_PB23)
9+
#define MICROPY_HW_NEOPIXEL (&pin_PB22)
10+
11+
#define BOARD_HAS_CRYSTAL 1
12+
13+
// USB is always used internally so skip the pin objects for it.
14+
#define IGNORE_PIN_PA24 1
15+
#define IGNORE_PIN_PA25 1
16+
17+
#define DEFAULT_I2C_BUS_SCL (&pin_PB30)
18+
#define DEFAULT_I2C_BUS_SDA (&pin_PB31)
19+
20+
#define CIRCUITPY_BOARD_SPI (3)
21+
// These correspond to the CIRCUITPY_BOARD_BUS_SINGLETON definitions in pins.c
22+
#define CIRCUITPY_BOARD_SPI_PIN { \
23+
{.clock = &pin_PB03, .mosi = &pin_PB02, .miso = &pin_PB00}, /*board.SPI()*/ \
24+
{.clock = &pin_PA05, .mosi = &pin_PA04, .miso = NULL}, /*board.LCD_SPI()*/ \
25+
{.clock = &pin_PA17, .mosi = &pin_PA16, .miso = &pin_PA18}, /*board.SD_SPI()*/ \
26+
}
27+
28+
#define DEFAULT_CAN_BUS_TX (&pin_PB12)
29+
#define DEFAULT_CAN_BUS_RX (&pin_PB13)
30+
#define DEFAULT_CAN_BUS_STDBY (&pin_PB17)
31+
32+
#define DEFAULT_UART_BUS_RX (&pin_PA23)
33+
#define DEFAULT_UART_BUS_TX (&pin_PA22)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
USB_VID = 0x04D8
2+
USB_PID = 0xE52B
3+
USB_PRODUCT = "Microchip Curiosity CircuitPython"
4+
USB_MANUFACTURER = "Microchip Technology Inc"
5+
6+
CHIP_VARIANT = SAME51J20A
7+
CHIP_FAMILY = same51
8+
9+
QSPI_FLASH_FILESYSTEM = 1
10+
EXTERNAL_FLASH_DEVICES = "SST26VF016B,SST26VF032B,SST26VF064B"
11+
LONGINT_IMPL = MPZ
12+
13+
CIRCUITPY__EVE = 1
14+
CIRCUITPY_CANIO = 1
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "shared-bindings/board/__init__.h"
8+
9+
// The singleton for board.SPI() is already defined.
10+
// board.LCD_SPI()
11+
CIRCUITPY_BOARD_BUS_SINGLETON(lcd_spi, spi, 1)
12+
// board.SD_SPI()
13+
CIRCUITPY_BOARD_BUS_SINGLETON(sd_spi, spi, 2)
14+
15+
static const mp_rom_map_elem_t board_module_globals_table[] = {
16+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
17+
18+
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA15) },
19+
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA20) },
20+
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA21) },
21+
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA27) },
22+
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB14) },
23+
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PB15) },
24+
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PB16) },
25+
26+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PB23) },
27+
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB23) },
28+
29+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB22) },
30+
31+
{ MP_ROM_QSTR(MP_QSTR_VREF), MP_ROM_PTR(&pin_PA03) },
32+
33+
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB04) },
34+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB05) },
35+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB06) },
36+
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB07) },
37+
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB08) },
38+
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB09) },
39+
40+
{ MP_ROM_QSTR(MP_QSTR_DAC), MP_ROM_PTR(&pin_PA02) },
41+
42+
{ MP_ROM_QSTR(MP_QSTR_CAP1), MP_ROM_PTR(&pin_PB09) },
43+
44+
{ MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_PA07) },
45+
{ MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_PA04) },
46+
{ MP_ROM_QSTR(MP_QSTR_LCD_SCK), MP_ROM_PTR(&pin_PA05) },
47+
{ MP_ROM_QSTR(MP_QSTR_LCD_BL), MP_ROM_PTR(&pin_PA06) },
48+
49+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB30) },
50+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB31) },
51+
52+
{ MP_ROM_QSTR(MP_QSTR_BLE_TX), MP_ROM_PTR(&pin_PA12) },
53+
{ MP_ROM_QSTR(MP_QSTR_BLE_RX), MP_ROM_PTR(&pin_PA13) },
54+
{ MP_ROM_QSTR(MP_QSTR_BLE_CLR), MP_ROM_PTR(&pin_PA14) },
55+
56+
{ MP_ROM_QSTR(MP_QSTR_SD_MOSI), MP_ROM_PTR(&pin_PA16) },
57+
{ MP_ROM_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_PA18) },
58+
{ MP_ROM_QSTR(MP_QSTR_SD_SCK), MP_ROM_PTR(&pin_PA17) },
59+
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA19) },
60+
61+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB00) },
62+
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PB00) },
63+
{ MP_ROM_QSTR(MP_QSTR_IMU_INT), MP_ROM_PTR(&pin_PB00) },
64+
65+
{ MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PB01) },
66+
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB01) },
67+
{ MP_ROM_QSTR(MP_QSTR_IMU_ADDR), MP_ROM_PTR(&pin_PB01) },
68+
69+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB02) },
70+
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB02) },
71+
72+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB03) },
73+
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PB03) },
74+
75+
{ MP_ROM_QSTR(MP_QSTR_DEBUG_TX), MP_ROM_PTR(&pin_PA22) },
76+
{ MP_ROM_QSTR(MP_QSTR_DEBUG_RX), MP_ROM_PTR(&pin_PA23) },
77+
78+
{ MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB13) },
79+
{ MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB12) },
80+
81+
{ MP_OBJ_NEW_QSTR(MP_QSTR_CAN_STDBY), MP_ROM_PTR(&pin_PB17) },
82+
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB17) },
83+
84+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
85+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
86+
87+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
88+
{ MP_ROM_QSTR(MP_QSTR_LCD_SPI), MP_ROM_PTR(&board_lcd_spi_obj) },
89+
{ MP_ROM_QSTR(MP_QSTR_SD_SPI), MP_ROM_PTR(&board_sd_spi_obj) },
90+
};
91+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)