Skip to content

Commit 23b23dd

Browse files
authored
Merge pull request #1158 from dhalbert/nrf-pin-claiming
nrf: rework of pin files; add new boards; add pin claiming
2 parents a0872e8 + 100603a commit 23b23dd

File tree

70 files changed

+1312
-425
lines changed

Some content is hidden

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

70 files changed

+1312
-425
lines changed

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@
115115
"ports/minimal",
116116
"ports/nrf/device",
117117
"ports/nrf/drivers",
118-
"ports/nrf/hal",
119118
"ports/nrf/modules",
120119
"ports/nrf/nrfx",
120+
"ports/nrf/peripherals",
121121
"ports/nrf/usb",
122122
"ports/pic16bit",
123123
"ports/qemu-arm",

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ void NORETURN __fatal_error(const char *msg) {
451451

452452
#ifndef NDEBUG
453453
void MP_WEAK __assert_func(const char *file, int line, const char *func, const char *expr) {
454-
printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
454+
mp_printf(&mp_plat_print, "Assertion '%s' failed, at file %s:%d\n", expr, file, line);
455455
__fatal_error("Assertion failed");
456456
}
457457
#endif

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ bool board_requests_safe_mode(void) {
4848
gpio_set_pin_pull_mode(PIN_PA28, GPIO_PULL_DOWN);
4949
bool safe_mode = gpio_get_pin_level(PIN_PA14) &&
5050
gpio_get_pin_level(PIN_PA28);
51-
reset_pin(PIN_PA14);
52-
reset_pin(PIN_PA28);
51+
reset_pin_number(PIN_PA14);
52+
reset_pin_number(PIN_PA28);
5353
return safe_mode;
5454
}
5555

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ bool board_requests_safe_mode(void) {
4848
gpio_set_pin_pull_mode(PIN_PA28, GPIO_PULL_DOWN);
4949
bool safe_mode = gpio_get_pin_level(PIN_PA14) &&
5050
gpio_get_pin_level(PIN_PA28);
51-
reset_pin(PIN_PA14);
52-
reset_pin(PIN_PA28);
51+
reset_pin_number(PIN_PA14);
52+
reset_pin_number(PIN_PA28);
5353
return safe_mode;
5454
}
5555

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
2121

2222
{ MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA00) },
2323
{ MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PA01) },
24+
2425
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
2526
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
2627
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },

ports/atmel-samd/common-hal/analogio/AnalogIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) {
8080
if (common_hal_analogio_analogin_deinited(self)) {
8181
return;
8282
}
83-
reset_pin(self->pin->number);
83+
reset_pin_number(self->pin->number);
8484
self->pin = mp_const_none;
8585
}
8686

ports/atmel-samd/common-hal/analogio/AnalogOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) {
113113
return;
114114
}
115115
dac_sync_disable_channel(&self->descriptor, self->channel);
116-
reset_pin(PIN_PA02);
116+
reset_pin_number(PIN_PA02);
117117
// Only deinit the DAC on the SAMD51 if both outputs are free.
118118
#ifdef SAMD51
119119
if (common_hal_mcu_pin_is_free(&pin_PA02) && common_hal_mcu_pin_is_free(&pin_PA05)) {

ports/atmel-samd/common-hal/audiobusio/I2SOut.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,11 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) {
212212
return;
213213
}
214214

215-
reset_pin(self->bit_clock->number);
215+
reset_pin_number(self->bit_clock->number);
216216
self->bit_clock = mp_const_none;
217-
reset_pin(self->word_select->number);
217+
reset_pin_number(self->word_select->number);
218218
self->word_select = mp_const_none;
219-
reset_pin(self->data->number);
219+
reset_pin_number(self->data->number);
220220
self->data = mp_const_none;
221221
}
222222

ports/atmel-samd/common-hal/audiobusio/PDMIn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) {
235235
disconnect_gclk_from_peripheral(self->gclk, I2S_GCLK_ID_0 + self->clock_unit);
236236
disable_clock_generator(self->gclk);
237237

238-
reset_pin(self->clock_pin->number);
239-
reset_pin(self->data_pin->number);
238+
reset_pin_number(self->clock_pin->number);
239+
reset_pin_number(self->data_pin->number);
240240
self->clock_pin = mp_const_none;
241241
self->data_pin = mp_const_none;
242242
}

ports/atmel-samd/common-hal/audioio/AudioOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ void common_hal_audioio_audioout_deinit(audioio_audioout_obj_t* self) {
248248

249249
tc_set_enable(tc_insts[self->tc_index], false);
250250

251-
reset_pin(self->left_channel->number);
251+
reset_pin_number(self->left_channel->number);
252252
self->left_channel = mp_const_none;
253253
#ifdef SAMD51
254-
reset_pin(self->right_channel->number);
254+
reset_pin_number(self->right_channel->number);
255255
self->right_channel = mp_const_none;
256256
#endif
257257
}

0 commit comments

Comments
 (0)