From da413094f8fa3fcc1043fe85796973a364d73e15 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Sun, 11 Dec 2022 13:01:00 +0100 Subject: [PATCH] Added LDO control pin and initial setup --- ports/nrf/boards/challenger_840/board.c | 7 +++++++ ports/nrf/boards/challenger_840/pins.c | 1 + 2 files changed, 8 insertions(+) diff --git a/ports/nrf/boards/challenger_840/board.c b/ports/nrf/boards/challenger_840/board.c index fb1ce4fb83..677b6eac8b 100644 --- a/ports/nrf/boards/challenger_840/board.c +++ b/ports/nrf/boards/challenger_840/board.c @@ -25,5 +25,12 @@ */ #include "supervisor/board.h" +#include "nrf_gpio.h" + +#define PORTPIN(x, y) (x * 32 + y) // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. +void board_init(void) { + nrf_gpio_cfg_output(PORTPIN(1, 9)); + nrf_gpio_pin_write(PORTPIN(1, 9), 1); +} diff --git a/ports/nrf/boards/challenger_840/pins.c b/ports/nrf/boards/challenger_840/pins.c index 26d780fffe..e059c17a15 100644 --- a/ports/nrf/boards/challenger_840/pins.c +++ b/ports/nrf/boards/challenger_840/pins.c @@ -32,6 +32,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_LDO_CONTROL), MP_ROM_PTR(&pin_P1_09) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_12) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_11) },