Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions peripherals/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
69 changes: 69 additions & 0 deletions peripherals/ch390/Kconfig
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions peripherals/ch390/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}