fix typos, remove incorrect pca10059 example; add default buses for pca10056; improve board names for pca boards

This commit is contained in:
Dan Halbert 2018-09-01 00:29:36 -04:00
parent 9ea809bef7
commit 4382389e6f
8 changed files with 17 additions and 35 deletions

View File

@ -115,9 +115,9 @@ exclude_patterns = ["**/build*",
"ports/minimal",
"ports/nrf/device",
"ports/nrf/drivers",
"ports/nrf/hal",
"ports/nrf/modules",
"ports/nrf/nrfx",
"ports/nrf/peripherals",
"ports/nrf/usb",
"ports/pic16bit",
"ports/qemu-arm",

View File

@ -22,7 +22,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ 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_27), MP_ROM_PTR(&pin_P0_27) },
{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_P0_27) },
{ MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_P0_30) },
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_30) },

View File

@ -4,6 +4,7 @@
* 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
@ -28,8 +29,8 @@
#define MICROPY_HW_MCU_NAME "nRF52832"
#define MICROPY_PY_SYS_PLATFORM "nRF52-DK"
#define MICROPY_HW_UART_RX NRF_GPIO_PIN_MAP(0, 11)
#define MICROPY_HW_UART_TX NRF_GPIO_PIN_MAP(0, 12)
#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 (32 * 1024)

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#define MICROPY_HW_BOARD_NAME "PCA10056"
#define MICROPY_HW_BOARD_NAME "PCA10056 nRF52840-DK"
#define MICROPY_HW_MCU_NAME "nRF52840"
#define MICROPY_PY_SYS_PLATFORM "nRF52840-DK"
@ -38,3 +38,13 @@
// Temp (could be removed) 0: usb cdc (default), 1 : hwuart (jlink)
#define CFG_HWUART_FOR_SERIAL 0
#define DEFAULT_I2C_BUS_SCL (&pin_P0_27)
#define DEFAULT_I2C_BUS_SDA (&pin_P0_26)
#define DEFAULT_SPI_BUS_SCK (&pin_P1_15)
#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)

View File

@ -1,26 +0,0 @@
import board
import digitalio
import gamepad
import time
pad = gamepad.GamePad(
digitalio.DigitalInOut(board.P0_11),
digitalio.DigitalInOut(board.P0_12),
digitalio.DigitalInOut(board.P0_24),
digitalio.DigitalInOut(board.P0_25),
)
prev_buttons = 0
while True:
buttons = pad.get_pressed()
if buttons != prev_buttons:
for i in range(0, 4):
bit = (1 << i)
if (buttons & bit) != (prev_buttons & bit):
print('Button %d %s' % (i + 1, 'pressed' if buttons & bit else 'released'))
prev_buttons = buttons
time.sleep(0.1)

View File

@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
#define MICROPY_HW_BOARD_NAME "PCA10059"
#define MICROPY_HW_BOARD_NAME "PCA10059 nRF52840 Dongle"
#define MICROPY_HW_MCU_NAME "nRF52840"
#define MICROPY_PY_SYS_PLATFORM "nRF52840-DK"

View File

@ -79,7 +79,6 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_P0_11), MP_ROM_PTR(&pin_P0_11) },
{ MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) },
{ MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) },
{ MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) },
{ MP_ROM_QSTR(MP_QSTR_P0_14), MP_ROM_PTR(&pin_P0_14) },
{ MP_ROM_QSTR(MP_QSTR_P0_15), MP_ROM_PTR(&pin_P0_15) },
{ MP_ROM_QSTR(MP_QSTR_P0_16), MP_ROM_PTR(&pin_P0_16) },

View File

@ -67,6 +67,4 @@ extern const mp_obj_type_t mcu_pin_type;
#include "nrf52840/pins.h"
#endif
//**************extern const mp_obj_type_t mcu_pin_type;
#endif // __MICROPY_INCLUDED_NRF_PERIPHERALS_PINS_H__