Skip to content

Commit b91c4e6

Browse files
committed
adding Adafruit_CircuitPython_Register to frozen + updating SAM32
1 parent 723a64c commit b91c4e6

File tree

3 files changed

+35
-20
lines changed

3 files changed

+35
-20
lines changed

ports/atmel-samd/boards/sam32/mpconfigboard.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
2-
#define MICROPY_HW_BOARD_NAME "SAM32v2a"
1+
#define MICROPY_HW_BOARD_NAME "SAM32v26"
32
#define MICROPY_HW_MCU_NAME "samd51j20"
43
#define CIRCUITPY_MCU_FAMILY samd51
54

65
#define MICROPY_HW_LED_STATUS (&pin_PA27)
7-
#define MICROPY_HW_NEOPIXEL (&pin_PA15)
6+
#define MICROPY_HW_NEOPIXEL (&pin_PA15)
87

98
#define MICROPY_PORT_A (PORT_PA24 | PORT_PA25)
109
#define MICROPY_PORT_B (0)
1110
#define MICROPY_PORT_C (0)
12-
#define MICROPY_PORT_D (0)
11+
#define MICROPY_PORT_D (0)
1312

14-
// No microcontroller.nvm
15-
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
13+
#define CIRCUITPY_INTERNAL_NVM_SIZE 1024
14+
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (128*1024)
1615

1716
#define BOARD_HAS_CRYSTAL 1
1817

19-
#define DEFAULT_I2C_BUS_SCL (&pin_PA04)
20-
#define DEFAULT_I2C_BUS_SDA (&pin_PA07)
18+
#define DEFAULT_I2C_BUS_SCL (&pin_PA09)
19+
#define DEFAULT_I2C_BUS_SDA (&pin_PA08)
2120

2221
#define DEFAULT_SPI_BUS_SCK (&pin_PB13)
2322
#define DEFAULT_SPI_BUS_MOSI (&pin_PB12)

ports/atmel-samd/boards/sam32/mpconfigboard.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ CHIP_FAMILY = samd51
88

99
INTERNAL_FLASH_FILESYSTEM = 1
1010
LONGINT_IMPL = MPZ
11+
12+
# No I2S on SAMD51
13+
CIRCUITPY_AUDIOBUSIO = 0
14+
CIRCUITPY_USTACK = 1
15+
16+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
17+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

ports/atmel-samd/boards/sam32/pins.c

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#include "shared-bindings/board/__init__.h"
22

33
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
4-
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB08) },
5-
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB09) },
6-
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA08) },
7-
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA09) },
4+
{ MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_PB08) },
5+
{ MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_PB09) },
86
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PB04) },
97
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB05) },
108
{ MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PB06) },
@@ -13,15 +11,14 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
1311
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) },
1412
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB12) },
1513
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) },
16-
{ MP_ROM_QSTR(MP_QSTR_xSDCS),MP_ROM_PTR(&pin_PB15) },
14+
{ MP_ROM_QSTR(MP_QSTR_xSDCS),MP_ROM_PTR(&pin_PA04) },
1715

1816
{ MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) },
1917
{ MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA05) },
2018

19+
{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA07) },
2120
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PA10) },
2221
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA11) },
23-
{ MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_PA12) },
24-
{ MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_PA13) },
2522
{ MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_PA14) },
2623
{ MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_PA16) },
2724
{ MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_PA17) },
@@ -35,12 +32,24 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
3532
{ MP_ROM_QSTR(MP_QSTR_D50), MP_ROM_PTR(&pin_PB23) },
3633
{ MP_ROM_QSTR(MP_QSTR_D59), MP_ROM_PTR(&pin_PB30) },
3734
{ MP_ROM_QSTR(MP_QSTR_D60), MP_ROM_PTR(&pin_PB31) },
38-
{ MP_ROM_QSTR(MP_QSTR_D64), MP_ROM_PTR(&pin_PB03) },
35+
{ MP_ROM_QSTR(MP_QSTR_D61), MP_ROM_PTR(&pin_PB00) },
36+
37+
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_PB01) },
38+
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_PB02) },
39+
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_PB03) },
40+
41+
{ MP_ROM_QSTR(MP_QSTR_TCK), MP_ROM_PTR(&pin_PB01) },
42+
{ MP_ROM_QSTR(MP_QSTR_TDI), MP_ROM_PTR(&pin_PB02) },
43+
{ MP_ROM_QSTR(MP_QSTR_TMS), MP_ROM_PTR(&pin_PB03) },
44+
{ MP_ROM_QSTR(MP_QSTR_ESP_CS),MP_ROM_PTR(&pin_PB15) },
45+
46+
{ MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_PA12) },
47+
{ MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PA13) },
48+
{ MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PB16) },
49+
{ MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PB17) },
3950

40-
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB16) },
41-
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB17) },
42-
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA07) },
43-
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA04) },
51+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) },
52+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) },
4453

4554
{ MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_PTR(&pin_PB11) },
4655
{ MP_ROM_QSTR(MP_QSTR_DTR), MP_ROM_PTR(&pin_PB10) },

0 commit comments

Comments
 (0)