From cd1ab7645e6528b9de6587669ae4fe38a5f55853 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 3 Jul 2024 15:17:48 +0100 Subject: [PATCH] rp2/boards/PIMORONI_PICOLIPO: Refactor Pico LiPo to use board variants. Combine the 4MB and 16MB "PIMORONI_PICOLIPO" variants into a single board. Signed-off-by: Phil Howard --- .../board.json | 5 ++- .../mpconfigboard.cmake | 0 .../mpconfigboard.h | 12 ++----- .../PIMORONI_PICOLIPO/mpconfigvariant.cmake | 6 ++++ .../mpconfigvariant_FLASH_16M.cmake | 6 ++++ ports/rp2/boards/PIMORONI_PICOLIPO/pins.csv | 31 +++++++++++++++++++ .../mpconfigboard.cmake | 1 - .../PIMORONI_PICOLIPO_16MB/mpconfigboard.h | 20 ------------ .../boards/PIMORONI_PICOLIPO_16MB/pins.csv | 1 - .../boards/PIMORONI_PICOLIPO_4MB/board.json | 21 ------------- .../rp2/boards/PIMORONI_PICOLIPO_4MB/pins.csv | 1 - 11 files changed, 50 insertions(+), 54 deletions(-) rename ports/rp2/boards/{PIMORONI_PICOLIPO_16MB => PIMORONI_PICOLIPO}/board.json (81%) rename ports/rp2/boards/{PIMORONI_PICOLIPO_4MB => PIMORONI_PICOLIPO}/mpconfigboard.cmake (100%) rename ports/rp2/boards/{PIMORONI_PICOLIPO_4MB => PIMORONI_PICOLIPO}/mpconfigboard.h (71%) create mode 100644 ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigvariant.cmake create mode 100644 ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigvariant_FLASH_16M.cmake create mode 100644 ports/rp2/boards/PIMORONI_PICOLIPO/pins.csv delete mode 100644 ports/rp2/boards/PIMORONI_PICOLIPO_16MB/mpconfigboard.cmake delete mode 100644 ports/rp2/boards/PIMORONI_PICOLIPO_16MB/mpconfigboard.h delete mode 100644 ports/rp2/boards/PIMORONI_PICOLIPO_16MB/pins.csv delete mode 100644 ports/rp2/boards/PIMORONI_PICOLIPO_4MB/board.json delete mode 100644 ports/rp2/boards/PIMORONI_PICOLIPO_4MB/pins.csv diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/board.json b/ports/rp2/boards/PIMORONI_PICOLIPO/board.json similarity index 81% rename from ports/rp2/boards/PIMORONI_PICOLIPO_16MB/board.json rename to ports/rp2/boards/PIMORONI_PICOLIPO/board.json index c44ea5551..5354df111 100644 --- a/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/board.json +++ b/ports/rp2/boards/PIMORONI_PICOLIPO/board.json @@ -14,8 +14,11 @@ "PimoroniPicoLipo_1of3_1024x1024.jpg" ], "mcu": "rp2040", - "product": "Pico LiPo (16MiB)", + "product": "Pico LiPo", "thumbnail": "", "url": "https://shop.pimoroni.com/products/pimoroni-pico-lipo", + "variants": { + "FLASH_16M": "16 MiB Flash" + }, "vendor": "Pimoroni" } diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO_4MB/mpconfigboard.cmake b/ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigboard.cmake similarity index 100% rename from ports/rp2/boards/PIMORONI_PICOLIPO_4MB/mpconfigboard.cmake rename to ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigboard.cmake diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO_4MB/mpconfigboard.h b/ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigboard.h similarity index 71% rename from ports/rp2/boards/PIMORONI_PICOLIPO_4MB/mpconfigboard.h rename to ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigboard.h index 53ade7291..857d21b26 100644 --- a/ports/rp2/boards/PIMORONI_PICOLIPO_4MB/mpconfigboard.h +++ b/ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigboard.h @@ -1,7 +1,9 @@ // https://shop.pimoroni.com/products/pimoroni-pico-lipo?variant=39386149093459 +#ifndef MICROPY_HW_BOARD_NAME #define MICROPY_HW_BOARD_NAME "Pimoroni Pico LiPo 4MB" -#define MICROPY_HW_FLASH_STORAGE_BYTES (3 * 1024 * 1024) +#endif +#define MICROPY_HW_FLASH_STORAGE_BYTES (PICO_FLASH_SIZE_BYTES - (1 * 1024 * 1024)) #define MICROPY_HW_USB_VID (0x2E8A) #define MICROPY_HW_USB_PID (0x1002) @@ -10,11 +12,3 @@ #define MICROPY_HW_UART1_RX (9) #define MICROPY_HW_UART1_CTS (10) #define MICROPY_HW_UART1_RTS (11) - -// User LED GPIO25 - -// VBUS_SENSE GPIO24 - -// BAT_SENSE GPIO29 - -// Boot button GPIO23 diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigvariant.cmake b/ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigvariant.cmake new file mode 100644 index 000000000..84c75ad02 --- /dev/null +++ b/ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigvariant.cmake @@ -0,0 +1,6 @@ +set(PICO_BOARD "pimoroni_picolipo_4mb") + +# Override the MicroPython board name +list(APPEND MICROPY_DEF_BOARD + MICROPY_HW_BOARD_NAME="Pimoroni Pico LiPo 4MB" +) \ No newline at end of file diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigvariant_FLASH_16M.cmake b/ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigvariant_FLASH_16M.cmake new file mode 100644 index 000000000..0cf7cbd8f --- /dev/null +++ b/ports/rp2/boards/PIMORONI_PICOLIPO/mpconfigvariant_FLASH_16M.cmake @@ -0,0 +1,6 @@ +set(PICO_BOARD "pimoroni_picolipo_16mb") + +# Override the MicroPython board name +list(APPEND MICROPY_DEF_BOARD + MICROPY_HW_BOARD_NAME="Pimoroni Pico LiPo 16MB" +) \ No newline at end of file diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO/pins.csv b/ports/rp2/boards/PIMORONI_PICOLIPO/pins.csv new file mode 100644 index 000000000..a30916323 --- /dev/null +++ b/ports/rp2/boards/PIMORONI_PICOLIPO/pins.csv @@ -0,0 +1,31 @@ +GP0,GPIO0 +GP1,GPIO1 +GP2,GPIO2 +GP3,GPIO3 +GP4,GPIO4 +GP5,GPIO5 +GP6,GPIO6 +GP7,GPIO7 +GP8,GPIO8 +GP9,GPIO9 +GP10,GPIO10 +GP11,GPIO11 +GP12,GPIO12 +GP13,GPIO13 +GP14,GPIO14 +GP15,GPIO15 +GP16,GPIO16 +GP17,GPIO17 +GP18,GPIO18 +GP19,GPIO19 +GP20,GPIO20 +GP21,GPIO21 +GP22,GPIO22 +GP25,GPIO25 +GP26,GPIO26 +GP27,GPIO27 +GP28,GPIO28 +BOOT,GPIO23 +VBUS_SENSE,GPIO24 +LED,GPIO25 +BAT_SENSE,GPIO29 \ No newline at end of file diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/mpconfigboard.cmake b/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/mpconfigboard.cmake deleted file mode 100644 index b98ff4495..000000000 --- a/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/mpconfigboard.cmake +++ /dev/null @@ -1 +0,0 @@ -# cmake file for Pimoroni Pico LiPo 16MB diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/mpconfigboard.h b/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/mpconfigboard.h deleted file mode 100644 index a90ef6783..000000000 --- a/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/mpconfigboard.h +++ /dev/null @@ -1,20 +0,0 @@ -// https://shop.pimoroni.com/products/pimoroni-pico-lipo?variant=39335427080275 - -#define MICROPY_HW_BOARD_NAME "Pimoroni Pico LiPo 16MB" -#define MICROPY_HW_FLASH_STORAGE_BYTES (15 * 1024 * 1024) - -#define MICROPY_HW_USB_VID (0x2E8A) -#define MICROPY_HW_USB_PID (0x1003) - -#define MICROPY_HW_UART1_TX (8) -#define MICROPY_HW_UART1_RX (9) -#define MICROPY_HW_UART1_CTS (10) -#define MICROPY_HW_UART1_RTS (11) - -// User LED GPIO25 - -// VBUS_SENSE GPIO24 - -// BAT_SENSE GPIO29 - -// Boot button GPIO23 diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/pins.csv b/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/pins.csv deleted file mode 100644 index e75354485..000000000 --- a/ports/rp2/boards/PIMORONI_PICOLIPO_16MB/pins.csv +++ /dev/null @@ -1 +0,0 @@ -LED,GPIO25 diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO_4MB/board.json b/ports/rp2/boards/PIMORONI_PICOLIPO_4MB/board.json deleted file mode 100644 index cb06c746b..000000000 --- a/ports/rp2/boards/PIMORONI_PICOLIPO_4MB/board.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "deploy": [ - "../deploy.md" - ], - "docs": "", - "features": [ - "Battery Charging", - "Dual-core", - "External Flash", - "JST-SH", - "USB-C" - ], - "images": [ - "PimoroniPicoLipo_1of3_1024x1024.jpg" - ], - "mcu": "rp2040", - "product": "Pico LiPo (4MiB)", - "thumbnail": "", - "url": "https://shop.pimoroni.com/products/pimoroni-pico-lipo", - "vendor": "Pimoroni" -} diff --git a/ports/rp2/boards/PIMORONI_PICOLIPO_4MB/pins.csv b/ports/rp2/boards/PIMORONI_PICOLIPO_4MB/pins.csv deleted file mode 100644 index e75354485..000000000 --- a/ports/rp2/boards/PIMORONI_PICOLIPO_4MB/pins.csv +++ /dev/null @@ -1 +0,0 @@ -LED,GPIO25