diff --git a/peripherals/Kconfig b/peripherals/Kconfig index 91b909993a..aea30f2048 100644 --- a/peripherals/Kconfig +++ b/peripherals/Kconfig @@ -41,6 +41,7 @@ source "$PKGS_DIR/packages/peripherals/ld3320/Kconfig" source "$PKGS_DIR/packages/peripherals/wk2124/Kconfig" source "$PKGS_DIR/packages/peripherals/ly68l6400/Kconfig" source "$PKGS_DIR/packages/peripherals/dm9051/Kconfig" +source "$PKGS_DIR/packages/peripherals/ch390/Kconfig" source "$PKGS_DIR/packages/peripherals/ssd1306/Kconfig" source "$PKGS_DIR/packages/peripherals/qkey/Kconfig" source "$PKGS_DIR/packages/peripherals/rs485/Kconfig" diff --git a/peripherals/ch390/Kconfig b/peripherals/ch390/Kconfig new file mode 100644 index 0000000000..a18cc300e1 --- /dev/null +++ b/peripherals/ch390/Kconfig @@ -0,0 +1,69 @@ + +# Kconfig file for package CH390 +menuconfig PKG_USING_CH390 + bool "CH390: WCH SPI Ethernet Controller" + default n + select RT_USING_SPI + select RT_USING_PIN + select RT_USING_LWIP +if PKG_USING_CH390 + + config PKG_CH390_PATH + string + default "/packages/peripherals/ch390" + + choice + prompt "version" + help + Select the CH390 driver version + default PKG_USING_CH390_V100 + + config PKG_USING_CH390_V100 + bool "v1.0.0" + + config PKG_USING_CH390_LATEST_VERSION + bool "latest" + endchoice + + config PKG_CH390_VER + string + default "v1.0.0" if PKG_USING_CH390_V100 + default "latest" if PKG_USING_CH390_LATEST_VERSION + + menu "CH390 device configure" + + config CH390_SPI_BUS_NAME + string "SPI bus name" + default "spi0" + + config CH390_SPI_DEVICE_NAME + string "SPI device name" + default "spi10" + + config CH390_NETIF_NAME + string "Ethernet device name" + default "e0" + + config CH390_CS_PIN + int "CS PIN number" + default 4 + + config CH390_RST_PIN + int "Reset PIN number" + default -1 + + config CH390_INT_PIN + int "Interrupt PIN number" + default 3 + + endmenu + + config CH390_SPI_MAX_HZ + int "SPI maximum frequency" + default 5000000 + + config CH390_POLL_INTERVAL_MS + int "RX polling interval in milliseconds" + default 20 + +endif diff --git a/peripherals/ch390/package.json b/peripherals/ch390/package.json new file mode 100644 index 0000000000..0f6939a951 --- /dev/null +++ b/peripherals/ch390/package.json @@ -0,0 +1,32 @@ +{ + "name": "ch390", + "description": "WCH CH390 SPI Ethernet driver for RT-Thread", + "description_zh": "WCH CH390 SPI 以太网控制器驱动", + "enable": "PKG_USING_CH390", + "keywords": [ + "ch390", + "wch", + "ethernet", + "spi" + ], + "category": "peripherals", + "author": { + "name": "Liu Changjie" + }, + "license": "Apache-2.0", + "repository": "https://github.com/HosakaSu/ch390", + "homepage": "https://github.com/HosakaSu/ch390#readme", + "site": [ + { + "version": "v1.0.0", + "URL": "https://github.com/HosakaSu/ch390/archive/refs/tags/v1.0.0.zip", + "filename": "ch390-1.0.0.zip" + }, + { + "version": "latest", + "URL": "https://github.com/HosakaSu/ch390.git", + "filename": "ch390.zip", + "VER_SHA": "master" + } + ] +}