Skip to content

Commit 765a54a

Browse files
authored
Merge pull request #2525 from aramcon-badge/badge_2019_upstream
Add board definition files for AramCon Badge 2019
2 parents f496b6c + 4bf10a7 commit 765a54a

File tree

5 files changed

+120
-0
lines changed

5 files changed

+120
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
fail-fast: false
7474
matrix:
7575
board:
76+
- "aramcon_badge_2019"
7677
- "arduino_mkr1300"
7778
- "arduino_mkrzero"
7879
- "arduino_nano_33_ble"
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) 2019 Uri Shaked
7+
* Copyright (c) 2019 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 "boards/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: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include "nrfx/hal/nrf_gpio.h"
2+
3+
#define MICROPY_HW_BOARD_NAME "ARAMCON Badge 2019"
4+
#define MICROPY_HW_MCU_NAME "nRF52840"
5+
6+
#define MICROPY_HW_LED_STATUS (&pin_P1_11)
7+
8+
#ifdef QSPI_FLASH_FILESYSTEM
9+
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 22)
10+
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 20)
11+
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 4)
12+
#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(1, 6)
13+
#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 0)
14+
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 2)
15+
#endif
16+
17+
#ifdef SPI_FLASH_FILESYSTEM
18+
#define SPI_FLASH_MOSI_PIN &pin_P0_20
19+
#define SPI_FLASH_MISO_PIN &pin_P0_22
20+
#define SPI_FLASH_SCK_PIN &pin_P1_00
21+
#define SPI_FLASH_CS_PIN &pin_P1_02
22+
#endif
23+
24+
#define BOARD_HAS_32KHZ_XTAL 0
25+
26+
#define DEFAULT_I2C_BUS_SCL (&pin_P0_28)
27+
#define DEFAULT_I2C_BUS_SDA (&pin_P0_03)
28+
29+
#define DEFAULT_SPI_BUS_SCK (&pin_P0_01)
30+
#define DEFAULT_SPI_BUS_MOSI (&pin_P1_10)
31+
#define DEFAULT_SPI_BUS_MISO (&pin_P1_09)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
USB_VID = 0x239A
2+
USB_PID = 0x807A
3+
USB_PRODUCT = "ARAMCON Badge 2019"
4+
USB_MANUFACTURER = "ARAMCON Badge Team"
5+
6+
MCU_CHIP = nrf52840
7+
8+
QSPI_FLASH_FILESYSTEM = 1
9+
EXTERNAL_FLASH_DEVICE_COUNT = 1
10+
EXTERNAL_FLASH_DEVICES = "GD25Q16C"
11+
12+
CIRCUITPY_DISPLAYIO = 1
13+
14+
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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_LEFT_BUTTON), MP_ROM_PTR(&pin_P0_02) },
5+
{ MP_ROM_QSTR(MP_QSTR_MIDDLE_BUTTON), MP_ROM_PTR(&pin_P0_29) },
6+
{ MP_ROM_QSTR(MP_QSTR_RIGHT_BUTTON), MP_ROM_PTR(&pin_P0_31) },
7+
8+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_11) },
9+
10+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_28) },
11+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_03) },
12+
13+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_01) },
14+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P1_10) },
15+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_09) },
16+
17+
{ MP_ROM_QSTR(MP_QSTR_SND_CS), MP_ROM_PTR(&pin_P1_13) },
18+
{ MP_ROM_QSTR(MP_QSTR_SND_DREQ), MP_ROM_PTR(&pin_P0_13) },
19+
{ MP_ROM_QSTR(MP_QSTR_SND_RESET), MP_ROM_PTR(&pin_P0_00) },
20+
{ MP_ROM_QSTR(MP_QSTR_SND_XDCS), MP_ROM_PTR(&pin_P0_24) },
21+
22+
{ MP_ROM_QSTR(MP_QSTR_DISP_BUSY), MP_ROM_PTR(&pin_P0_26) },
23+
{ MP_ROM_QSTR(MP_QSTR_DISP_CS), MP_ROM_PTR(&pin_P0_07) },
24+
{ MP_ROM_QSTR(MP_QSTR_DISP_DC), MP_ROM_PTR(&pin_P0_12) },
25+
{ MP_ROM_QSTR(MP_QSTR_DISP_RESET), MP_ROM_PTR(&pin_P0_06) },
26+
27+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_08) },
28+
29+
{ MP_ROM_QSTR(MP_QSTR_VIBRATION_MOTOR), MP_ROM_PTR(&pin_P0_17) },
30+
31+
{ MP_ROM_QSTR(MP_QSTR_BATTERY_SENSE), MP_ROM_PTR(&pin_P0_30) },
32+
};
33+
34+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)