diff options
| author | hathach <thach@tinyusb.org> | 2018-09-19 14:40:37 +0700 |
|---|---|---|
| committer | hathach <thach@tinyusb.org> | 2018-09-19 14:40:37 +0700 |
| commit | 1df3bcf39227f6a71dbed5c2016e4603b70a92ef (patch) | |
| tree | 62dfcef00fc6d5c2901dc728649f763aa01f4056 | |
| parent | d8c8c5f0058b7184259d537178b16910271d6d5f (diff) | |
add board.UART() function
| -rwxr-xr-x | ports/nrf/Makefile | 1 | ||||
| -rw-r--r-- | ports/nrf/boards/pca10056/mpconfigboard.h | 9 | ||||
| -rw-r--r-- | ports/nrf/boards/pca10056/pins.c | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 0e9d224be..d48b20fd3 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -100,6 +100,7 @@ SRC_C += \ internal_flash.c \ mphalport.c \ tick.c \ + board_busses.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ device/$(MCU_VARIANT)/startup_$(MCU_SUB_VARIANT).c \ diff --git a/ports/nrf/boards/pca10056/mpconfigboard.h b/ports/nrf/boards/pca10056/mpconfigboard.h index 0f3451602..5aa2191f7 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.h +++ b/ports/nrf/boards/pca10056/mpconfigboard.h @@ -28,11 +28,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "nRF52840-DK" -// See legend on bottom of board -#define MICROPY_HW_UART_RX NRF_GPIO_PIN_MAP(0, 8) -#define MICROPY_HW_UART_TX NRF_GPIO_PIN_MAP(0, 6) -#define MICROPY_HW_UART_HWFC (0) - #define PORT_HEAP_SIZE (128 * 1024) #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 @@ -43,5 +38,5 @@ #define DEFAULT_SPI_BUS_MOSI (&pin_P1_13) #define DEFAULT_SPI_BUS_MISO (&pin_P1_14) -#define DEFAULT_UART_BUS_RX (&pin_P1_01) -#define DEFAULT_UART_BUS_TX (&pin_P1_02) +#define DEFAULT_UART_BUS_RX (&pin_P0_08) +#define DEFAULT_UART_BUS_TX (&pin_P0_06) diff --git a/ports/nrf/boards/pca10056/pins.c b/ports/nrf/boards/pca10056/pins.c index 1c208f89b..a57c9d1c9 100644 --- a/ports/nrf/boards/pca10056/pins.c +++ b/ports/nrf/boards/pca10056/pins.c @@ -124,6 +124,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P1_15), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); |
