From 63bcd52a5a9462c949d4f7bbb9d1ec4d6bb76af8 Mon Sep 17 00:00:00 2001 From: Florent Gallaire Date: Wed, 19 Feb 2020 05:14:27 +0100 Subject: [PATCH 1/5] Add Arduino Nano 33 IoT documentation --- ports/atmel-samd/README.rst | 79 +++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index 9afa19b837..118b174061 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -11,6 +11,7 @@ CircuitPython. Supported boards include: - Adafruit M0 Bluefruit LE - Arduino Zero - Arduino MKR Zero +- Arduino Nano 33 IoT Pinout @@ -22,51 +23,51 @@ different names. The table below matches the pin order in and omits the pins only available on the largest package because all supported boards use smaller version. -===================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ +===================== =================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ `microcontroller.pin` `board` ---------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -Datasheet arduino_mkrzero arduino_zero circuitplayground_express feather_m0_adalogger feather_m0_basic feather_m0_express gemma_m0 metro_m0_express sparkfun_samd21_mini sparkfun_samd21_dev trinket_m0 -===================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ -PA00 ``ACCELEROMETER_SDA`` ``APA102_MOSI`` ``APA102_MOSI`` -PA01 ``ACCELEROMETER_SCL`` ``APA102_SCK`` ``APA102_SCK`` -PA02 ``A0`` ``A0`` ``A0`` / ``SPEAKER`` ``A0`` ``A0`` ``A0`` ``A0`` / ``D1`` ``A0`` ``A0`` ``A0`` ``D1`` / ``A0`` +--------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +Datasheet arduino_mkrzero arduino_nano_33_iot arduino_zero circuitplayground_express feather_m0_adalogger feather_m0_basic feather_m0_express gemma_m0 metro_m0_express sparkfun_samd21_mini sparkfun_samd21_dev trinket_m0 +===================== =================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ +PA00 ``ACCELEROMETER_SDA`` ``APA102_MOSI`` ``APA102_MOSI`` +PA01 ``ACCELEROMETER_SCL`` ``APA102_SCK`` ``APA102_SCK`` +PA02 ``A0`` ``A0`` ``A0`` ``A0`` / ``SPEAKER`` ``A0`` ``A0`` ``A0`` ``A0`` / ``D1`` ``A0`` ``A0`` ``A0`` ``D1`` / ``A0`` PA03 -PB08 ``L`` ``A1`` ``A7`` / ``TX`` ``A1`` ``A1`` ``A1`` ``A1`` ``A1`` ``A1`` -PB09 ``BATTERY`` ``A2`` ``A6`` / ``RX`` ``A2`` ``A2`` ``A2`` ``A2`` ``A2`` ``A2`` -PA04 ``A3`` ``A3`` ``IR_PROXIMITY`` ``A3`` ``A3`` ``A3`` ``D0`` / ``TX`` / ``SDA`` ``A3`` ``A3`` ``A3`` -PA05 ``A4`` ``A4`` ``A1`` ``A4`` ``A4`` ``A4`` ``D2`` / ``RX`` / ``SCL`` ``A4`` ``A4`` -PA06 ``A5`` ``D8`` ``A2`` ``D8`` / ``GREEN_LED`` ``NEOPIXEL`` ``D8`` ``D8`` ``D8`` ``D4`` / ``TX`` -PA07 ``A6`` ``D9`` ``A3`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D3`` / ``RX`` -PA08 ``D11`` / ``SDA`` ``D4`` ``MICROPHONE_DO`` ``D4`` / ``SD_CS`` ``D4`` ``D4`` ``D4`` ``D0`` / ``SDA`` -PA09 ``D12`` / ``SCL`` ``D3`` ``TEMPERATURE`` / ``A9`` ``D3`` ``D3`` ``D3`` ``D2`` / ``SCL`` -PA10 ``D2`` ``D1`` / ``TX`` ``MICROPHONE_SCK`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D13`` -PA11 ``D3`` ``D0`` / ``RX`` ``LIGHT`` / ``A8`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` -PB10 ``D4`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` -PB11 ``D5`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` -PA12 ``SD_MOSI`` ``MISO`` ``REMOTEIN`` / ``IR_RX`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` -PA13 ``SD_SCK`` ``ACCELEROMETER_INTERRUPT`` ``FLASH_CS`` ``D38`` -PA14 ``SD_CS`` ``D2`` ``BUTTON_B`` / ``D5`` ``D2`` ``D2`` ``D2`` -PA15 ``SD_MISO`` ``D5`` ``SLIDE_SWITCH`` / ``D7`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` -PA16 ``D8`` / ``MOSI`` ``D11`` ``MISO`` ``D11`` ``D11`` ``D11`` ``D11`` ``D11`` / ``MOSI`` ``D11`` -PA17 ``D9`` / ``SCK`` ``D13`` ``D13`` ``D13`` / ``RED_LED`` ``D13`` ``D13`` ``D13`` ``D13`` / ``SCK`` / ``BLUE_LED`` ``D13`` / ``BLUE_LED`` -PA18 ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` -PA19 ``D10`` / ``MISO`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` / ``MISO`` ``D12`` -PA20 ``D6`` ``D6`` ``MOSI`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` -PA21 ``D7`` ``D7`` ``SCK`` ``D7`` / ``SD_CD`` ``D7`` ``D7`` ``D7`` -PA22 ``D0`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` -PA23 ``D1`` ``SCL`` ``REMOTEOUT`` / ``IR_TX`` ``SCL`` ``SCL`` ``SCL`` ``L`` / ``D13`` ``SCL`` ``SCL`` ``SCL`` +PB08 ``L`` ``A4`` / ``SDA`` ``A1`` ``A7`` / ``TX`` ``A1`` ``A1`` ``A1`` ``A1`` ``A1`` ``A1`` +PB09 ``BATTERY`` ``A5`` / ``SCL`` ``A2`` ``A6`` / ``RX`` ``A2`` ``A2`` ``A2`` ``A2`` ``A2`` ``A2`` +PA04 ``A3`` ``D6`` ``A3`` ``IR_PROXIMITY`` ``A3`` ``A3`` ``A3`` ``D0`` / ``TX`` / ``SDA`` ``A3`` ``A3`` ``A3`` +PA05 ``A4`` ``D5`` ``A4`` ``A1`` ``A4`` ``A4`` ``A4`` ``D2`` / ``RX`` / ``SCL`` ``A4`` ``A4`` +PA06 ``A5`` ``D7`` ``D8`` ``A2`` ``D8`` / ``GREEN_LED`` ``NEOPIXEL`` ``D8`` ``D8`` ``D8`` ``D4`` / ``TX`` +PA07 ``A6`` ``D4`` ``D9`` ``A3`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D3`` / ``RX`` +PA08 ``D11`` / ``SDA`` ``NINA_RESETN`` ``D4`` ``MICROPHONE_DO`` ``D4`` / ``SD_CS`` ``D4`` ``D4`` ``D4`` ``D0`` / ``SDA`` +PA09 ``D12`` / ``SCL`` ``A6`` ``D3`` ``TEMPERATURE`` / ``A9`` ``D3`` ``D3`` ``D3`` ``D2`` / ``SCL`` +PA10 ``D2`` ``A3`` ``D1`` / ``TX`` ``MICROPHONE_SCK`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D13`` +PA11 ``D3`` ``A2`` ``D0`` / ``RX`` ``LIGHT`` / ``A8`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` +PB10 ``D4`` ``D2`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` +PB11 ``D5`` ``D3`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` +PA12 ``SD_MOSI`` ``NINA_MOSI`` ``MISO`` ``REMOTEIN`` / ``IR_RX`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` +PA13 ``SD_SCK`` ``NINA_MISO`` ``ACCELEROMETER_INTERRUPT`` ``FLASH_CS`` ``D38`` +PA14 ``SD_CS`` ``NINA_CS`` ``D2`` ``BUTTON_B`` / ``D5`` ``D2`` ``D2`` ``D2`` +PA15 ``SD_MISO`` ``NINA_SCK`` ``D5`` ``SLIDE_SWITCH`` / ``D7`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` +PA16 ``D8`` / ``MOSI`` ``D11`` / ``MOSI`` ``D11`` ``MISO`` ``D11`` ``D11`` ``D11`` ``D11`` ``D11`` / ``MOSI`` ``D11`` +PA17 ``D9`` / ``SCK`` ``D13`` / ``SCK`` ``D13`` ``D13`` ``D13`` / ``RED_LED`` ``D13`` ``D13`` ``D13`` ``D13`` / ``SCK`` / ``BLUE_LED`` ``D13`` / ``BLUE_LED`` +PA18 ``D8`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` +PA19 ``D10`` / ``MISO`` ``D12`` / ``MISO`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` / ``MISO`` ``D12`` +PA20 ``D6`` ``D9`` ``D6`` ``MOSI`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` +PA21 ``D7`` ``D10`` ``D7`` ``SCK`` ``D7`` / ``SD_CD`` ``D7`` ``D7`` ``D7`` +PA22 ``D0`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` +PA23 ``D1`` ``SCL`` ``REMOTEOUT`` / ``IR_TX`` ``SCL`` ``SCL`` ``SCL`` ``L`` / ``D13`` ``SCL`` ``SCL`` ``SCL`` PA24 PA25 -PB22 ``D14`` / ``TX`` ``FLASH_CS`` ``D30`` / ``TX1`` -PB23 ``D13`` / ``RX`` ``NEOPIXEL`` / ``D8`` ``D31`` / ``RX1`` -PA27 ``SD_CD`` ``GREEN_LED`` ``GREEN_LED`` -PA28 ``BUTTON_A`` / ``D4`` +PB22 ``D14`` / ``TX`` ``D1`` / ``TX`` ``FLASH_CS`` ``D30`` / ``TX1`` +PB23 ``D13`` / ``RX`` ``D0`` / ``RX`` ``NEOPIXEL`` / ``D8`` ``D31`` / ``RX1`` +PA27 ``SD_CD`` ``NINA_GPIO0`` ``GREEN_LED`` ``GREEN_LED`` +PA28 ``NINA_ACK`` ``BUTTON_A`` / ``D4`` PA29 -PA30 ``SPEAKER_ENABLE`` ``NEOPIXEL`` +PA30 ``SPEAKER_ENABLE`` ``NEOPIXEL`` PA31 -PB02 ``A1`` ``A5`` ``A5`` / ``SDA`` ``A5`` ``A5`` ``A5`` ``A5`` ``A5`` -PB03 ``A2`` ``A4`` / ``SCL`` ``YELLOW_LED`` ``YELLOW_LED`` -===================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ +PB02 ``A1`` ``A1`` ``A5`` ``A5`` / ``SDA`` ``A5`` ``A5`` ``A5`` ``A5`` ``A5`` +PB03 ``A2`` ``A7`` ``A4`` / ``SCL`` ``YELLOW_LED`` ``YELLOW_LED`` +===================== =================== =================== =============== =========================== ====================== ================ ================== ========================= ================ ================================ ====================== ================ Here is a table about which pins can do what in CircuitPython terms. However, just because something is listed, doesn't mean it will always work. Existing use From fba0b302ff5ed469ea2ebf3703d6ba4b8a9786b1 Mon Sep 17 00:00:00 2001 From: Florent Gallaire Date: Wed, 19 Feb 2020 08:56:06 +0100 Subject: [PATCH 2/5] Add Arduino Nano 33 IoT support --- .../boards/arduino_nano_33_iot/board.c | 40 +++++++++++++++++++ .../arduino_nano_33_iot/mpconfigboard.h | 22 ++++++++++ .../arduino_nano_33_iot/mpconfigboard.mk | 13 ++++++ .../boards/arduino_nano_33_iot/pins.c | 37 +++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 ports/atmel-samd/boards/arduino_nano_33_iot/board.c create mode 100644 ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/arduino_nano_33_iot/pins.c diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/board.c b/ports/atmel-samd/boards/arduino_nano_33_iot/board.c new file mode 100644 index 0000000000..770bc82593 --- /dev/null +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) +{ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.h b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.h new file mode 100644 index 0000000000..847e1a6792 --- /dev/null +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.h @@ -0,0 +1,22 @@ +#define MICROPY_HW_BOARD_NAME "Arduino Nano 33 IoT" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_HW_LED_STATUS (&pin_PA17) + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define DEFAULT_I2C_BUS_SCL (&pin_PB09) +#define DEFAULT_I2C_BUS_SDA (&pin_PB08) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA17) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA16) +#define DEFAULT_SPI_BUS_MISO (&pin_PA19) + +#define DEFAULT_UART_BUS_RX (&pin_PB23) +#define DEFAULT_UART_BUS_TX (&pin_PB22) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk new file mode 100644 index 0000000000..8a29b0ace0 --- /dev/null +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -0,0 +1,13 @@ +USB_VID = 0x2341 +USB_PID = 0x8057 +USB_PRODUCT = "Arduino Nano 33 IoT" +USB_MANUFACTURER = "Arduino" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_SMALL_BUILD = 1 + +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c b/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c new file mode 100644 index 0000000000..3478db9dff --- /dev/null +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c @@ -0,0 +1,37 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB23) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB23) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 1ed5afeaec9a3c76930aa32e3a8bc0a63b61b6d9 Mon Sep 17 00:00:00 2001 From: Florent Gallaire Date: Wed, 19 Feb 2020 10:22:57 +0100 Subject: [PATCH 3/5] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d389845a2d..f88630cdd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -126,6 +126,7 @@ jobs: - "arduino_mkr1300" - "arduino_mkrzero" - "arduino_nano_33_ble" + - "arduino_nano_33_iot" - "arduino_zero" - "bast_pro_mini_m0" - "capablerobot_usbhub" From 39ec5d0e51a26b3a8a3287e9e8222efadd30cfee Mon Sep 17 00:00:00 2001 From: Florent Gallaire Date: Fri, 21 Feb 2020 01:34:52 +0100 Subject: [PATCH 4/5] Add NINA pins --- ports/atmel-samd/README.rst | 14 +++++++------- .../boards/arduino_nano_33_iot/pins.c | 18 +++++++++++++----- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index 118b174061..31442e1d1c 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -38,16 +38,16 @@ PA04 ``A3`` ``D6`` ``A3`` PA05 ``A4`` ``D5`` ``A4`` ``A1`` ``A4`` ``A4`` ``A4`` ``D2`` / ``RX`` / ``SCL`` ``A4`` ``A4`` PA06 ``A5`` ``D7`` ``D8`` ``A2`` ``D8`` / ``GREEN_LED`` ``NEOPIXEL`` ``D8`` ``D8`` ``D8`` ``D4`` / ``TX`` PA07 ``A6`` ``D4`` ``D9`` ``A3`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D9`` ``D3`` / ``RX`` -PA08 ``D11`` / ``SDA`` ``NINA_RESETN`` ``D4`` ``MICROPHONE_DO`` ``D4`` / ``SD_CS`` ``D4`` ``D4`` ``D4`` ``D0`` / ``SDA`` +PA08 ``D11`` / ``SDA`` ``ESP_RESET`` ``D4`` ``MICROPHONE_DO`` ``D4`` / ``SD_CS`` ``D4`` ``D4`` ``D4`` ``D0`` / ``SDA`` PA09 ``D12`` / ``SCL`` ``A6`` ``D3`` ``TEMPERATURE`` / ``A9`` ``D3`` ``D3`` ``D3`` ``D2`` / ``SCL`` PA10 ``D2`` ``A3`` ``D1`` / ``TX`` ``MICROPHONE_SCK`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D1`` / ``TX`` ``D13`` PA11 ``D3`` ``A2`` ``D0`` / ``RX`` ``LIGHT`` / ``A8`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` ``D0`` / ``RX`` PB10 ``D4`` ``D2`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` ``MOSI`` PB11 ``D5`` ``D3`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` ``SCK`` -PA12 ``SD_MOSI`` ``NINA_MOSI`` ``MISO`` ``REMOTEIN`` / ``IR_RX`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` -PA13 ``SD_SCK`` ``NINA_MISO`` ``ACCELEROMETER_INTERRUPT`` ``FLASH_CS`` ``D38`` -PA14 ``SD_CS`` ``NINA_CS`` ``D2`` ``BUTTON_B`` / ``D5`` ``D2`` ``D2`` ``D2`` -PA15 ``SD_MISO`` ``NINA_SCK`` ``D5`` ``SLIDE_SWITCH`` / ``D7`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` +PA12 ``SD_MOSI`` ``ESP_MOSI`` ``MISO`` ``REMOTEIN`` / ``IR_RX`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` ``MISO`` +PA13 ``SD_SCK`` ``ESP_MISO`` ``ACCELEROMETER_INTERRUPT`` ``FLASH_CS`` ``D38`` +PA14 ``SD_CS`` ``ESP_CS`` ``D2`` ``BUTTON_B`` / ``D5`` ``D2`` ``D2`` ``D2`` +PA15 ``SD_MISO`` ``ESP_SCK`` ``D5`` ``SLIDE_SWITCH`` / ``D7`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` ``D5`` PA16 ``D8`` / ``MOSI`` ``D11`` / ``MOSI`` ``D11`` ``MISO`` ``D11`` ``D11`` ``D11`` ``D11`` ``D11`` / ``MOSI`` ``D11`` PA17 ``D9`` / ``SCK`` ``D13`` / ``SCK`` ``D13`` ``D13`` ``D13`` / ``RED_LED`` ``D13`` ``D13`` ``D13`` ``D13`` / ``SCK`` / ``BLUE_LED`` ``D13`` / ``BLUE_LED`` PA18 ``D8`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` ``D10`` @@ -60,8 +60,8 @@ PA24 PA25 PB22 ``D14`` / ``TX`` ``D1`` / ``TX`` ``FLASH_CS`` ``D30`` / ``TX1`` PB23 ``D13`` / ``RX`` ``D0`` / ``RX`` ``NEOPIXEL`` / ``D8`` ``D31`` / ``RX1`` -PA27 ``SD_CD`` ``NINA_GPIO0`` ``GREEN_LED`` ``GREEN_LED`` -PA28 ``NINA_ACK`` ``BUTTON_A`` / ``D4`` +PA27 ``SD_CD`` ``ESP_GPIO0`` ``GREEN_LED`` ``GREEN_LED`` +PA28 ``ESP_ACK`` ``BUTTON_A`` / ``D4`` PA29 PA30 ``SPEAKER_ENABLE`` ``NEOPIXEL`` PA31 diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c b/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c index 3478db9dff..653af1df39 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c @@ -6,7 +6,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB23) }, @@ -23,15 +25,21 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA21) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + // NINA-W102 + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PA08) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_MOSI), MP_ROM_PTR(&pin_PA12) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_MISO), MP_ROM_PTR(&pin_PA13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_SCK), MP_ROM_PTR(&pin_PA15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_PA27) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_ACK), MP_ROM_PTR(&pin_PA28) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 96db16a7a2c0ade89438391391c53efa1768f74e Mon Sep 17 00:00:00 2001 From: Florent Gallaire Date: Sat, 22 Feb 2020 04:30:18 +0100 Subject: [PATCH 5/5] Last NINA pins --- ports/atmel-samd/README.rst | 6 +++--- ports/atmel-samd/boards/arduino_nano_33_iot/pins.c | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/README.rst b/ports/atmel-samd/README.rst index 31442e1d1c..b4d2085777 100644 --- a/ports/atmel-samd/README.rst +++ b/ports/atmel-samd/README.rst @@ -54,14 +54,14 @@ PA18 ``D8`` ``D10`` PA19 ``D10`` / ``MISO`` ``D12`` / ``MISO`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` ``D12`` / ``MISO`` ``D12`` PA20 ``D6`` ``D9`` ``D6`` ``MOSI`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` ``D6`` PA21 ``D7`` ``D10`` ``D7`` ``SCK`` ``D7`` / ``SD_CD`` ``D7`` ``D7`` ``D7`` -PA22 ``D0`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` -PA23 ``D1`` ``SCL`` ``REMOTEOUT`` / ``IR_TX`` ``SCL`` ``SCL`` ``SCL`` ``L`` / ``D13`` ``SCL`` ``SCL`` ``SCL`` +PA22 ``D0`` ``ESP_TX`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` ``SDA`` +PA23 ``D1`` ``ESP_RX`` ``SCL`` ``REMOTEOUT`` / ``IR_TX`` ``SCL`` ``SCL`` ``SCL`` ``L`` / ``D13`` ``SCL`` ``SCL`` ``SCL`` PA24 PA25 PB22 ``D14`` / ``TX`` ``D1`` / ``TX`` ``FLASH_CS`` ``D30`` / ``TX1`` PB23 ``D13`` / ``RX`` ``D0`` / ``RX`` ``NEOPIXEL`` / ``D8`` ``D31`` / ``RX1`` PA27 ``SD_CD`` ``ESP_GPIO0`` ``GREEN_LED`` ``GREEN_LED`` -PA28 ``ESP_ACK`` ``BUTTON_A`` / ``D4`` +PA28 ``ESP_BUSY`` ``BUTTON_A`` / ``D4`` PA29 PA30 ``SPEAKER_ENABLE`` ``NEOPIXEL`` PA31 diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c b/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c index 653af1df39..6b23cbf091 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c @@ -30,16 +30,20 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + // NINA-W102 { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_PA08) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_MOSI), MP_ROM_PTR(&pin_PA12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_MISO), MP_ROM_PTR(&pin_PA13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_SCK), MP_ROM_PTR(&pin_PA15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_PA27) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_ACK), MP_ROM_PTR(&pin_PA28) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PA28) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);