Skip to content

Commit 13cba8a

Browse files
authored
Merge pull request #5224 from dhalbert/adafruit_led_glasses_nrf52840
Add adafruit_led_glasses_nrf52840
2 parents c05d303 + c0c9892 commit 13cba8a

File tree

5 files changed

+98
-0
lines changed

5 files changed

+98
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ jobs:
209209
- "TG-Watch"
210210
- "adafruit_feather_rp2040"
211211
- "adafruit_itsybitsy_rp2040"
212+
- "adafruit_led_glasses_nrf52840"
212213
- "adafruit_macropad_rp2040"
213214
- "adafruit_neokey_trinkey_m0"
214215
- "adafruit_proxlight_trinkey_m0"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "supervisor/board.h"
28+
29+
void board_init(void) {
30+
}
31+
32+
bool board_requests_safe_mode(void) {
33+
return false;
34+
}
35+
36+
void reset_board(void) {
37+
38+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include "nrfx/hal/nrf_gpio.h"
2+
3+
#define MICROPY_HW_BOARD_NAME "Adafruit LED Glasses Driver nRF52840"
4+
#define MICROPY_HW_MCU_NAME "nRF52840"
5+
6+
#define MICROPY_HW_NEOPIXEL (&pin_P1_15)
7+
8+
#define MICROPY_HW_LED_STATUS (&pin_P0_31)
9+
10+
#if QSPI_FLASH_FILESYSTEM
11+
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 00)
12+
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
13+
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
14+
#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 23)
15+
#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19)
16+
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20)
17+
#endif
18+
19+
#if SPI_FLASH_FILESYSTEM
20+
#define SPI_FLASH_MOSI_PIN &pin_P1_00
21+
#define SPI_FLASH_MISO_PIN &pin_P0_21
22+
#define SPI_FLASH_SCK_PIN &pin_P0_19
23+
#define SPI_FLASH_CS_PIN &pin_P0_20
24+
#endif
25+
26+
// Board does not have a 32kHz crystal. It does have a 32MHz crystal, in the module.
27+
#define BOARD_HAS_32KHZ_XTAL (0)
28+
29+
#define DEFAULT_I2C_BUS_SCL (&pin_P0_14)
30+
#define DEFAULT_I2C_BUS_SDA (&pin_P0_16)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
USB_VID = 0x239A
2+
USB_PID = 0x810E
3+
USB_PRODUCT = "nRF52840 LED Glasses Driver"
4+
USB_MANUFACTURER = "Adafruit Industries LLC"
5+
6+
MCU_CHIP = nrf52840
7+
8+
9+
QSPI_FLASH_FILESYSTEM = 1
10+
EXTERNAL_FLASH_DEVICES = "GD25Q16C"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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_MICROPHONE_CLOCK), MP_ROM_PTR(&pin_P0_00) },
5+
{ MP_ROM_QSTR(MP_QSTR_MICROPHONE_DATA), MP_ROM_PTR(&pin_P0_27) },
6+
7+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P1_15) },
8+
9+
{ MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_P0_30) },
10+
11+
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_31) },
12+
13+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_08) },
14+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_05) },
15+
16+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
17+
};
18+
19+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)