summaryrefslogtreecommitdiff
path: root/ports/cxd56/common-hal/microcontroller
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-10-14 18:12:58 -0400
committerDan Halbert <halbert@halwitz.org>2019-10-14 18:12:58 -0400
commit615ec7f74d6f2a953de01b83979393af60aee804 (patch)
tree15be91acea3ae22ddb596e0d9db8a03c0031e37e /ports/cxd56/common-hal/microcontroller
parent995a37f0cc4dbc84a6852876a40aee94a8ab6fb2 (diff)
parent5971794e5464d166379278c8dcbda0ebb3cc23d5 (diff)
merge from upstream
Diffstat (limited to 'ports/cxd56/common-hal/microcontroller')
-rw-r--r--ports/cxd56/common-hal/microcontroller/Pin.c162
-rw-r--r--ports/cxd56/common-hal/microcontroller/Pin.h92
-rw-r--r--ports/cxd56/common-hal/microcontroller/Processor.c41
-rw-r--r--ports/cxd56/common-hal/microcontroller/Processor.h40
-rw-r--r--ports/cxd56/common-hal/microcontroller/__init__.c111
5 files changed, 446 insertions, 0 deletions
diff --git a/ports/cxd56/common-hal/microcontroller/Pin.c b/ports/cxd56/common-hal/microcontroller/Pin.c
new file mode 100644
index 000000000..23377197c
--- /dev/null
+++ b/ports/cxd56/common-hal/microcontroller/Pin.c
@@ -0,0 +1,162 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright 2019 Sony Semiconductor Solutions Corporation
+ *
+ * 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 <unistd.h>
+
+#include <sys/ioctl.h>
+#include <arch/chip/pin.h>
+#include <arch/chip/adc.h>
+#include <arch/board/board.h>
+
+#include "shared-bindings/microcontroller/Pin.h"
+
+typedef struct {
+ const mcu_pin_obj_t *pin;
+ bool reset;
+ bool free;
+} pin_status_t;
+
+const mcu_pin_obj_t pin_UART2_RXD = PIN(PIN_UART2_RXD, false);
+const mcu_pin_obj_t pin_UART2_TXD = PIN(PIN_UART2_TXD, false);
+const mcu_pin_obj_t pin_HIF_IRQ_OUT = PIN(PIN_HIF_IRQ_OUT, false);
+const mcu_pin_obj_t pin_PWM3 = PIN(PIN_PWM3, false);
+const mcu_pin_obj_t pin_SPI2_MOSI = PIN(PIN_SPI2_MOSI, false);
+const mcu_pin_obj_t pin_PWM1 = PIN(PIN_PWM1, false);
+const mcu_pin_obj_t pin_PWM0 = PIN(PIN_PWM0, false);
+const mcu_pin_obj_t pin_SPI3_CS1_X = PIN(PIN_SPI3_CS1_X, false);
+const mcu_pin_obj_t pin_SPI2_MISO = PIN(PIN_SPI2_MISO, false);
+const mcu_pin_obj_t pin_PWM2 = PIN(PIN_PWM2, false);
+const mcu_pin_obj_t pin_SPI4_CS_X = PIN(PIN_SPI4_CS_X, false);
+const mcu_pin_obj_t pin_SPI4_MOSI = PIN(PIN_SPI4_MOSI, false);
+const mcu_pin_obj_t pin_SPI4_MISO = PIN(PIN_SPI4_MISO, false);
+const mcu_pin_obj_t pin_SPI4_SCK = PIN(PIN_SPI4_SCK, false);
+const mcu_pin_obj_t pin_I2C0_BDT = PIN(PIN_I2C0_BDT, false);
+const mcu_pin_obj_t pin_I2C0_BCK = PIN(PIN_I2C0_BCK, false);
+const mcu_pin_obj_t pin_EMMC_DATA0 = PIN(PIN_EMMC_DATA0, false);
+const mcu_pin_obj_t pin_EMMC_DATA1 = PIN(PIN_EMMC_DATA1, false);
+const mcu_pin_obj_t pin_I2S0_DATA_OUT = PIN(PIN_I2S0_DATA_OUT, false);
+const mcu_pin_obj_t pin_I2S0_DATA_IN = PIN(PIN_I2S0_DATA_IN, false);
+const mcu_pin_obj_t pin_EMMC_DATA2 = PIN(PIN_EMMC_DATA2, false);
+const mcu_pin_obj_t pin_EMMC_DATA3 = PIN(PIN_EMMC_DATA3, false);
+const mcu_pin_obj_t pin_SEN_IRQ_IN = PIN(PIN_SEN_IRQ_IN, false);
+const mcu_pin_obj_t pin_EMMC_CLK = PIN(PIN_EMMC_CLK, false);
+const mcu_pin_obj_t pin_EMMC_CMD = PIN(PIN_EMMC_CMD, false);
+const mcu_pin_obj_t pin_I2S0_LRCK = PIN(PIN_I2S0_LRCK, false);
+const mcu_pin_obj_t pin_I2S0_BCK = PIN(PIN_I2S0_BCK, false);
+const mcu_pin_obj_t pin_UART2_CTS = PIN(PIN_UART2_CTS, false);
+const mcu_pin_obj_t pin_UART2_RTS = PIN(PIN_UART2_RTS, false);
+const mcu_pin_obj_t pin_I2S1_BCK = PIN(PIN_I2S1_BCK, false);
+const mcu_pin_obj_t pin_I2S1_LRCK = PIN(PIN_I2S1_LRCK, false);
+const mcu_pin_obj_t pin_I2S1_DATA_IN = PIN(PIN_I2S1_DATA_IN, false);
+const mcu_pin_obj_t pin_I2S1_DATA_OUT = PIN(PIN_I2S1_DATA_OUT, false);
+const mcu_pin_obj_t pin_LPADC0 = PIN(0, true);
+const mcu_pin_obj_t pin_LPADC1 = PIN(1, true);
+const mcu_pin_obj_t pin_LPADC2 = PIN(2, true);
+const mcu_pin_obj_t pin_LPADC3 = PIN(3, true);
+const mcu_pin_obj_t pin_HPADC0 = PIN(4, true);
+const mcu_pin_obj_t pin_HPADC1 = PIN(5, true);
+
+STATIC pin_status_t pins[] = {
+ { &pin_UART2_RXD, true, true },
+ { &pin_UART2_TXD, true, true },
+ { &pin_HIF_IRQ_OUT, true, true },
+ { &pin_PWM3, true, true },
+ { &pin_SPI2_MOSI, true, true },
+ { &pin_PWM1, true, true },
+ { &pin_PWM0, true, true },
+ { &pin_SPI3_CS1_X, true, true },
+ { &pin_SPI2_MISO, true, true },
+ { &pin_PWM2, true, true },
+ { &pin_SPI4_CS_X, true, true },
+ { &pin_SPI4_MOSI, true, true },
+ { &pin_SPI4_MISO, true, true },
+ { &pin_SPI4_SCK, true, true },
+ { &pin_I2C0_BDT, true, true },
+ { &pin_I2C0_BCK, true, true },
+ { &pin_EMMC_DATA0, true, true },
+ { &pin_EMMC_DATA1, true, true },
+ { &pin_I2S0_DATA_OUT, true, true },
+ { &pin_I2S0_DATA_IN, true, true },
+ { &pin_EMMC_DATA2, true, true },
+ { &pin_EMMC_DATA3, true, true },
+ { &pin_SEN_IRQ_IN, true, true },
+ { &pin_EMMC_CLK, true, true },
+ { &pin_EMMC_CMD, true, true },
+ { &pin_I2S0_LRCK, true, true },
+ { &pin_I2S0_BCK, true, true },
+ { &pin_UART2_CTS, true, true },
+ { &pin_UART2_RTS, true, true },
+ { &pin_I2S1_BCK, true, true },
+ { &pin_I2S1_LRCK, true, true },
+ { &pin_I2S1_DATA_IN, true, true },
+ { &pin_I2S1_DATA_OUT, true, true },
+};
+
+bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) {
+ for (int i = 0; i < MP_ARRAY_SIZE(pins); i++) {
+ if (pins[i].pin->number == pin->number) {
+ return pins[i].free;
+ }
+ }
+
+ return true;
+}
+
+void never_reset_pin_number(uint8_t pin_number) {
+ for (int i = 0; i < MP_ARRAY_SIZE(pins); i++) {
+ if (pins[i].pin->number == pin_number) {
+ pins[i].reset = false;
+ }
+ }
+}
+
+void reset_pin_number(uint8_t pin_number) {
+ for (int i = 0; i < MP_ARRAY_SIZE(pins); i++) {
+ if (pins[i].pin->number == pin_number) {
+ pins[i].free = true;
+ }
+ }
+}
+
+void reset_all_pins(void) {
+ for (int i = 0; i < MP_ARRAY_SIZE(pins); i++) {
+ if (!pins[i].free && pins[i].reset) {
+ board_gpio_write(pins[i].pin->number, -1);
+ board_gpio_config(pins[i].pin->number, 0, false, true, PIN_FLOAT);
+ board_gpio_int(pins[i].pin->number, false);
+ board_gpio_intconfig(pins[i].pin->number, 0, false, NULL);
+ pins[i].free = true;
+ }
+ }
+}
+
+void claim_pin(const mcu_pin_obj_t *pin) {
+ for (int i = 0; i < MP_ARRAY_SIZE(pins); i++) {
+ if (pins[i].pin->number == pin->number) {
+ pins[i].free = false;
+ }
+ }
+}
diff --git a/ports/cxd56/common-hal/microcontroller/Pin.h b/ports/cxd56/common-hal/microcontroller/Pin.h
new file mode 100644
index 000000000..fe6524edb
--- /dev/null
+++ b/ports/cxd56/common-hal/microcontroller/Pin.h
@@ -0,0 +1,92 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright 2019 Sony Semiconductor Solutions Corporation
+ *
+ * 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.
+ */
+
+#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_MICROCONTROLLER_PIN_H
+#define MICROPY_INCLUDED_CXD56_COMMON_HAL_MICROCONTROLLER_PIN_H
+
+#include "py/obj.h"
+
+extern const mp_obj_type_t mcu_pin_type;
+
+#define PIN(pin, a) \
+{ \
+ { &mcu_pin_type }, \
+ .number = (pin), \
+ .analog = (a) \
+}
+
+typedef struct {
+ mp_obj_base_t base;
+ uint8_t number;
+ bool analog;
+} mcu_pin_obj_t;
+
+extern const mcu_pin_obj_t pin_UART2_RXD;
+extern const mcu_pin_obj_t pin_UART2_TXD;
+extern const mcu_pin_obj_t pin_HIF_IRQ_OUT;
+extern const mcu_pin_obj_t pin_PWM3;
+extern const mcu_pin_obj_t pin_SPI2_MOSI;
+extern const mcu_pin_obj_t pin_PWM1;
+extern const mcu_pin_obj_t pin_PWM0;
+extern const mcu_pin_obj_t pin_SPI3_CS1_X;
+extern const mcu_pin_obj_t pin_SPI2_MISO;
+extern const mcu_pin_obj_t pin_PWM2;
+extern const mcu_pin_obj_t pin_SPI4_CS_X;
+extern const mcu_pin_obj_t pin_SPI4_MOSI;
+extern const mcu_pin_obj_t pin_SPI4_MISO;
+extern const mcu_pin_obj_t pin_SPI4_SCK;
+extern const mcu_pin_obj_t pin_I2C0_BDT;
+extern const mcu_pin_obj_t pin_I2C0_BCK;
+extern const mcu_pin_obj_t pin_EMMC_DATA0;
+extern const mcu_pin_obj_t pin_EMMC_DATA1;
+extern const mcu_pin_obj_t pin_I2S0_DATA_OUT;
+extern const mcu_pin_obj_t pin_I2S0_DATA_IN;
+extern const mcu_pin_obj_t pin_EMMC_DATA2;
+extern const mcu_pin_obj_t pin_EMMC_DATA3;
+extern const mcu_pin_obj_t pin_SEN_IRQ_IN;
+extern const mcu_pin_obj_t pin_EMMC_CLK;
+extern const mcu_pin_obj_t pin_EMMC_CMD;
+extern const mcu_pin_obj_t pin_I2S0_LRCK;
+extern const mcu_pin_obj_t pin_I2S0_BCK;
+extern const mcu_pin_obj_t pin_UART2_CTS;
+extern const mcu_pin_obj_t pin_UART2_RTS;
+extern const mcu_pin_obj_t pin_I2S1_BCK;
+extern const mcu_pin_obj_t pin_I2S1_LRCK;
+extern const mcu_pin_obj_t pin_I2S1_DATA_IN;
+extern const mcu_pin_obj_t pin_I2S1_DATA_OUT;
+extern const mcu_pin_obj_t pin_LPADC0;
+extern const mcu_pin_obj_t pin_LPADC1;
+extern const mcu_pin_obj_t pin_LPADC2;
+extern const mcu_pin_obj_t pin_LPADC3;
+extern const mcu_pin_obj_t pin_HPADC0;
+extern const mcu_pin_obj_t pin_HPADC1;
+
+void never_reset_pin_number(uint8_t pin_number);
+void reset_pin_number(uint8_t pin_number);
+void reset_all_pins(void);
+void claim_pin(const mcu_pin_obj_t* pin);
+
+#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_MICROCONTROLLER_PIN_H
diff --git a/ports/cxd56/common-hal/microcontroller/Processor.c b/ports/cxd56/common-hal/microcontroller/Processor.c
new file mode 100644
index 000000000..355ee01df
--- /dev/null
+++ b/ports/cxd56/common-hal/microcontroller/Processor.c
@@ -0,0 +1,41 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright 2019 Sony Semiconductor Solutions Corporation
+ *
+ * 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 <sys/boardctl.h>
+
+#include "py/mphal.h"
+
+uint32_t common_hal_mcu_processor_get_frequency(void) {
+ return mp_hal_ticks_cpu();
+}
+
+float common_hal_mcu_processor_get_temperature(void) {
+ return 0;
+}
+
+void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
+ boardctl(BOARDIOC_UNIQUEID, (uintptr_t) raw_id);
+}
diff --git a/ports/cxd56/common-hal/microcontroller/Processor.h b/ports/cxd56/common-hal/microcontroller/Processor.h
new file mode 100644
index 000000000..12555e82c
--- /dev/null
+++ b/ports/cxd56/common-hal/microcontroller/Processor.h
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright 2019 Sony Semiconductor Solutions Corporation
+ *
+ * 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.
+ */
+
+#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
+#define MICROPY_INCLUDED_CXD56_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
+
+#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH CONFIG_BOARDCTL_UNIQUEID_SIZE
+
+#include "py/obj.h"
+
+typedef struct {
+ mp_obj_base_t base;
+} mcu_processor_obj_t;
+
+const mp_obj_type_t mcu_processor_type;
+
+#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
diff --git a/ports/cxd56/common-hal/microcontroller/__init__.c b/ports/cxd56/common-hal/microcontroller/__init__.c
new file mode 100644
index 000000000..2be74b006
--- /dev/null
+++ b/ports/cxd56/common-hal/microcontroller/__init__.c
@@ -0,0 +1,111 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright 2019 Sony Semiconductor Solutions Corporation
+ *
+ * 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 <sys/boardctl.h>
+
+#include "py/mphal.h"
+#include "py/runtime.h"
+
+#include "shared-bindings/microcontroller/__init__.h"
+#include "common-hal/microcontroller/Pin.h"
+#include "supervisor/filesystem.h"
+#include "supervisor/shared/safe_mode.h"
+
+// The singleton microcontroller.Processor object, bound to microcontroller.cpu
+// It currently only has properties, and no state.
+const mcu_processor_obj_t common_hal_mcu_processor_obj = {
+ .base = {
+ .type = &mcu_processor_type,
+ },
+};
+
+void common_hal_mcu_delay_us(uint32_t delay) {
+ mp_hal_delay_us(delay);
+}
+
+void common_hal_mcu_disable_interrupts(void) {
+ __asm volatile ("cpsid i" : : : "memory");
+}
+
+void common_hal_mcu_enable_interrupts(void) {
+ __asm volatile ("cpsie i" : : : "memory");
+}
+
+void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
+ if(runmode == RUNMODE_BOOTLOADER) {
+ mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present."));
+ } else if(runmode == RUNMODE_SAFE_MODE) {
+ safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE);
+ }
+}
+
+void common_hal_mcu_reset(void) {
+ filesystem_flush();
+ boardctl(BOARDIOC_RESET, 0);
+}
+
+STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = {
+ { MP_ROM_QSTR(MP_QSTR_UART2_RXD), MP_ROM_PTR(&pin_UART2_RXD) },
+ { MP_ROM_QSTR(MP_QSTR_UART2_TXD), MP_ROM_PTR(&pin_UART2_TXD) },
+ { MP_ROM_QSTR(MP_QSTR_HIF_IRQ_OUT), MP_ROM_PTR(&pin_HIF_IRQ_OUT) },
+ { MP_ROM_QSTR(MP_QSTR_PWM3), MP_ROM_PTR(&pin_PWM3) },
+ { MP_ROM_QSTR(MP_QSTR_SPI2_MOSI), MP_ROM_PTR(&pin_SPI2_MOSI) },
+ { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_PWM1) },
+ { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_PWM0) },
+ { MP_ROM_QSTR(MP_QSTR_SPI3_CS1_X), MP_ROM_PTR(&pin_SPI3_CS1_X) },
+ { MP_ROM_QSTR(MP_QSTR_SPI2_MISO), MP_ROM_PTR(&pin_SPI2_MISO) },
+ { MP_ROM_QSTR(MP_QSTR_PWM2), MP_ROM_PTR(&pin_PWM2) },
+ { MP_ROM_QSTR(MP_QSTR_SPI4_CS_X), MP_ROM_PTR(&pin_SPI4_CS_X) },
+ { MP_ROM_QSTR(MP_QSTR_SPI4_MOSI), MP_ROM_PTR(&pin_SPI4_MOSI) },
+ { MP_ROM_QSTR(MP_QSTR_SPI4_MISO), MP_ROM_PTR(&pin_SPI4_MISO) },
+ { MP_ROM_QSTR(MP_QSTR_SPI4_SCK), MP_ROM_PTR(&pin_SPI4_SCK) },
+ { MP_ROM_QSTR(MP_QSTR_I2C0_BDT), MP_ROM_PTR(&pin_I2C0_BDT) },
+ { MP_ROM_QSTR(MP_QSTR_I2C0_BCK), MP_ROM_PTR(&pin_I2C0_BCK) },
+ { MP_ROM_QSTR(MP_QSTR_EMMC_DATA0), MP_ROM_PTR(&pin_EMMC_DATA0) },
+ { MP_ROM_QSTR(MP_QSTR_EMMC_DATA1), MP_ROM_PTR(&pin_EMMC_DATA1) },
+ { MP_ROM_QSTR(MP_QSTR_I2S0_DATA_OUT), MP_ROM_PTR(&pin_I2S0_DATA_OUT) },
+ { MP_ROM_QSTR(MP_QSTR_I2S0_DATA_IN), MP_ROM_PTR(&pin_I2S0_DATA_IN) },
+ { MP_ROM_QSTR(MP_QSTR_EMMC_DATA2), MP_ROM_PTR(&pin_EMMC_DATA2) },
+ { MP_ROM_QSTR(MP_QSTR_EMMC_DATA3), MP_ROM_PTR(&pin_EMMC_DATA3) },
+ { MP_ROM_QSTR(MP_QSTR_SEN_IRQ_IN), MP_ROM_PTR(&pin_SEN_IRQ_IN) },
+ { MP_ROM_QSTR(MP_QSTR_EMMC_CLK), MP_ROM_PTR(&pin_EMMC_CLK) },
+ { MP_ROM_QSTR(MP_QSTR_EMMC_CMD), MP_ROM_PTR(&pin_EMMC_CMD) },
+ { MP_ROM_QSTR(MP_QSTR_I2S0_LRCK), MP_ROM_PTR(&pin_I2S0_LRCK) },
+ { MP_ROM_QSTR(MP_QSTR_I2S0_BCK), MP_ROM_PTR(&pin_I2S0_BCK) },
+ { MP_ROM_QSTR(MP_QSTR_UART2_CTS), MP_ROM_PTR(&pin_UART2_CTS) },
+ { MP_ROM_QSTR(MP_QSTR_UART2_RTS), MP_ROM_PTR(&pin_UART2_RTS) },
+ { MP_ROM_QSTR(MP_QSTR_I2S1_BCK), MP_ROM_PTR(&pin_I2S1_BCK) },
+ { MP_ROM_QSTR(MP_QSTR_I2S1_LRCK), MP_ROM_PTR(&pin_I2S1_LRCK) },
+ { MP_ROM_QSTR(MP_QSTR_I2S1_DATA_IN), MP_ROM_PTR(&pin_I2S1_DATA_IN) },
+ { MP_ROM_QSTR(MP_QSTR_I2S1_DATA_OUT), MP_ROM_PTR(&pin_I2S1_DATA_OUT) },
+ { MP_ROM_QSTR(MP_QSTR_LPADC0), MP_ROM_PTR(&pin_LPADC0) },
+ { MP_ROM_QSTR(MP_QSTR_LPADC1), MP_ROM_PTR(&pin_LPADC1) },
+ { MP_ROM_QSTR(MP_QSTR_LPADC2), MP_ROM_PTR(&pin_LPADC2) },
+ { MP_ROM_QSTR(MP_QSTR_LPADC3), MP_ROM_PTR(&pin_LPADC3) },
+ { MP_ROM_QSTR(MP_QSTR_HPADC0), MP_ROM_PTR(&pin_HPADC0) },
+ { MP_ROM_QSTR(MP_QSTR_HPADC1), MP_ROM_PTR(&pin_HPADC1) },
+};
+MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table);