Skip to content

Commit 88240a3

Browse files
godmialRbb666
authored andcommitted
新增74HC165驱动
1 parent d0ea67f commit 88240a3

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

peripherals/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ source "$PKGS_DIR/packages/peripherals/gc9a01/Kconfig"
8181
source "$PKGS_DIR/packages/peripherals/ikun-485/Kconfig"
8282
source "$PKGS_DIR/packages/peripherals/Servo_sg90/Kconfig"
8383
source "$PKGS_DIR/packages/peripherals/sean_ws2812b/Kconfig"
84+
source "$PKGS_DIR/packages/peripherals/ic74hc165/Kconfig"
8485

8586
if RT_VER_NUM > 0x40101
8687
source "$PKGS_DIR/packages/peripherals/spi-tools/Kconfig"

peripherals/ic74hc165/Kconfig

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
menuconfig PKG_USING_IC74HC165
2+
bool "ic74hc165: 74HC165 GPIO/SPI 驱动"
3+
depends on RT_USING_COMPONENTS_INIT
4+
help
5+
使用 GPIO 或 SPI 模式读取 74HC165 输入数据的驱动软件包
6+
7+
if PKG_USING_IC74HC165
8+
9+
choice
10+
prompt "通信模式选择"
11+
default PKG_IC74HC165_MODE_GPIO
12+
help
13+
选择使用 GPIO 模拟方式 或 SPI 外设方式驱动 74165
14+
15+
config PKG_IC74HC165_MODE_GPIO
16+
bool "GPIO 模拟模式"
17+
18+
config PKG_IC74HC165_MODE_SPI
19+
bool "SPI 硬件模式"
20+
endchoice
21+
22+
config PKG_IC74HC165_SAMPLE
23+
bool "启用示例代码(sample/sample.c)"
24+
default y
25+
26+
config IC74HC165_NODE_COUNT
27+
int "节点数量(74HC165 串联芯片数)"
28+
default 1
29+
30+
config PKG_IC74HC165_USE_CLKINH
31+
bool "启用 CLK_INH(CE)引脚控制功能"
32+
default y
33+
34+
# SPI 专属配置
35+
if PKG_IC74HC165_MODE_SPI
36+
37+
config PKG_IC74HC165_SPI_BUS_NAME
38+
string "SPI 总线名称"
39+
default "spi1"
40+
help
41+
SPI 总线名,例如 spi1、spi2,必须在系统中存在
42+
43+
config PKG_IC74HC165_SPI_DEV_NAME
44+
string "SPI 设备名称"
45+
default "spi10"
46+
help
47+
SPI 设备逻辑名称,推荐使用 spi1x 结构
48+
49+
endif # PKG_IC74HC165_MODE_SPI
50+
51+
choice
52+
prompt "版本选择"
53+
help
54+
选择使用的 ic74hc165 软件包版本
55+
56+
config PKG_USING_IC74HC165_LATEST
57+
bool "latest version (main branch)"
58+
endchoice
59+
60+
config PKG_IC74HC165_VER
61+
string
62+
default "latest" if PKG_USING_IC74HC165_LATEST
63+
64+
config PKG_IC74HC165_PATH
65+
string
66+
default "/packages/peripherals/ic74hc165"
67+
68+
endif # PKG_USING_IC74HC165

peripherals/ic74hc165/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "ic74hc165",
3+
"description": "74HC165 GPIO/SPI driver for RT-Thread 4.x",
4+
"description_zh": "用于RT-Thread 的74HC165串行输入并行输出芯片驱动,支持GPIO与SPI两种模式",
5+
"enable": "PKG_USING_IC74HC165",
6+
"keywords": [
7+
"74hc165",
8+
"gpio",
9+
"spi",
10+
"shift-register"
11+
],
12+
"category": "peripherals",
13+
"author": {
14+
"name": "godmial",
15+
"email": "[email protected]",
16+
"github": "godmial"
17+
},
18+
"license": "Apache-2.0",
19+
"repository": "https://github.com/godmial/ic74hc165.git",
20+
"icon": "https://raw.githubusercontent.com/godmial/sean_ws2812b/main/icon.png",
21+
"homepage": "https://github.com/godmial/ic74hc165#readme",
22+
"doc": "https://github.com/godmial/ic74hc165#readme",
23+
"site": [
24+
{
25+
"version": "latest",
26+
"URL": "https://github.com/godmial/ic74hc165.git",
27+
"filename": "ic74hc165.zip",
28+
"VER_SHA": "main"
29+
}
30+
]
31+
}

0 commit comments

Comments
 (0)