8000 Merge pull request #9797 from bradanlane/bls_coin_m0 · JetForMe/circuitpython@2f37194 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2f37194

Browse files
authored
Merge pull request adafruit#9797 from bradanlane/bls_coin_m0
Add new atmel-samd board - Bradán Lane STUDIO Coin M0
2 parents ca123ee + 5c2d351 commit 2f37194

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2024 Bradán Lane STUDIO
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#pragma once
8+
9+
#define MICROPY_HW_BOARD_NAME "Bradán Lane STUDIO Coin M0"
10+
#define MICROPY_HW_MCU_NAME "samd21g18"
11+
12+
#define MICROPY_HW_LED_STATUS (&pin_PA17)
13+
14+
#define SPI_FLASH_MOSI_PIN &pin_PB22
15+
#define SPI_FLASH_MISO_PIN &pin_PB03
16+
#define SPI_FLASH_SCK_PIN &pin_PB23
17+
#define SPI_FLASH_CS_PIN &pin_PA27
18+
19+
// USB is always used internally so skip the pin objects for it.
20+
#define IGNORE_PIN_PA24 1 // USB_D+
21+
#define IGNORE_PIN_PA25 1 // USB_D-
22+
23+
#define IGNORE_PIN_PA30 1 // SWCLK
24+
#define IGNORE_PIN_PA31 1 // SWDIO
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This file is part of the CircuitPython project: https://circuitpython.org
2+
#
3+
# SPDX-FileCopyrightText: Copyright (c) 2024 Bradán Lane STUDIO
4+
#
5+
# SPDX-License-Identifier: MIT
6+
7+
# TODO new VID:PID not yet approved via pidcodes.github.com
8+
USB_VID = 0x1209
9+
USB_PID = 0x5687
10+
11+
USB_PRODUCT = "Coin M0"
12+
USB_MANUFACTURER = "Bradán Lane STUDIO"
13+
14+
CHIP_VARIANT = SAMD21G18A
15+
CHIP_FAMILY = samd21
16+
17+
#CIRCUITPY_BUILD_EXTENSIONS = bin,uf2
18+
19+
SPI_FLASH_FILESYSTEM = 1
20+
EXTERNAL_FLASH_DEVICES = "W25Q32JVxQ"
21+
LONGINT_IMPL = NONE
22+
23+
# the M0 Coin has limited functionality and many modules can be eliminated
24+
25+
# there may be more modules which are of no used but will require further digging
26+
27+
# Disable modules that are unusable on this special-purpose board.
28+
29+
CIRCUITPY_FULL_BUILD = 0
30+
31+
CIRCUITPY_AUDIOIO = 1
32+
CIRCUITPY_DISPLAYIO = 0
33+
CIRCUITPY_FRAMEBUFFERIO = 0
34+
CIRCUITPY_ONEWIREIO = 0
35+
CIRCUITPY_PULSEIO = 0
36+
CIRCUITPY_RGBMATRIX = 0
37+
CIRCUITPY_ROTARYIO = 0
38+
CIRCUITPY_RTC = 0
39+
CIRCUITPY_USB_HID = 1
40+
CIRCUITPY_USB_MIDI = 0
41+
42+
43+
# Include these Python libraries in firmware.
44+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
45+
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
static const mp_rom_map_elem_t board_module_globals_table[] = {
10+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
11+
12+
// Neopixels
13+
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
14+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA07) },
15+
16+
// discrete LEDs
17+
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
18+
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
19+
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },
20+
21+
// on-board LED
22+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA17) },
23+
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) },
24+
25+
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, // Analog only; no PWM
26+
{ MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_PA02) },
27+
28+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) },
29+
{ MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_PB08) },
30+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) },
31+
{ MP_ROM_QSTR(MP_QSTR_TOUCH1), MP_ROM_PTR(&pin_PB09) },
32+
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) },
33+
{ MP_ROM_QSTR(MP_QSTR_TOUCH3), MP_ROM_PTR(&pin_PB02) },
34+
};
35+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)
0