Skip to content

Commit b9063dd

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 9d4c95d + e3638ff commit b9063dd

File tree

49 files changed

+576
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+576
-104
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
board:
7676
- "arduino_mkr1300"
7777
- "arduino_mkrzero"
78+
- "arduino_nano_33_ble"
7879
- "arduino_zero"
7980
- "bast_pro_mini_m0"
8081
- "capablerobot_usbhub"
@@ -109,6 +110,7 @@ jobs:
109110
- "hallowing_m4_express"
110111
- "itsybitsy_m0_express"
111112
- "itsybitsy_m4_express"
113+
- "itsybitsy_nrf52840_express"
112114
- "kicksat-sprite"
113115
- "makerdiary_nrf52840_mdk"
114116
- "makerdiary_nrf52840_mdk_usb_dongle"

locale/de_DE.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ msgstr ""
737737

738738
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
739739
msgid "Frequency captured is above capability. Capture Paused."
740-
msgstr ""
740+
msgstr "Die aufgezeichnete Frequenz liegt über der Leistungsgrenze. Aufnahme angehalten."
741741

742742
#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c
743743
#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c

ports/atmel-samd/boards/pyportal_titano/board.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,24 +74,21 @@ uint8_t display_init_sequence[] = {
7474
0x11, 0x1d, 0x23, 0x35, 0x41, 0x4b, 0x4b, 0x42, 0x3A,
7575
0x27, 0x1B, 0x08, 0x09, 0x03, 0x00, 0x01,
7676
0x3a, 1, 0x55,
77-
0x36, 1, 0x00,
77+
0x36, 1, 0x60,
7878
0x11, DELAY, 150/5, // Exit Sleep, then delay 150 ms
7979
0x29, DELAY, 50/5
8080
};
8181

8282
void board_init(void) {
83-
busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus;
84-
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, &pin_PA14);
85-
common_hal_busio_spi_never_reset(spi);
86-
87-
displayio_fourwire_obj_t* bus = &displays[0].fourwire_bus;
88-
bus->base.type = &displayio_fourwire_type;
89-
common_hal_displayio_fourwire_construct(bus,
90-
spi,
91-
&pin_PB05, // TFT_DC Command or data
92-
&pin_PB06, // TFT_CS Chip select
93-
&pin_PA00, // TFT_RST Reset
94-
24000000);
83+
displayio_parallelbus_obj_t* bus = &displays[0].parallel_bus;
84+
bus->base.type = &displayio_parallelbus_type;
85+
common_hal_displayio_parallelbus_construct(bus,
86+
&pin_PA16, // Data0
87+
&pin_PB05, // Command or data
88+
&pin_PB06, // Chip select
89+
&pin_PB09, // Write
90+
&pin_PB04, // Read
91+
&pin_PA00); // Reset
9592

9693
displayio_display_obj_t* display = &displays[0].display;
9794
display->base.type = &displayio_display_type;
@@ -101,7 +98,7 @@ void board_init(void) {
10198
320, // Height
10299
0, // column start
103100
0, // row start
104-
270, // rotation
101+
0, // rotation
105102
16, // Color depth
106103
false, // grayscale
107104
false, // pixels_in_byte_share_row (unused for depths > 8)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#define CIRCUITPY_MCU_FAMILY samd51
55

6-
76
#define MICROPY_HW_LED_STATUS (&pin_PA27)
87

98
#define MICROPY_HW_NEOPIXEL (&pin_PB22)

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
8080
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
8181
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
8282

83-
// TFT control pins
84-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_LITE), MP_ROM_PTR(&pin_PB31)},
85-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_PA12)},
86-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_SCK), MP_ROM_PTR(&pin_PA13)},
87-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_MISO), MP_ROM_PTR(&pin_PA14)},
88-
{MP_OBJ_NEW_QSTR(MP_QSTR_TFT_RST), MP_ROM_PTR(&pin_PA00)},
89-
{MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_PB06)},
90-
{MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_PB05)},
91-
9283
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) },
9384
};
9485
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

ports/atmel-samd/common-hal/busio/I2C.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
116116
if (i2c_m_sync_set_baudrate(&self->i2c_desc, 0, frequency / 1000) != ERR_NONE) {
117117
reset_pin_number(sda->number);
118118
reset_pin_number(scl->number);
119+
common_hal_busio_i2c_deinit(self);
119120
mp_raise_ValueError(translate("Unsupported baudrate"));
120121
}
121122

ports/atmel-samd/common-hal/pulseio/PWMOut.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
135135
bool variable_frequency) {
136136
self->pin = pin;
137137
self->variable_frequency = variable_frequency;
138+
self->duty_cycle = duty;
138139

139140
if (pin->timer[0].index >= TC_INST_NUM &&
140141
pin->timer[1].index >= TCC_INST_NUM
@@ -322,6 +323,13 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
322323
}
323324

324325
extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) {
326+
// Store the unadjusted duty cycle. It turns out the the process of adjusting and calculating
327+
// the duty cycle here and reading it back is lossy - the value will decay over time.
328+
// Track it here so that if frequency is changed we can use this value to recalculate the
329+
// proper duty cycle.
330+
// See https://github.com/adafruit/circuitpython/issues/2086 for more details
331+
self->duty_cycle = duty;
332+
325333
const pin_timer_t* t = self->timer;
326334
if (t->is_tc) {
327335
uint16_t adjusted_duty = tc_periods[t->index] * duty / 0xffff;
@@ -415,7 +423,6 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
415423
break;
416424
}
417425
}
418-
uint16_t old_duty = common_hal_pulseio_pwmout_get_duty_cycle(self);
419426
if (t->is_tc) {
420427
Tc* tc = tc_insts[t->index];
421428
uint8_t old_divisor = tc->COUNT16.CTRLA.bit.PRESCALER;
@@ -450,7 +457,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
450457
#endif
451458
}
452459

453-
common_hal_pulseio_pwmout_set_duty_cycle(self, old_duty);
460+
common_hal_pulseio_pwmout_set_duty_cycle(self, self->duty_cycle);
454461
}
455462

456463
uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {

ports/atmel-samd/common-hal/pulseio/PWMOut.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ typedef struct {
3636
const mcu_pin_obj_t *pin;
3737
const pin_timer_t* timer;
3838
bool variable_frequency;
39+
uint16_t duty_cycle;
3940
} pulseio_pwmout_obj_t;
4041

4142
void pwmout_reset(void);

ports/cxd56/boards/spresense/mpconfigboard.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#define MICROPY_HW_BOARD_NAME "SPRESENSE"
2828
#define MICROPY_HW_MCU_NAME "CXD5602"
29-
#define MICROPY_PY_SYS_PLATFORM "SPRESENSE"
3029

3130
#define DEFAULT_I2C_BUS_SCL (&pin_I2C0_BCK)
3231
#define DEFAULT_I2C_BUS_SDA (&pin_I2C0_BDT)

ports/cxd56/mpconfigport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#ifndef __INCLUDED_MPCONFIGPORT_H
2828
#define __INCLUDED_MPCONFIGPORT_H
2929

30+
#define MICROPY_PY_SYS_PLATFORM "CXD56"
31+
3032
// 64kiB stack
3133
#define CIRCUITPY_DEFAULT_STACK_SIZE 0x10000
3234

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Arduino Nano 33 BLE and Nano 33 BLE Sense
2+
3+
The [Arduino Nano 33 BLE](https://store.arduino.cc/usa/nano-33-ble-with-headers) and
4+
[Arduino Nano 33 BLE Sense](https://store.arduino.cc/usa/nano-33-ble-sense) and
5+
are built around the NINA B306 module, based on Nordic nRF 52840 and containing
6+
a powerful Cortex M4F. Both include an onboard 9 axis Inertial Measurement Unit (IMU), the LSM9DS1.
7+
The Nano 33 BLE Sense adds an LPS22HB barometric pressure and temperature sensor,
8+
an ADPS-9960 digital proximity, ambient light, RGB, and gensture sensor,
9+
and an MP34DT05 digital microphone.
10+
11+
Note: the Arduino Nano 33 BLE and BLE Sense do not include a QSPI external
12+
flash. Any Python code will need to be stored on the internal flash
13+
filesystem.
14+
15+
I2C pins `board.SCL1` and `board.SDA1` are not exposed and are used for onboard peripherals.
16+
Pin `board.R_PULLUP` must be set to high to enable the `SCL1` and `SDA1` pullups for proper operation.
17+
18+
Pin `board.VDD_ENV` applies power to the LSM9DS1, and must be high for it to be operational.
19+
20+
Pins `board.MIC_PWR`, `board.PDMDIN`, and `board.PDMCLK` are for the Nano 33 BLE Sense onboard microphone.
21+
22+
Pin `board.INT_ADPS` is the interrupt pin from the ADPS-9960.
23+
24+
Pins `board.RGB_LED_R`, `board.RGB_LED_G`, and `board.RGB_LED_B`
25+
are the red, green and blue LEDS in the onboard RGB LED.
26+
27+
Pins `board.LED_G` and `board.LED_Y` are onboard green and red LEDs. `board.LED_Y` is also `board.SCK`.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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 "boards/board.h"
28+
#include "nrf.h"
29+
#include "nrf_rtc.h"
30+
31+
void board_init(void) {
32+
// Initializations below from Arduino variant.cpp.
33+
34+
// // turn power LED on
35+
// pinMode(LED_PWR, OUTPUT);
36+
// digitalWrite(LED_PWR, HIGH);
37+
38+
// Errata Nano33BLE - I2C pullup is on SWO line, need to disable TRACE
39+
// was being enabled by nrfx_clock_anomaly_132
40+
CoreDebug->DEMCR = 0;
41+
NRF_CLOCK->TRACECONFIG = 0;
42+
43+
// FIXME: bootloader enables interrupt on COMPARE[0], which we don't handle
44+
// Disable it here to avoid getting stuck when OVERFLOW irq is triggered
45+
nrf_rtc_event_disable(NRF_RTC1, NRF_RTC_INT_COMPARE0_MASK);
46+
nrf_rtc_int_disable(NRF_RTC1, NRF_RTC_INT_COMPARE0_MASK);
47+
48+
// // FIXME: always enable I2C pullup and power @startup
49+
// // Change for maximum powersave
50+
// pinMode(PIN_ENABLE_SENSORS_3V3, OUTPUT);
51+
// pinMode(PIN_ENABLE_I2C_PULLUP, OUTPUT);
52+
53+
// digitalWrite(PIN_ENABLE_SENSORS_3V3, HIGH);
54+
// digitalWrite(PIN_ENABLE_I2C_PULLUP, HIGH);
55+
}
56+
57+
bool board_requests_safe_mode(void) {
58+
return false;
59+
}
60+
61+
void reset_board(void) {
62+
63+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include "nrfx/hal/nrf_gpio.h"
2+
3+
#define MICROPY_HW_BOARD_NAME "Arduino Nano 33 BLE"
4+
#define MICROPY_HW_MCU_NAME "nRF52840"
5+
6+
#define CIRCUITPY_AUTORELOAD_DELAY_MS 500
7+
8+
#define DEFAULT_I2C_BUS_SCL (&pin_P0_02)
9+
#define DEFAULT_I2C_BUS_SDA (&pin_P0_31)
10+
11+
#define DEFAULT_SPI_BUS_SCK (&pin_P0_13)
12+
#define DEFAULT_SPI_BUS_MOSI (&pin_P0_01)
13+
#define DEFAULT_SPI_BUS_MISO (&pin_P1_08)
14+
15+
#define DEFAULT_UART_BUS_RX (&pin_P1_10)
16+
#define DEFAULT_UART_BUS_TX (&pin_P1_03)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
USB_VID = 0x2341
2+
USB_PID = 0x805A
3+
USB_PRODUCT = "Arduino_Nano_33_BLE"
4+
USB_MANUFACTURER = "Arduino"
5+
6+
MCU_SERIES = m4
7+
MCU_VARIANT = nrf52
8+
MCU_SUB_VARIANT = nrf52840
9+
MCU_CHIP = nrf52840
10+
SD ?= s140
11+
SOFTDEV_VERSION ?= 6.1.0
12+
13+
BOOT_SETTING_ADDR = 0xFF000
14+
15+
ifeq ($(SD),)
16+
LD_FILE = boards/nrf52840_1M_256k.ld
17+
else
18+
LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld
19+
CIRCUITPY_BLEIO = 1
20+
endif
21+
22+
NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
23+
24+
INTERNAL_FLASH_FILESYSTEM = 1
25+
26+
# Allocate two, not just one I2C peripheral, so that we have both
27+
# on-board and off-board I2C available.
28+
# When SPIM3 becomes available we'll be able to have two I2C and two SPI peripherals.
29+
# We use a CFLAGS define here because there are include order issues
30+
# if we try to include "mpconfigport.h" into nrfx_config.h .
31+
CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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_D2), MP_ROM_PTR(&pin_P1_11) },
5+
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_12) },
6+
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_15) },
7+
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_13) },
8+
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P1_14) },
9+
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_23) },
10+
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_21) },
11+
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_27) },
12+
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P1_02) },
13+
14+
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_04) },
15+
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) },
16+
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_30) },
17+
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_29) },
18+
19+
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_31) },
20+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_31) },
21+
22+
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_02) },
23+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_02) },
24+
25+
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_28) },
26+
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_P0_03) },
27+
28+
{ MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_P0_14) },
29+
{ MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_P0_15) },
30+
31+
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P1_01) },
32+
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_08) },
33+
34+
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_13) },
35+
{ MP_ROM_QSTR(MP_QSTR_LED_Y), MP_ROM_PTR(&pin_P0_13) },
36+
37+
{ MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P1_09) },
38+
39+
{ MP_ROM_QSTR(MP_QSTR_RGB_LED_R), MP_ROM_PTR(&pin_P0_24) },
40+
{ MP_ROM_QSTR(MP_QSTR_RGB_LED_G), MP_ROM_PTR(&pin_P0_16) },
41+
{ MP_ROM_QSTR(MP_QSTR_RGB_LED_B), MP_ROM_PTR(&pin_P0_06) },
42+
43+
// Power line to LSM9DS1.
44+
{ MP_ROM_QSTR(MP_QSTR_VDD_ENV), MP_ROM_PTR(&pin_P0_22) },
45+
46+
// Pullup voltage for SDA1 and SCL1
47+
{ MP_ROM_QSTR(MP_QSTR_R_PULLUP), MP_ROM_PTR(&pin_P1_00) },
48+
49+
{ MP_ROM_QSTR(MP_QSTR_MIC_PWR), MP_ROM_PTR(&pin_P0_17) },
50+
{ MP_ROM_QSTR(MP_QSTR_PDMCLK), MP_ROM_PTR(&pin_P0_26) },
51+
{ MP_ROM_QSTR(MP_QSTR_PDMDIN), MP_ROM_PTR(&pin_P0_25) },
52+
53+
{ MP_ROM_QSTR(MP_QSTR_INT_APDS), MP_ROM_PTR(&pin_P0_19) },
54+
55+
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P1_03) },
56+
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P1_10) },
57+
58+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
59+
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
60+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
61+
};
62+
63+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
#define MICROPY_HW_BOARD_NAME "Adafruit Circuit Playground Bluefruit"
3131
#define MICROPY_HW_MCU_NAME "nRF52840"
32-
#define MICROPY_PY_SYS_PLATFORM "CircuitPlaygroundBluefruit"
3332

3433
#define FLASH_SIZE (0x100000)
3534
#define FLASH_PAGE_SIZE (4096)
@@ -70,3 +69,5 @@
7069

7170
#define DEFAULT_UART_BUS_RX (&pin_P0_30)
7271
#define DEFAULT_UART_BUS_TX (&pin_P0_14)
72+
73+
#define SPEAKER_ENABLE_PIN (&pin_P1_04)

ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840
2424
QSPI_FLASH_FILESYSTEM = 1
2525
EXTERNAL_FLASH_DEVICE_COUNT = 1
2626
EXTERNAL_FLASH_DEVICES = "GD25Q16C"
27+
28+
# Allocate two, not just one I2C peripheral for CPB, so that we have both
29+
# on-board and off-board I2C available.
30+
# When SPIM3 becomes available we'll be able to have two I2C and two SPI peripherals.
31+
# We use a CFLAGS define here because there are include order issues
32+
# if we try to include "mpconfigport.h" into nrfx_config.h .
33+
CFLAGS += -DCIRCUITPY_NRF_NUM_I2C=2

0 commit comments

Comments
 (0)