8000 Add board definition files for ARAMCON2 Badge · adafruit/circuitpython@f0b04d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit f0b04d4

Browse files
committed
Add board definition files for ARAMCON2 Badge
1 parent 0189b80 commit f0b04d4

File tree

6 files changed

+166
-0
lines changed

6 files changed

+166
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ jobs:
184184
- "adafruit_rotary_trinkey_m0"
185185
- "adafruit_slide_trinkey_m0"
186186
- "aloriumtech_evo_m51"
187+
- "aramcon2_badge"
187188
- "aramcon_badge_2019"
188189
- "arduino_mkr1300"
189190
- "arduino_mkrzero"

locale/circuitpython.pot

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3740,6 +3740,10 @@ msgstr ""
37403740
msgid "pressing both buttons at start up.\n"
37413741
msgstr ""
37423742

3743+
#: ports/nrf/boards/aramcon2_badge/mpconfigboard.h
3744+
msgid "pressing the left button at start up\n"
3745+
msgstr ""
3746+
37433747
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
37443748
msgid "pull masks conflict with direction masks"
37453749
msgstr ""
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2021 Uri Shaked
7+
* Copyright (c) 2021 Benjamin Meisels
8+
*
9+
* Permission is hereby granted, free of charge, to any person obtaining a copy
10+
* of this software and associated documentation files (the "Software"), to deal
11+
* in the Software without restriction, including without limitation the rights
12+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
* copies of the Software, and to permit persons to whom the Software is
14+
* furnished to do so, subject to the following conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be included in
17+
* all copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
*/
27+
28+
#include "supervisor/board.h"
29+
#include "common-hal/microcontroller/Pin.h"
30+
31+
void board_init(void) {
32+
}
33+
34+
bool board_requests_safe_mode(void) {
35+
return false;
36+
}
37+
38+
void reset_board(void) {
39+
40+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2021 Uri Shaked
7+
* Copyright (c) 2021 Benjamin Meisels
8+
*
9+
* Permission is hereby granted, free of charge, to any person obtaining a copy
10+
* of this software and associated documentation files (the "Software"), to deal
11+
* in the Software without restriction, including without limitation the rights
12+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
* copies of the Software, and to permit persons to whom the Software is
14+
* furnished to do so, subject to the following conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be included in
17+
* all copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
*/
27+
#include "nrfx/hal/nrf_gpio.h"
28+
29+
#define MICROPY_HW_BOARD_NAME "ARAMCON2 Badge"
30+
#define MICROPY_HW_MCU_NAME "nRF52840"
31+
32+
#define MICROPY_HW_LED_STATUS (&pin_P1_11)
33+
34+
// Board does not have a 32kHz crystal. It does have a 32MHz crystal.
35+
#define BOARD_HAS_32KHZ_XTAL (0)
36+
37+
#ifdef QSPI_FLASH_FILESYSTEM
38+
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 22)
39+
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 20)
40+
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 4)
41+
#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 6)
42+
#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 0)
43+
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 2)
44+
#endif
45+
46+
#ifdef SPI_FLASH_FILESYSTEM
47+
#define SPI_FLASH_MOSI_PIN &pin_P0_20
48+
#define SPI_FLASH_MISO_PIN &pin_P0_22
49+
#define SPI_FLASH_SCK_PIN &pin_P1_00
50+
#define SPI_FLASH_CS_PIN &pin_P1_02
51+
#endif
52+
53+
#define CIRCUITPY_BOOT_BUTTON (&pin_P0_29)
54+
55+
#define BOARD_USER_SAFE_MODE_ACTION translate("pressing the left button at start up\n")
56+
57+
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
58+
59+
#define CIRCUITPY_INTERNAL_NVM_SIZE (4096)
60+
61+
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE)
62+
63+
#define DEFAULT_I2C_BUS_SCL (&pin_P0_28)
64+
#define DEFAULT_I2C_BUS_SDA (&pin_P0_03)
65+
66+
#define DEFAULT_SPI_BUS_SCK (&pin_P0_01)
67+
#define DEFAULT_SPI_BUS_MOSI (&pin_P1_10)
68+
#define DEFAULT_SPI_BUS_MISO (&pin_P1_09)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
USB_VID = 0x239A
2+
USB_PID = 0x807C
3+
USB_PRODUCT = "ARAMCON2 Badge"
4+
USB_MANUFACTURER = "ARAMCON Badge Team"
5+
6+
MCU_CHIP = nrf52840
7+
8+
QSPI_FLASH_FILESYSTEM = 1
9+
EXTERNAL_FLASH_DEVICES = "W25Q128JVxQ"
10+
11+
CIRCUITPY_DISPLAYIO = 1
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#include "shared-bindings/board/__init__.h"
2+
3+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4+
{ MP_ROM_QSTR(MP_QSTR_UP_BUTTON), MP_ROM_PTR(&pin_P0_31) },
5+
{ MP_ROM_QSTR(MP_QSTR_LEFT_BUTTON), MP_ROM_PTR(&pin_P0_29) },
6+
{ MP_ROM_QSTR(MP_QSTR_DOWN_BUTTON), MP_ROM_PTR(&pin_P1_13) },
7+
{ MP_ROM_QSTR(MP_QSTR_RIGHT_BUTTON), MP_ROM_PTR(&pin_P0_02) },
8+
{ MP_ROM_QSTR(MP_QSTR_ACTION_BUTTON), MP_ROM_PTR(&pin_P0_10) },
9+
10+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_11) },
11+
12+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_28) },
13+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_03) },
14+
15+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_01) },
16+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P1_10) },
17+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_09) },
18+
19+
{ MP_ROM_QSTR(MP_QSTR_GPIO1), MP_ROM_PTR(&pin_P0_04) },
20+
{ MP_ROM_QSTR(MP_QSTR_GPIO2), MP_ROM_PTR(&pin_P0_05) },
21+
22+
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_15) },
23+
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_00) },
24+
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_13) },
25+
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_24) },
26+
27+
{ MP_ROM_QSTR(MP_QSTR_DISP_BUSY), MP_ROM_PTR(&pin_P0_26) },
28+
{ MP_ROM_QSTR(MP_QSTR_DISP_CS), MP_ROM_PTR(&pin_P0_07) },
29+
{ MP_ROM_QSTR(MP_QSTR_DISP_DC), MP_ROM_PTR(&pin_P0_12) },
30+
{ MP_ROM_QSTR(MP_QSTR_DISP_RESET), MP_ROM_PTR(&pin_P0_06) },
31+
32+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_08) },
33+
34+
{ MP_ROM_QSTR(MP_QSTR_VIBRATION_MOTOR), MP_ROM_PTR(&pin_P0_17) },
35+
36+
{ MP_ROM_QSTR(MP_QSTR_BATTERY_SENSE), MP_ROM_PTR(&pin_P0_30) },
37+
38+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
39+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
40+
};
41+
42+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)
0