Skip to content

Commit

Permalink
add p-net package for Profinet device implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
kurisaW committed Nov 7, 2024
1 parent 94f2bcf commit 28e4ad7
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
1 change: 1 addition & 0 deletions iot/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ source "$PKGS_DIR/packages/iot/zephyr_polling/Kconfig"
source "$PKGS_DIR/packages/iot/matter-adaptation-layer/Kconfig"
source "$PKGS_DIR/packages/iot/lhc_modbus/Kconfig"
source "$PKGS_DIR/packages/iot/qmodbus/Kconfig"
source "$PKGS_DIR/packages/iot/p-net/Kconfig"
endmenu
83 changes: 83 additions & 0 deletions iot/p-net/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
menuconfig PKG_USING_PNET
bool "P-Net stack for Profinet device implementation"
select BSP_USING_ETH
select RT_LWIP_SNMP
select PKG_PENT_NETIF_NAME
select PKG_PNET_BOARD_CONFIG
select PKG_PENT_FILESYSTEM_CONFIG
select PKG_PNET_NET_CONFIG
default n

if PKG_USING_PNET

config PKG_PNET_PATH
string
default "/packages/iot/p-net"

menuconfig PKG_PENT_NETIF_NAME
bool "default netif name for p-net"
default n
if PKG_PENT_NETIF_NAME
config APP_DEFAULT_ETHERNET_INTERFACE
string "default ethernet interface name for p-net app, default as 'e00'"
default "e00"
endif

menuconfig PKG_PNET_BOARD_CONFIG
bool "Enable pnet sample board config"
default n
if PKG_PNET_BOARD_CONFIG
config PNET_LED_PIN
string "p-ent user led pin"
default "PA9"
config PNET_USER_KEY
string "p-net user key pin"
default "PA10"
endif

menuconfig PKG_PENT_FILESYSTEM_CONFIG
bool "default root filesystem path for p-net"
default n
if PKG_PENT_FILESYSTEM_CONFIG
config PNET_USING_RAMFS
bool "p-net using ramfs filesystem by default, or you can turn this off and choose another way to enable the filesystem"
select RT_USING_DFS
select RT_USING_DFS_RAMFS
default n
endif

menuconfig PKG_PNET_NET_CONFIG
bool "p-net sample slave network ip config"
default n
if PKG_PNET_NET_CONFIG
config RT_LWIP_IPADDR
string "set static ip address for profinet slaver"
default "192.168.137.196"
config RT_LWIP_GWADDR
string "set static gateway address for profinet slaver"
default "192.168.137.1"
config RT_LWIP_MSKADDR
string "set static mask address for profinet slaver"
default "255.255.255.0"
endif

choice
prompt "version"
help
Select the PNET version

config PKG_USING_PNET_LATEST
bool "latest"
depends on RT_VER_NUM >= 0x50100

config PKG_USING_PNET_V100
bool "v1.0.0"
depends on RT_VER_NUM >= 0x50100
endchoice

config PKG_PNET_VER
string
default "v1.0.0" if PKG_USING_PNET_V100
default "latest" if PKG_USING_PNET_LATEST

endif
35 changes: 35 additions & 0 deletions iot/p-net/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "p-net-rtt",
"description": "P-Net stack for Profinet device implementation",
"description_zh": "用于 Profinet 设备实现的 P-Net 开源协议栈",
"enable": "PKG_USING_PNET",
"keywords": [
"p-net",
"profinet"
],
"category": "iot",
"author": {
"name": "Wangyuqiang",
"email": "[email protected]",
"github": "p-net-rtt"
},
"license": "GPL-3.0",
"repository": "https://github.com/kurisaW/p-net-rtt",
"homepage": "https://github.com/kurisaW/p-net-rtt#readme",
"doc": "http://www.rt-labs.com/",
"readme": "P-Net stack for rt-thread",
"site": [
{
"version": "v1.0.0",
"URL": "https://github.com/kurisaW/p-net-rtt/archive/1.0.0.zip",
"filename": "p-net-rtt-1.0.0.zip",
"VER_SHA": "NULL"
},
{
"version": "latest",
"URL": "https://github.com/kurisaW/p-net-rtt.git",
"filename": "p-net-rtt.zip",
"VER_SHA": "rtt-adapt"
}
]
}

0 comments on commit 28e4ad7

Please sign in to comment.