initial BlueMicro8333 Files
This commit is contained in:
parent
45caaa8e2b
commit
e946dcffff
65
ports/nrf/boards/bluemicro833/board.c
Normal file
65
ports/nrf/boards/bluemicro833/board.c
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2018 Scott Shawcroft for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "supervisor/board.h"
|
||||
|
||||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "py/obj.h"
|
||||
#include "peripherals/nrf/pins.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
||||
#include "nrf_gpio.h"
|
||||
|
||||
void board_init(void) {
|
||||
// Turn on power to sensors and neopixels.
|
||||
nrf_gpio_cfg(POWER_SWITCH_PIN->number,
|
||||
NRF_GPIO_PIN_DIR_OUTPUT,
|
||||
NRF_GPIO_PIN_INPUT_DISCONNECT,
|
||||
NRF_GPIO_PIN_NOPULL,
|
||||
NRF_GPIO_PIN_S0S1,
|
||||
NRF_GPIO_PIN_NOSENSE);
|
||||
nrf_gpio_pin_write(POWER_SWITCH_PIN->number, true);
|
||||
}
|
||||
|
||||
void board_deinit(void) {
|
||||
// Turn off power to sensors and neopixels.
|
||||
nrf_gpio_cfg(POWER_SWITCH_PIN->number,
|
||||
NRF_GPIO_PIN_DIR_OUTPUT,
|
||||
NRF_GPIO_PIN_INPUT_DISCONNECT,
|
||||
NRF_GPIO_PIN_NOPULL,
|
||||
NRF_GPIO_PIN_S0S1,
|
||||
NRF_GPIO_PIN_NOSENSE);
|
||||
nrf_gpio_pin_write(POWER_SWITCH_PIN->number, false);
|
||||
}
|
||||
|
||||
bool board_requests_safe_mode(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void reset_board(void) {
|
||||
board_reset_user_neopixels(&pin_P0_7, 1);
|
||||
}
|
58
ports/nrf/boards/bluemicro833/mpconfigboard.h
Normal file
58
ports/nrf/boards/bluemicro833/mpconfigboard.h
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2016 Glenn Ruben Bakke
|
||||
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "nrfx/hal/nrf_gpio.h"
|
||||
|
||||
#define MICROPY_HW_BOARD_NAME "BlueMicro833"
|
||||
#define MICROPY_HW_MCU_NAME "nRF52833"
|
||||
|
||||
#define MICROPY_HW_NEOPIXEL (&pin_P0_7)
|
||||
#define MICROPY_HW_LED_STATUS (&pin_P0_25)
|
||||
|
||||
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
|
||||
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (60 * 1024)
|
||||
|
||||
#define CIRCUITPY_BLE_CONFIG_SIZE (12 * 1024)
|
||||
|
||||
#define BOARD_HAS_CRYSTAL 1
|
||||
|
||||
// Take 1k RAM to save 1k flash.
|
||||
#define CIRCUITPY_PRECOMPUTE_QSTR_ATTR (0)
|
||||
|
||||
// Reduce nRF SoftRadio memory usage
|
||||
#define BLEIO_VS_UUID_COUNT 10
|
||||
#define BLEIO_HVN_TX_QUEUE_SIZE 2
|
||||
#define BLEIO_CENTRAL_ROLE_COUNT 2
|
||||
#define BLEIO_PERIPH_ROLE_COUNT 2
|
||||
#define BLEIO_TOTAL_CONNECTION_COUNT 2
|
||||
#define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 2)
|
||||
|
||||
#define SOFTDEVICE_RAM_SIZE (32 * 1024)
|
||||
|
||||
#define MICROPY_FATFS_EXFAT 0
|
||||
|
||||
#define POWER_SWITCH_PIN (&pin_P0_12)
|
42
ports/nrf/boards/bluemicro833/mpconfigboard.mk
Normal file
42
ports/nrf/boards/bluemicro833/mpconfigboard.mk
Normal file
@ -0,0 +1,42 @@
|
||||
USB_VID = 0x1D50
|
||||
USB_PID = 0x6152
|
||||
USB_PRODUCT = "BlueMicro840"
|
||||
USB_MANUFACTURER = "nrf52.jpconstantineau.com"
|
||||
|
||||
MCU_CHIP = nrf52833
|
||||
|
||||
INTERNAL_FLASH_FILESYSTEM = 1
|
||||
|
||||
CIRCUITPY_AESIO = 0
|
||||
CIRCUITPY_ALARM = 0
|
||||
CIRCUITPY_AUDIOMP3 = 0
|
||||
CIRCUITPY_BINASCII = 0
|
||||
CIRCUITPY_BITBANGIO = 0
|
||||
CIRCUITPY_BITMAPTOOLS = 0
|
||||
CIRCUITPY_BUSDEVICE = 0
|
||||
CIRCUITPY_COUNTIO = 0
|
||||
CIRCUITPY_DISPLAYIO = 0
|
||||
CIRCUITPY_FRAMEBUFFERIO = 0
|
||||
CIRCUITPY_FREQUENCYIO = 0
|
||||
CIRCUITPY_I2CPERIPHERAL = 0
|
||||
CIRCUITPY_JSON = 0
|
||||
CIRCUITPY_KEYPAD = 1
|
||||
CIRCUITPY_MSGPACK = 0
|
||||
CIRCUITPY_NEOPIXEL_WRITE = 0
|
||||
CIRCUITPY_NVM = 0
|
||||
CIRCUITPY_PIXELBUF = 0
|
||||
CIRCUITPY_RE = 0
|
||||
CIRCUITPY_RGBMATRIX = 0
|
||||
CIRCUITPY_SDCARDIO = 0
|
||||
CIRCUITPY_SYNTHIO = 0
|
||||
CIRCUITPY_ULAB = 0
|
||||
CIRCUITPY_USB_MIDI = 0
|
||||
CIRCUITPY_VECTORIO = 0
|
||||
|
||||
MICROPY_PY_ASYNC_AWAIT = 0
|
||||
|
||||
SUPEROPT_GC = 0
|
||||
SUPEROPT_VM = 0
|
||||
|
||||
# Override optimization to keep binary small
|
||||
OPTIMIZATION_FLAGS = -Os
|
56
ports/nrf/boards/bluemicro833/pins.c
Normal file
56
ports/nrf/boards/bluemicro833/pins.c
Normal file
@ -0,0 +1,56 @@
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
|
||||
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P1_01) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P1_02) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P1_03) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_04) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_05) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_06) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P1_07) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P1_08) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_17) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_19) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_20) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_21) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_22) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P0_23) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P0_00) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_P0_01) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_P0_05) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_P0_06) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_P0_07) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_P0_08) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_P0_09) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_P0_10) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_P0_11) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_P0_12) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_P0_13) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_P0_14) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_P0_15) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P0_16) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_P0_18) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_P0_24) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_P0_25) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_P1_00) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_P1_09) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_P0_13) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_P0_14) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_P0_15) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_P0_16) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_BUTTON1_DEFAULT), MP_ROM_PTR(&pin_P0_11) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BUTTON1_OPTIONAL), MP_ROM_PTR(&pin_P1_07) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BUTTON2_DEFAULT), MP_ROM_PTR(&pin_P0_12) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BUTTON2_OPTIONAL), MP_ROM_PTR(&pin_P1_08) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BUTTON3), MP_ROM_PTR(&pin_P0_24) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_BUTTON4), MP_ROM_PTR(&pin_P0_25) },
|
||||
};
|
||||
|
||||
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);
|
Loading…
Reference in New Issue
Block a user