From bb5cdcf9548d2a25a2aabf70e592f624c98bbec5 Mon Sep 17 00:00:00 2001 From: arms22 Date: Thu, 9 Jul 2020 11:26:45 +0900 Subject: [PATCH] Add new board BLE-SS dev board Multi Sensor --- .github/workflows/build.yml | 1 + .../bless_dev_board_multi_sensor/board.c | 12 +++++ .../mpconfigboard.h | 17 +++++++ .../mpconfigboard.mk | 8 ++++ .../bless_dev_board_multi_sensor/pins.c | 45 +++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 ports/nrf/boards/bless_dev_board_multi_sensor/board.c create mode 100644 ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.h create mode 100644 ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.mk create mode 100644 ports/nrf/boards/bless_dev_board_multi_sensor/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa3aee4a5d..adefa8b132 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -142,6 +142,7 @@ jobs: - "arduino_zero" - "bast_pro_mini_m0" - "bdmicro_vina_m0" + - "bless_dev_board_multi_sensor" - "capablerobot_usbhub" - "catwan_usbstick" - "circuitbrains_basic_m0" diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/board.c b/ports/nrf/boards/bless_dev_board_multi_sensor/board.c new file mode 100644 index 0000000000..71b9a06577 --- /dev/null +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/board.c @@ -0,0 +1,12 @@ +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.h b/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.h new file mode 100644 index 0000000000..7fffd86ccd --- /dev/null +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.h @@ -0,0 +1,17 @@ +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "BLE-SS dev board Multi Sensor" +#define MICROPY_HW_MCU_NAME "nRF52840" +#define MICROPY_HW_LED_STATUS (&pin_P0_07) + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_26) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_24) + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_13) /* n.c */ +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_14) /* n.c */ +#define DEFAULT_SPI_BUS_MISO (&pin_P0_15) /* n.c */ + +#define DEFAULT_UART_BUS_RX (&pin_P0_02) /* TP7 */ +#define DEFAULT_UART_BUS_TX (&pin_P0_03) /* TP6 */ + +/* Note: Flash chip is not provided. */ diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.mk b/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.mk new file mode 100644 index 0000000000..90b0908505 --- /dev/null +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x2786 +USB_PID = 0x9207 +USB_PRODUCT = "BLE-SS dev board Multi Sensor" +USB_MANUFACTURER = "Switch Science, Inc." + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c b/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c new file mode 100644 index 0000000000..c6010a8c33 --- /dev/null +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c @@ -0,0 +1,45 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_02) }, // TP7 + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_03) }, // TP6 + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_04) }, // LED1 + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P0_05) }, // U2-BMX055-INT1 + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_06) }, // U2-BMX055-DRDYM + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_07) }, // LED2 + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_08) }, // U4-HDC2010-DRDY/INT + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_09) }, // TP1 + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_10) }, // U3-LPS22HB-INT_DRDY + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_12) }, // S2 + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_P0_23) }, // BZ1 + { MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_P0_28) }, // U2-BMX055-INT4 + { MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_P0_29) }, // U2-BMX055-INT3 + { MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_P0_30) }, // U2-BMX055-INT5 + { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_P0_31) }, // S1 + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_02) }, // A0/TP7 + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_03) }, // A1/TP6 + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_24) }, // 24 - SDA + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_26) }, // 26 - SCL + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_13) }, // 13 - MISO (n.c) + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_14) }, // 14 - MOSI (n.c) + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_15) }, // 15 - SCK (n.c) + + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_P0_07) }, // 4 - LED1 + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_P0_04) }, // 7 - LED2 + + { MP_ROM_QSTR(MP_QSTR_BUTTON1), MP_ROM_PTR(&pin_P0_31) }, // 31 - S1 + { MP_ROM_QSTR(MP_QSTR_BUTTON2), MP_ROM_PTR(&pin_P0_12) }, // 12 - S2 + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_02) }, // 2 - UART RX + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_03) }, // 3 - UART TX + + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_QWIIC), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);