Skip to content

Commit 074dc6f

Browse files
kurisaWRbb666
authored andcommitted
add p-net package for Profinet device implementation
1 parent 4ec649a commit 074dc6f

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed

iot/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,5 @@ source "$PKGS_DIR/packages/iot/zephyr_polling/Kconfig"
6868
source "$PKGS_DIR/packages/iot/matter-adaptation-layer/Kconfig"
6969
source "$PKGS_DIR/packages/iot/lhc_modbus/Kconfig"
7070
source "$PKGS_DIR/packages/iot/qmodbus/Kconfig"
71+
source "$PKGS_DIR/packages/iot/p-net/Kconfig"
7172
endmenu

iot/p-net/Kconfig

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
menuconfig PKG_USING_PNET
2+
bool "P-Net stack for Profinet device implementation"
3+
select BSP_USING_ETH
4+
select RT_LWIP_SNMP
5+
select RT_LWIP_ENABLE_USER_HOOKS
6+
select PKG_PENT_NETIF_NAME
7+
select PKG_PNET_BOARD_CONFIG
8+
select PKG_PENT_FILESYSTEM_CONFIG
9+
select PKG_PNET_NET_CONFIG
10+
default n
11+
12+
if PKG_USING_PNET
13+
14+
config PKG_PNET_PATH
15+
string
16+
default "/packages/iot/p-net"
17+
18+
menuconfig PKG_PENT_NETIF_NAME
19+
bool "Default netif name for P-NET"
20+
default n
21+
if PKG_PENT_NETIF_NAME
22+
config APP_DEFAULT_ETHERNET_INTERFACE
23+
string "default ethernet interface name for p-net app, default as 'e00'"
24+
default "e00"
25+
endif
26+
27+
menuconfig PKG_PNET_BOARD_CONFIG
28+
bool "Enable P-NET sample board config"
29+
default n
30+
if PKG_PNET_BOARD_CONFIG
31+
config PNET_LED_PIN
32+
string "p-ent user led pin"
33+
default "PA9"
34+
config PNET_USER_KEY
35+
string "p-net user key pin"
36+
default "PA10"
37+
endif
38+
39+
menuconfig PKG_PENT_FILESYSTEM_CONFIG
40+
bool "Default root filesystem path for P-NET"
41+
default n
42+
if PKG_PENT_FILESYSTEM_CONFIG
43+
config PNET_USING_RAMFS
44+
bool "p-net using ramfs filesystem by default, or you can turn this off and choose another way to enable the filesystem"
45+
select RT_USING_DFS
46+
select RT_USING_DFS_RAMFS
47+
default n
48+
if PNET_USING_RAMFS
49+
config PNET_RAMFS_SIZE
50+
int "default memory size for ramfs"
51+
default 8192
52+
endif
53+
endif
54+
55+
menuconfig PKG_PNET_NET_CONFIG
56+
bool "P-NET sample slave network ip config"
57+
default n
58+
if PKG_PNET_NET_CONFIG
59+
config RT_LWIP_IPADDR
60+
string "set static ip address for profinet slaver"
61+
default "192.168.137.196"
62+
config RT_LWIP_GWADDR
63+
string "set static gateway address for profinet slaver"
64+
default "192.168.137.1"
65+
config RT_LWIP_MSKADDR
66+
string "set static mask address for profinet slaver"
67+
default "255.255.255.0"
68+
endif
69+
70+
choice
71+
prompt "version"
72+
help
73+
Select the PNET version
74+
75+
config PKG_USING_PNET_LATEST
76+
bool "latest"
77+
depends on RT_VER_NUM >= 0x50100
78+
79+
config PKG_USING_PNET_V100
80+
bool "v1.0.0"
81+
depends on RT_VER_NUM >= 0x50100
82+
endchoice
83+
84+
config PKG_PNET_VER
85+
string
86+
default "v1.0.0" if PKG_USING_PNET_V100
87+
default "latest" if PKG_USING_PNET_LATEST
88+
89+
endif

iot/p-net/package.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "p-net-rtt",
3+
"description": "P-Net stack for Profinet device implementation",
4+
"description_zh": "用于 Profinet 设备实现的 P-Net 开源协议栈",
5+
"enable": "PKG_USING_PNET",
6+
"keywords": [
7+
"p-net",
8+
"profinet"
9+
],
10+
"category": "iot",
11+
"author": {
12+
"name": "Wangyuqiang",
13+
"email": "[email protected]",
14+
"github": "p-net-rtt"
15+
},
16+
"license": "GPL-3.0",
17+
"repository": "https://github.com/kurisaW/p-net-rtt",
18+
"homepage": "https://github.com/kurisaW/p-net-rtt#readme",
19+
"doc": "http://www.rt-labs.com/",
20+
"readme": "P-Net stack for rt-thread",
21+
"site": [
22+
{
23+
"version": "v1.0.0",
24+
"URL": "https://github.com/kurisaW/p-net-rtt/archive/1.0.0.zip",
25+
"filename": "p-net-rtt-1.0.0.zip",
26+
"VER_SHA": "NULL"
27+
},
28+
{
29+
"version": "latest",
30+
"URL": "https://github.com/kurisaW/p-net-rtt.git",
31+
"filename": "p-net-rtt.zip",
32+
"VER_SHA": "rtt-adapt"
33+
}
34+
]
35+
}

0 commit comments

Comments
 (0)