From da7c74f6148080fbafa90ee3d289700dfac218c5 Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Thu, 27 May 2021 18:02:52 +0800 Subject: [PATCH 1/7] Initial commit. --- .../boards/cytron-maker-pi-rp2040/board.c | 37 +++++++++++++ .../cytron-maker-pi-rp2040/mpconfigboard.h | 2 + .../cytron-maker-pi-rp2040/mpconfigboard.mk | 11 ++++ .../boards/cytron-maker-pi-rp2040/pins.c | 52 +++++++++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 ports/raspberrypi/boards/cytron-maker-pi-rp2040/board.c create mode 100644 ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/cytron-maker-pi-rp2040/pins.c diff --git a/ports/raspberrypi/boards/cytron-maker-pi-rp2040/board.c b/ports/raspberrypi/boards/cytron-maker-pi-rp2040/board.c new file mode 100644 index 0000000000..67486d4c23 --- /dev/null +++ b/ports/raspberrypi/boards/cytron-maker-pi-rp2040/board.c @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 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" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.h b/ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.h new file mode 100644 index 0000000000..efb2fc3402 --- /dev/null +++ b/ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.h @@ -0,0 +1,2 @@ +#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico" +#define MICROPY_HW_MCU_NAME "rp2040" diff --git a/ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.mk new file mode 100644 index 0000000000..608ca280df --- /dev/null +++ b/ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x239A +USB_PID = 0x80F4 +USB_PRODUCT = "Pico" +USB_MANUFACTURER = "Raspberry Pi" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/cytron-maker-pi-rp2040/pins.c b/ports/raspberrypi/boards/cytron-maker-pi-rp2040/pins.c new file mode 100644 index 0000000000..057eaec2af --- /dev/null +++ b/ports/raspberrypi/boards/cytron-maker-pi-rp2040/pins.c @@ -0,0 +1,52 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 321e5dd16f4c72bc597baf40ff5f878d8f41ab6f Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Fri, 28 May 2021 18:01:02 +0800 Subject: [PATCH 2/7] Use underscore instead of dash for board name. --- .../{cytron-maker-pi-rp2040 => cytron_maker_pi_rp2040}/board.c | 0 .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../{cytron-maker-pi-rp2040 => cytron_maker_pi_rp2040}/pins.c | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename ports/raspberrypi/boards/{cytron-maker-pi-rp2040 => cytron_maker_pi_rp2040}/board.c (100%) rename ports/raspberrypi/boards/{cytron-maker-pi-rp2040 => cytron_maker_pi_rp2040}/mpconfigboard.h (100%) rename ports/raspberrypi/boards/{cytron-maker-pi-rp2040 => cytron_maker_pi_rp2040}/mpconfigboard.mk (100%) rename ports/raspberrypi/boards/{cytron-maker-pi-rp2040 => cytron_maker_pi_rp2040}/pins.c (100%) diff --git a/ports/raspberrypi/boards/cytron-maker-pi-rp2040/board.c b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c similarity index 100% rename from ports/raspberrypi/boards/cytron-maker-pi-rp2040/board.c rename to ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c diff --git a/ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.h b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h similarity index 100% rename from ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.h rename to ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h diff --git a/ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk similarity index 100% rename from ports/raspberrypi/boards/cytron-maker-pi-rp2040/mpconfigboard.mk rename to ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk diff --git a/ports/raspberrypi/boards/cytron-maker-pi-rp2040/pins.c b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c similarity index 100% rename from ports/raspberrypi/boards/cytron-maker-pi-rp2040/pins.c rename to ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c From 5920ac647a66ff93fe0ec5167f71f5706c1af8f5 Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Fri, 28 May 2021 22:42:54 +0800 Subject: [PATCH 3/7] Modified the essential files for Maker Pi RP2040. --- .github/workflows/build.yml | 1 + .../cytron_maker_pi_rp2040/mpconfigboard.h | 13 +++++++- .../cytron_maker_pi_rp2040/mpconfigboard.mk | 8 ++--- .../boards/cytron_maker_pi_rp2040/pins.c | 31 ++++++++++++------- 4 files changed, 36 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b23f4538e..67c93fc02b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -212,6 +212,7 @@ jobs: - "cp_sapling_m0" - "cp_sapling_m0_revb" - "cp_sapling_m0_spiflash" + - "cytron_maker_pi_rp2040" - "datalore_ip_m4" - "datum_distance" - "datum_imu" diff --git a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h index efb2fc3402..341b0f619b 100644 --- a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h @@ -1,2 +1,13 @@ -#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico" +#define MICROPY_HW_BOARD_NAME "Cytron Maker Pi RP2040" #define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#define MICROPY_HW_BAT_SENSE (&pin_GPIO29) + +#define MICROPY_HW_BUZZER (&pin_GPIO22) + +#define MICROPY_HW_MOTOR_M1A (&pin_GPIO8) +#define MICROPY_HW_MOTOR_M1B (&pin_GPIO9) +#define MICROPY_HW_MOTOR_M2A (&pin_GPIO10) +#define MICROPY_HW_MOTOR_M2B (&pin_GPIO11) diff --git a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk index 608ca280df..6d6dc1af1b 100644 --- a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk @@ -1,7 +1,7 @@ -USB_VID = 0x239A -USB_PID = 0x80F4 -USB_PRODUCT = "Pico" -USB_MANUFACTURER = "Raspberry Pi" +USB_VID = 0x2E8A +USB_PID = 0x1000 +USB_PRODUCT = "Maker Pi RP2040" +USB_MANUFACTURER = "Cytron" CHIP_VARIANT = RP2040 CHIP_FAMILY = rp2 diff --git a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c index 057eaec2af..20cefa591b 100644 --- a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c @@ -9,31 +9,37 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, - { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_M1A), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_M1B), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_M2A), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_M2B), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_RGB), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO22) }, { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, - { MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_GPIO23) }, - { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, - - { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO24) }, - { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, - - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, - { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, - { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, @@ -47,6 +53,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_VBATT), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From bfcb8c5896583c8a0c9e9e10ef1ee1a539580d4c Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Sat, 29 May 2021 00:47:14 +0800 Subject: [PATCH 4/7] Do not use neopixel as status LED. Also removed the unused definition. --- .../boards/cytron_maker_pi_rp2040/mpconfigboard.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h index 341b0f619b..9c035c7d13 100644 --- a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.h @@ -1,13 +1,2 @@ #define MICROPY_HW_BOARD_NAME "Cytron Maker Pi RP2040" #define MICROPY_HW_MCU_NAME "rp2040" - -#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) - -#define MICROPY_HW_BAT_SENSE (&pin_GPIO29) - -#define MICROPY_HW_BUZZER (&pin_GPIO22) - -#define MICROPY_HW_MOTOR_M1A (&pin_GPIO8) -#define MICROPY_HW_MOTOR_M1B (&pin_GPIO9) -#define MICROPY_HW_MOTOR_M2A (&pin_GPIO10) -#define MICROPY_HW_MOTOR_M2B (&pin_GPIO11) From ebda9e07f484b969b12cd66ad0a1aeaa3298c63b Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Sat, 29 May 2021 01:04:13 +0800 Subject: [PATCH 5/7] Use 4 spaces instead of tab. --- .../boards/cytron_maker_pi_rp2040/pins.c | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c index 20cefa591b..5229642670 100644 --- a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c @@ -9,35 +9,35 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, - + { MP_ROM_QSTR(MP_QSTR_M1A), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, - + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_M1B), MP_ROM_PTR(&pin_GPIO9) }, - { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, - + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_M2A), MP_ROM_PTR(&pin_GPIO10) }, - { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, - - { MP_ROM_QSTR(MP_QSTR_M2B), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_M2B), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, - + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, - - { MP_ROM_QSTR(MP_QSTR_RGB), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_RGB), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, - + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, - - { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO22) }, { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, @@ -53,7 +53,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, - { MP_ROM_QSTR(MP_QSTR_VBATT), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_VBATT), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From ebe4d90ac3fa6873e7f35fd1c23fe73e43b62ec2 Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Sat, 29 May 2021 10:12:22 +0800 Subject: [PATCH 6/7] Updated the copyright information. --- ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c index 67486d4c23..e68ca62414 100644 --- a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2021 Wai Weng for Cytron Technologies * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal From b06ec0a776a7633f9b22a61c7fa76103cdf52aa5 Mon Sep 17 00:00:00 2001 From: Kong Wai Weng Date: Sun, 30 May 2021 09:57:00 +0800 Subject: [PATCH 7/7] Added libraries dependency. --- .gitmodules | 3 +++ frozen/Adafruit_CircuitPython_SimpleIO | 1 + .../boards/cytron_maker_pi_rp2040/mpconfigboard.mk | 5 +++++ 3 files changed, 9 insertions(+) create mode 160000 frozen/Adafruit_CircuitPython_SimpleIO diff --git a/.gitmodules b/.gitmodules index 24ba2e2f6f..55fce0eebb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -184,3 +184,6 @@ [submodule "frozen/Adafruit_CircuitPython_MIDI"] path = frozen/Adafruit_CircuitPython_MIDI url = https://github.com/adafruit/Adafruit_CircuitPython_MIDI +[submodule "frozen/Adafruit_CircuitPython_SimpleIO"] + path = frozen/Adafruit_CircuitPython_SimpleIO + url = https://github.com/adafruit/adafruit_circuitpython_simpleio diff --git a/frozen/Adafruit_CircuitPython_SimpleIO b/frozen/Adafruit_CircuitPython_SimpleIO new file mode 160000 index 0000000000..dd00c66121 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SimpleIO @@ -0,0 +1 @@ +Subproject commit dd00c661217143b610903adf52c285cc5c5396a6 diff --git a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk index 6d6dc1af1b..049c230f94 100644 --- a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/mpconfigboard.mk @@ -9,3 +9,8 @@ CHIP_FAMILY = rp2 EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" CIRCUITPY__EVE = 1 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Motor +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SimpleIO