From 22c4abd28f487b609b89a20268cd941ce5c40bf7 Mon Sep 17 00:00:00 2001 From: Tsutomu IKEGAMI Date: Wed, 28 Apr 2021 18:57:21 +0900 Subject: [PATCH 1/4] Add DAC* and RTL_* pin assignments to Wio Terminal board. --- .../boards/seeeduino_wio_terminal/pins.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index 8d9c76164e..c47d06ff69 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -83,6 +83,21 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_GYROSCOPE_SDA), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_GYROSCOPE_INT), MP_ROM_PTR(&pin_PC21) }, + // DAC + { MP_OBJ_NEW_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA05) }, + + // RTL8720D + { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_PWR), MP_ROM_PTR(&pin_PA18) }, // CHIP_PU + { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_RXD), MP_ROM_PTR(&pin_PC22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_TXD), MP_ROM_PTR(&pin_PC23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_MOSI), MP_ROM_PTR(&pin_PB24) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_CLK), MP_ROM_PTR(&pin_PB25) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_MISO), MP_ROM_PTR(&pin_PC24) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_CS), MP_ROM_PTR(&pin_PC25) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_READY), MP_ROM_PTR(&pin_PC20) }, // IRQ0 + { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_DIR), MP_ROM_PTR(&pin_PA19) }, // SYNC + // Comm objects { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From 0d25b95f0d3edf037d094aa2794c67141aa7d514 Mon Sep 17 00:00:00 2001 From: Tsutomu IKEGAMI Date: Thu, 29 Apr 2021 02:19:34 +0900 Subject: [PATCH 2/4] Add definitions of PB2[4-9] pins to microcontroller.pin for atmel-samd. --- .../common-hal/microcontroller/__init__.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ports/atmel-samd/common-hal/microcontroller/__init__.c b/ports/atmel-samd/common-hal/microcontroller/__init__.c index 50a1ec038e..e14e66c571 100644 --- a/ports/atmel-samd/common-hal/microcontroller/__init__.c +++ b/ports/atmel-samd/common-hal/microcontroller/__init__.c @@ -268,6 +268,24 @@ STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = { #if defined(PIN_PB23) && !defined(IGNORE_PIN_PB23) { MP_ROM_QSTR(MP_QSTR_PB23), MP_ROM_PTR(&pin_PB23) }, #endif +#if defined(PIN_PB24) && !defined(IGNORE_PIN_PB24) + { MP_ROM_QSTR(MP_QSTR_PB24), MP_ROM_PTR(&pin_PB24) }, +#endif +#if defined(PIN_PB25) && !defined(IGNORE_PIN_PB25) + { MP_ROM_QSTR(MP_QSTR_PB25), MP_ROM_PTR(&pin_PB25) }, +#endif +#if defined(PIN_PB26) && !defined(IGNORE_PIN_PB26) + { MP_ROM_QSTR(MP_QSTR_PB26), MP_ROM_PTR(&pin_PB26) }, +#endif +#if defined(PIN_PB27) && !defined(IGNORE_PIN_PB27) + { MP_ROM_QSTR(MP_QSTR_PB27), MP_ROM_PTR(&pin_PB27) }, +#endif +#if defined(PIN_PB28) && !defined(IGNORE_PIN_PB28) + { MP_ROM_QSTR(MP_QSTR_PB28), MP_ROM_PTR(&pin_PB28) }, +#endif +#if defined(PIN_PB29) && !defined(IGNORE_PIN_PB29) + { MP_ROM_QSTR(MP_QSTR_PB29), MP_ROM_PTR(&pin_PB29) }, +#endif #if defined(PIN_PB30) && !defined(IGNORE_PIN_PB30) { MP_ROM_QSTR(MP_QSTR_PB30), MP_ROM_PTR(&pin_PB30) }, #endif From d79d6ba688d9f3d5b01ca826278ab03248fdd54b Mon Sep 17 00:00:00 2001 From: Tsutomu IKEGAMI Date: Fri, 30 Apr 2021 13:03:29 +0900 Subject: [PATCH 3/4] Add I2S_* pin assignments to Wio Terminal board. --- ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index c47d06ff69..957c75db26 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -87,6 +87,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA05) }, + // I2S + { MP_OBJ_NEW_QSTR(MP_QSTR_I2S_LRCLK), MP_ROM_PTR(&pin_PA20) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_I2S_SDIN), MP_ROM_PTR(&pin_PA21) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_I2S_SDOUT), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_I2S_BLCK), MP_ROM_PTR(&pin_PB16) }, + // RTL8720D { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_PWR), MP_ROM_PTR(&pin_PA18) }, // CHIP_PU { MP_OBJ_NEW_QSTR(MP_QSTR_RTL_RXD), MP_ROM_PTR(&pin_PC22) }, From 11a9372da38d2a47c79d8d27af0d42ae5290857c Mon Sep 17 00:00:00 2001 From: Tsutomu IKEGAMI Date: Fri, 30 Apr 2021 13:06:09 +0900 Subject: [PATCH 4/4] Set Xtal, Aref, and NC pins to be IGNORE_ed in microcontroller.pin for Wio Terminal. --- .../boards/seeeduino_wio_terminal/mpconfigboard.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h index c87ca46d81..94538ed851 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/mpconfigboard.h @@ -34,3 +34,12 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + +#define IGNORE_PIN_PA00 1 // XIN32 +#define IGNORE_PIN_PA01 1 // XOUT32 +#define IGNORE_PIN_PA03 1 // VREFA (VCC3V3) +#define IGNORE_PIN_PA23 1 // NC +#define IGNORE_PIN_PB15 1 // NC +#define IGNORE_PIN_PB22 1 // XIN +#define IGNORE_PIN_PB23 1 // XOUT +#define IGNORE_PIN_PC00 1 // NC (for XOSC32K)