-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from liangyingy/master
feature/T-PicoC3: Add T-PicoC3 board - Support T-PicoC3 - Add st7789 module
- Loading branch information
Showing
11 changed files
with
246 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
language: c | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
|
||
jobs: | ||
include: | ||
- stage: micropython_build | ||
env: NAME="micropython build" | ||
install: | ||
- sudo apt-get update | ||
- sudo apt-get install git make python3 python3-pip cmake | ||
script: | ||
- cp config_T5-4.7 config | ||
- make | ||
- cp config_T-CALL config | ||
- make | ||
- cp config_T-SIM7000G config | ||
- make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CONFIG_TARGET=rp2 | ||
CONFIG_BOARD=LILYGO_T_PicoC3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
define st7789/info | ||
PKG_NAME:=st7789 | ||
PKG_SOURCE_URL:=https://github.com/russhughes/st7789_mpy.git | ||
PKG_SOURCE_PROTO:=git | ||
PKG_SOURCE_VERSION:=master | ||
PKG_SOURCE_MD5:= | ||
endef | ||
|
||
include $(INCLUDE_DIR)/download.mk | ||
include $(INCLUDE_DIR)/package.mk | ||
|
||
# PKG_DEPEND:=LilyGo-EPD47 | ||
# $(foreach var, $(PKG_DEPEND), make -C $(TOP_DIR)/libs/$(var);) | ||
all: | ||
$(eval $(st7789/info)) | ||
$(call Package/prereq,$(TARGET_BUILD_DIR)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set(ST7789_DIR ${CMAKE_BINARY_DIR}/../st7789) | ||
|
||
include(${ST7789_DIR}/st7789/micropython.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
micropython/patches/006-Add-LILYGO_T-PicoC3-board.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
Index: micropython/lib/pico-sdk/src/boards/include/boards/lilygo_t_picoc3.h | ||
=================================================================== | ||
--- /dev/null | ||
+++ micropython/lib/pico-sdk/src/boards/include/boards/lilygo_t_picoc3.h | ||
@@ -0,0 +1,84 @@ | ||
+/* | ||
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. | ||
+ * | ||
+ * SPDX-License-Identifier: BSD-3-Clause | ||
+ */ | ||
+ | ||
+// ----------------------------------------------------- | ||
+// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO | ||
+// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES | ||
+// ----------------------------------------------------- | ||
+ | ||
+// This header may be included by other board headers as "boards/pico.h" | ||
+ | ||
+#ifndef _BOARDS_PICO_H | ||
+#define _BOARDS_PICO_H | ||
+ | ||
+// For board detection | ||
+#define RASPBERRYPI_PICO | ||
+ | ||
+// --- UART --- | ||
+#ifndef PICO_DEFAULT_UART | ||
+#define PICO_DEFAULT_UART 0 | ||
+#endif | ||
+#ifndef PICO_DEFAULT_UART_TX_PIN | ||
+#define PICO_DEFAULT_UART_TX_PIN 0 | ||
+#endif | ||
+#ifndef PICO_DEFAULT_UART_RX_PIN | ||
+#define PICO_DEFAULT_UART_RX_PIN 1 | ||
+#endif | ||
+ | ||
+// --- LED --- | ||
+#ifndef PICO_DEFAULT_LED_PIN | ||
+#define PICO_DEFAULT_LED_PIN 25 | ||
+#endif | ||
+// no PICO_DEFAULT_WS2812_PIN | ||
+ | ||
+// --- I2C --- | ||
+#ifndef PICO_DEFAULT_I2C | ||
+#define PICO_DEFAULT_I2C 0 | ||
+#endif | ||
+#ifndef PICO_DEFAULT_I2C_SDA_PIN | ||
+#define PICO_DEFAULT_I2C_SDA_PIN 4 | ||
+#endif | ||
+#ifndef PICO_DEFAULT_I2C_SCL_PIN | ||
+#define PICO_DEFAULT_I2C_SCL_PIN 5 | ||
+#endif | ||
+ | ||
+// --- SPI --- | ||
+#ifndef PICO_DEFAULT_SPI | ||
+#define PICO_DEFAULT_SPI 0 | ||
+#endif | ||
+#ifndef PICO_DEFAULT_SPI_SCK_PIN | ||
+#define PICO_DEFAULT_SPI_SCK_PIN 18 | ||
+#endif | ||
+#ifndef PICO_DEFAULT_SPI_TX_PIN | ||
+#define PICO_DEFAULT_SPI_TX_PIN 19 | ||
+#endif | ||
+#ifndef PICO_DEFAULT_SPI_RX_PIN | ||
+#define PICO_DEFAULT_SPI_RX_PIN 16 | ||
+#endif | ||
+#ifndef PICO_DEFAULT_SPI_CSN_PIN | ||
+#define PICO_DEFAULT_SPI_CSN_PIN 17 | ||
+#endif | ||
+ | ||
+// --- FLASH --- | ||
+ | ||
+#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1 | ||
+ | ||
+#ifndef PICO_FLASH_SPI_CLKDIV | ||
+#define PICO_FLASH_SPI_CLKDIV 2 | ||
+#endif | ||
+ | ||
+#ifndef PICO_FLASH_SIZE_BYTES | ||
+#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024) | ||
+#endif | ||
+ | ||
+// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads) | ||
+#define PICO_SMPS_MODE_PIN 23 | ||
+ | ||
+#ifndef PICO_RP2040_B0_SUPPORTED | ||
+#define PICO_RP2040_B0_SUPPORTED 1 | ||
+#endif | ||
+ | ||
+#endif | ||
Index: micropython/ports/rp2/boards/LILYGO_T_PicoC3/board.json | ||
=================================================================== | ||
--- /dev/null | ||
+++ micropython/ports/rp2/boards/LILYGO_T_PicoC3/board.json | ||
@@ -0,0 +1,23 @@ | ||
+{ | ||
+ "deploy": [ | ||
+ "../deploy.md" | ||
+ ], | ||
+ "docs": "", | ||
+ "features": [ | ||
+ "WiFi ESP32-C3", | ||
+ "Bluetooth ESP32-C3", | ||
+ "LCD ST7789", | ||
+ "SPI Flash 4MB", | ||
+ "Battery", | ||
+ "USB TYPE-C" | ||
+ ], | ||
+ "id": "rp2-pico", | ||
+ "images": [ | ||
+ "rp2-pico.jpg" | ||
+ ], | ||
+ "mcu": "rp2040", | ||
+ "product": "Pico", | ||
+ "thumbnail": "", | ||
+ "url": "https://www.raspberrypi.org/products/raspberry-pi-pico/", | ||
+ "vendor": "Raspberry Pi" | ||
+} | ||
Index: micropython/ports/rp2/boards/LILYGO_T_PicoC3/mpconfigboard.cmake | ||
=================================================================== | ||
--- /dev/null | ||
+++ micropython/ports/rp2/boards/LILYGO_T_PicoC3/mpconfigboard.cmake | ||
@@ -0,0 +1,2 @@ | ||
+# cmake file for Raspberry Pi Pico | ||
+set(EXTMOD_ST7789 1) | ||
\ No newline at end of file | ||
Index: micropython/ports/rp2/boards/LILYGO_T_PicoC3/mpconfigboard.h | ||
=================================================================== | ||
--- /dev/null | ||
+++ micropython/ports/rp2/boards/LILYGO_T_PicoC3/mpconfigboard.h | ||
@@ -0,0 +1,3 @@ | ||
+// Board and hardware specific configuration | ||
+#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico" | ||
+#define MICROPY_HW_FLASH_STORAGE_BYTES (1408 * 1024) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
include $(INCLUDE_DIR)/download.mk | ||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define rp2/info | ||
PKG_NAME:= | ||
PKG_SOURCE_URL:= | ||
PKG_SOURCE_PROTO:= | ||
PKG_SOURCE_VERSION:= | ||
PKG_SOURCE_MD5:= | ||
endef | ||
|
||
# $(call DownloadMethod/git,$(PKG_NAME),$(PKG_SOURCE_URL),$(PKG_SOURCE_VERSION)) ; | ||
define rp2/prereq | ||
# sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential | ||
@echo "Please pre-install gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential" | ||
endef | ||
|
||
## | ||
## $(1) MODULES | ||
## | ||
define rp2/compile | ||
make -C $(TARGET_BUILD_DIR)/micropython/mpy-cross && \ | ||
cd $(TARGET_BUILD_DIR)/micropython/ports/rp2 && \ | ||
make BOARD=$(BOARD) BUILD=$(BUILD_DIR)/$(TARGET)/$(BOARD) \ | ||
USER_C_MODULES=$(TOP_DIR)/extmod/micropython.cmake \ | ||
EXTMOD_FROZEN_DIR=$(TOP_DIR)/extmod && \ | ||
cd - | ||
endef | ||
|
||
|
||
define rp2/install | ||
[ -d $(BIN_DIR) ] && mkdir -p $(BIN_DIR)/rp2/$(BOARD) | ||
img_name=LilyGo-MicroPython_$(TARGET)_$(BOARD) && \ | ||
cd $(TARGET_BUILD_DIR)/micropython && \ | ||
micropython_version=`git show -s --pretty=format:%h` && \ | ||
img_name=$${img_name}_MPY-$${micropython_version} && \ | ||
time=`date +"%Y%m%d"` && \ | ||
img_name=$${img_name}_B$${time} && \ | ||
md5=`md5sum $(TARGET_BUILD_DIR)/$(BOARD)/firmware.bin | awk '{print $$1}'` && \ | ||
img_name=$${img_name}_$${md5:0:10} && \ | ||
cp $(TARGET_BUILD_DIR)/$(BOARD)/firmware.uf2 $(BIN_DIR)/rp2/$(BOARD)/$${img_name}.uf2 | ||
endef |