Skip to content

Commit 16ed99e

Browse files
HosakaSuRbb666
authored andcommitted
peripherals: add ch390 package
Signed-off-by: HosakaSu <liucj1228@outlook.com>
1 parent 601ef6c commit 16ed99e

3 files changed

Lines changed: 102 additions & 0 deletions

File tree

peripherals/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ source "$PKGS_DIR/packages/peripherals/ld3320/Kconfig"
4141
source "$PKGS_DIR/packages/peripherals/wk2124/Kconfig"
4242
source "$PKGS_DIR/packages/peripherals/ly68l6400/Kconfig"
4343
source "$PKGS_DIR/packages/peripherals/dm9051/Kconfig"
44+
source "$PKGS_DIR/packages/peripherals/ch390/Kconfig"
4445
source "$PKGS_DIR/packages/peripherals/ssd1306/Kconfig"
4546
source "$PKGS_DIR/packages/peripherals/qkey/Kconfig"
4647
source "$PKGS_DIR/packages/peripherals/rs485/Kconfig"

peripherals/ch390/Kconfig

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
# Kconfig file for package CH390
3+
menuconfig PKG_USING_CH390
4+
bool "CH390: WCH SPI Ethernet Controller"
5+
default n
6+
select RT_USING_SPI
7+
select RT_USING_PIN
8+
select RT_USING_LWIP
9+
if PKG_USING_CH390
10+
11+
config PKG_CH390_PATH
12+
string
13+
default "/packages/peripherals/ch390"
14+
15+
choice
16+
prompt "version"
17+
help
18+
Select the CH390 driver version
19+
default PKG_USING_CH390_V100
20+
21+
config PKG_USING_CH390_V100
22+
bool "v1.0.0"
23+
24+
config PKG_USING_CH390_LATEST_VERSION
25+
bool "latest"
26+
endchoice
27+
28+
config PKG_CH390_VER
29+
string
30+
default "v1.0.0" if PKG_USING_CH390_V100
31+
default "latest" if PKG_USING_CH390_LATEST_VERSION
32+
33+
menu "CH390 device configure"
34+
35+
config CH390_SPI_BUS_NAME
36+
string "SPI bus name"
37+
default "spi0"
38+
39+
config CH390_SPI_DEVICE_NAME
40+
string "SPI device name"
41+
default "spi10"
42+
43+
config CH390_NETIF_NAME
44+
string "Ethernet device name"
45+
default "e0"
46+
47+
config CH390_CS_PIN
48+
int "CS PIN number"
49+
default 4
50+
51+
config CH390_RST_PIN
52+
int "Reset PIN number"
53+
default -1
54+
55+
config CH390_INT_PIN
56+
int "Interrupt PIN number"
57+
default 3
58+
59+
endmenu
60+
61+
config CH390_SPI_MAX_HZ
62+
int "SPI maximum frequency"
63+
default 5000000
64+
65+
config CH390_POLL_INTERVAL_MS
66+
int "RX polling interval in milliseconds"
67+
default 20
68+
69+
endif

peripherals/ch390/package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "ch390",
3+
"description": "WCH CH390 SPI Ethernet driver for RT-Thread",
4+
"description_zh": "WCH CH390 SPI 以太网控制器驱动",
5+
"enable": "PKG_USING_CH390",
6+
"keywords": [
7+
"ch390",
8+
"wch",
9+
"ethernet",
10+
"spi"
11+
],
12+
"category": "peripherals",
13+
"author": {
14+
"name": "Liu Changjie"
15+
},
16+
"license": "Apache-2.0",
17+
"repository": "https://github.com/HosakaSu/ch390",
18+
"homepage": "https://github.com/HosakaSu/ch390#readme",
19+
"site": [
20+
{
21+
"version": "v1.0.0",
22+
"URL": "https://github.com/HosakaSu/ch390/archive/refs/tags/v1.0.0.zip",
23+
"filename": "ch390-1.0.0.zip"
24+
},
25+
{
26+
"version": "latest",
27+
"URL": "https://github.com/HosakaSu/ch390.git",
28+
"filename": "ch390.zip",
29+
"VER_SHA": "master"
30+
}
31+
]
32+
}

0 commit comments

Comments
 (0)