From f7e735b492c4bf270ba8312a4459ac2cea4b17a4 Mon Sep 17 00:00:00 2001 From: Pontus Oldberg Date: Sun, 11 Dec 2022 17:11:24 +0100 Subject: [PATCH] Added LDO control pin, new flash variants and support functions for the LDO control pin. --- ports/nrf/boards/challenger_840/board.c | 11 ----------- ports/nrf/boards/challenger_840/challenger_840.py | 14 ++++++++++++++ ports/nrf/boards/challenger_840/mpconfigboard.mk | 6 +++++- 3 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 ports/nrf/boards/challenger_840/challenger_840.py diff --git a/ports/nrf/boards/challenger_840/board.c b/ports/nrf/boards/challenger_840/board.c index 677b6eac8b..14a52fc4de 100644 --- a/ports/nrf/boards/challenger_840/board.c +++ b/ports/nrf/boards/challenger_840/board.c @@ -23,14 +23,3 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ - -#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/challenger_840.py b/ports/nrf/boards/challenger_840/challenger_840.py new file mode 100644 index 0000000000..b40ae22b41 --- /dev/null +++ b/ports/nrf/boards/challenger_840/challenger_840.py @@ -0,0 +1,14 @@ +import board +import digitalio + +_LDO_PIN = digitalio.DigitalInOut(board.LDO_CONTROL) +_LDO_PIN.direction = digitalio.Direction.OUTPUT +_LDO_PIN.value = True + +def ldo_on(): + global _LDO_PIN + _LDO_PIN.value = True + +def ldo_off(): + global _LDO_PIN + _LDO_PIN.value = False diff --git a/ports/nrf/boards/challenger_840/mpconfigboard.mk b/ports/nrf/boards/challenger_840/mpconfigboard.mk index ddb55ce705..03cbc20b21 100644 --- a/ports/nrf/boards/challenger_840/mpconfigboard.mk +++ b/ports/nrf/boards/challenger_840/mpconfigboard.mk @@ -6,4 +6,8 @@ USB_MANUFACTURER = "Invector Labs AB" MCU_CHIP = nrf52840 SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ,W25Q32FV,W25Q64FV" +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ,W25Q32FV,W25Q32JVxQ,W25Q64FV,W25Q64JVxQ" + +FROZEN_MPY_DIRS += $(TOP)/ports/nrf/boards/challenger_840 +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BLE +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel