diff --git a/iot/Kconfig b/iot/Kconfig index 7b6104ebed..c28d9a85f8 100644 --- a/iot/Kconfig +++ b/iot/Kconfig @@ -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 diff --git a/iot/p-net/Kconfig b/iot/p-net/Kconfig new file mode 100644 index 0000000000..ce3a707800 --- /dev/null +++ b/iot/p-net/Kconfig @@ -0,0 +1,89 @@ +menuconfig PKG_USING_PNET + bool "P-Net stack for Profinet device implementation" + select RT_USING_LWIP + select RT_LWIP_SNMP + select RT_LWIP_ENABLE_USER_HOOKS + 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 P-NET 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 + if PNET_USING_RAMFS + config PNET_RAMFS_SIZE + int "default memory size for ramfs" + default 8192 + endif + 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 diff --git a/iot/p-net/package.json b/iot/p-net/package.json new file mode 100644 index 0000000000..ca90a3f81c --- /dev/null +++ b/iot/p-net/package.json @@ -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": "2053731441@qq.com", + "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" + } + ] +}