Skip to content

Commit 591c972

Browse files
ManarOuatoufyeaissa
authored andcommitted
[nxp noup][examples][zephyr] Enable NXP Matter Apps for Zephyr Ethernet
- All-clusters-app - Laudry washer - Thermostat Signed-off-by: Manar OUATOUF <manar.ouatouf@nxp.com>
1 parent 0b6b8f7 commit 591c972

File tree

13 files changed

+284
-1
lines changed

13 files changed

+284
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
CONFIG_SETTINGS_NVS_SECTOR_COUNT=16
18+
19+
# 0xA226
20+
CONFIG_CHIP_DEVICE_PRODUCT_ID=41510
21+
CONFIG_CHIP_DEVICE_PRODUCT_URL="https://www.nxp.com/products/wireless-connectivity/wi-fi-plus-bluetooth-plus-802-15-4/wireless-mcu-with-integrated-tri-radio-1x1-wi-fi-6-plus-bluetooth-low-energy-5-3-802-15-4:RW612"
22+
CONFIG_CHIP_DEVICE_PRODUCT_LABEL="RW612"
23+
CONFIG_CHIP_DEVICE_PART_NUMBER="RW612"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http: //www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/ {
19+
chosen {
20+
zephyr,console = &flexcomm0;
21+
zephyr,shell-uart = &flexcomm3;
22+
};
23+
};
24+
25+
&flexcomm0 {
26+
compatible = "nxp,lpc-usart";
27+
status = "okay";
28+
current-speed = <115200>;
29+
pinctrl-0 = <&pinmux_flexcomm0_usart>;
30+
pinctrl-names = "default";
31+
};
32+
33+
&flexcomm3 {
34+
compatible = "nxp,lpc-usart";
35+
status = "okay";
36+
current-speed = <115200>;
37+
pinctrl-0 = <&pinmux_flexcomm3_usart>;
38+
pinctrl-names = "default";
39+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# Options needed for Ethernet are located in this file
18+
19+
# ethernet discriminator
20+
CONFIG_CHIP_DEVICE_DISCRIMINATOR=0x700
21+
22+
CONFIG_CHIP_WIFI=n
23+
CONFIG_CHIP_ETHERNET=y
24+
25+
CONFIG_NET_DEFAULT_IF_WIFI=n
26+
CONFIG_BT=n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
CONFIG_SETTINGS_NVS_SECTOR_COUNT=16
18+
19+
# 0xA226
20+
CONFIG_CHIP_DEVICE_PRODUCT_ID=41510
21+
CONFIG_CHIP_DEVICE_PRODUCT_URL="https://www.nxp.com/products/wireless-connectivity/wi-fi-plus-bluetooth-plus-802-15-4/wireless-mcu-with-integrated-tri-radio-1x1-wi-fi-6-plus-bluetooth-low-energy-5-3-802-15-4:RW612"
22+
CONFIG_CHIP_DEVICE_PRODUCT_LABEL="RW612"
23+
CONFIG_CHIP_DEVICE_PART_NUMBER="RW612"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http: //www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/ {
19+
chosen {
20+
zephyr,console = &flexcomm0;
21+
zephyr,shell-uart = &flexcomm3;
22+
};
23+
};
24+
25+
&flexcomm0 {
26+
compatible = "nxp,lpc-usart";
27+
status = "okay";
28+
current-speed = <115200>;
29+
pinctrl-0 = <&pinmux_flexcomm0_usart>;
30+
pinctrl-names = "default";
31+
};
32+
33+
&flexcomm3 {
34+
compatible = "nxp,lpc-usart";
35+
status = "okay";
36+
current-speed = <115200>;
37+
pinctrl-0 = <&pinmux_flexcomm3_usart>;
38+
pinctrl-names = "default";
39+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# Options needed for Ethernet are located in this file
18+
19+
# ethernet discriminator
20+
CONFIG_CHIP_DEVICE_DISCRIMINATOR=0x700
21+
22+
CONFIG_CHIP_WIFI=n
23+
CONFIG_CHIP_ETHERNET=y
24+
25+
CONFIG_NET_DEFAULT_IF_WIFI=n
26+
CONFIG_BT=n

examples/platform/nxp/common/app_task/include/AppTaskBase.h

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ class AppTaskBase
112112
*/
113113
#if CONFIG_CHIP_WIFI || CHIP_DEVICE_CONFIG_ENABLE_WPA
114114
virtual chip::DeviceLayer::NetworkCommissioning::WiFiDriver * GetWifiDriverInstance(void) = 0;
115+
#elif CONFIG_CHIP_ETHERNET
116+
virtual chip::DeviceLayer::NetworkCommissioning::EthernetDriver * GetEthernetDriverInstance(void) = 0;
115117
#endif
116118

117119
/**

examples/platform/nxp/common/app_task/include/AppTaskZephyr.h

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ class AppTaskZephyr : public AppTaskBase
5252
*/
5353
#if defined(CONFIG_CHIP_WIFI)
5454
virtual chip::DeviceLayer::NetworkCommissioning::WiFiDriver * GetWifiDriverInstance(void) override;
55+
#elif defined(CONFIG_CHIP_ETHERNET)
56+
virtual chip::DeviceLayer::NetworkCommissioning::EthernetDriver * GetEthernetDriverInstance(void) override;
5557
#endif
5658

5759
/**

examples/platform/nxp/common/app_task/source/AppTaskBase.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
7979
#if CONFIG_CHIP_WIFI || CHIP_DEVICE_CONFIG_ENABLE_WPA
8080
app::Clusters::NetworkCommissioning::Instance sNetworkCommissioningInstance(0,
8181
chip::NXP::App::GetAppTask().GetWifiDriverInstance());
82+
#elif CONFIG_CHIP_ETHERNET
83+
app::Clusters::NetworkCommissioning::Instance
84+
sNetworkCommissioningInstance(0, chip::NXP::App::GetAppTask().GetEthernetDriverInstance());
8285
#endif
8386

8487
#if CONFIG_CHIP_TEST_EVENT && CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
@@ -221,6 +224,8 @@ CHIP_ERROR chip::NXP::App::AppTaskBase::Init()
221224
#ifdef ENABLE_CHIP_SHELL
222225
Shell::SetWiFiDriver(chip::NXP::App::GetAppTask().GetWifiDriverInstance());
223226
#endif
227+
#elif CONFIG_CHIP_ETHERNET
228+
sNetworkCommissioningInstance.Init();
224229
#endif
225230
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
226231
if (err == CHIP_NO_ERROR)

examples/platform/nxp/common/app_task/source/AppTaskZephyr.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
#include "AppCLIBase.h"
3737
#endif
3838

39+
#ifdef CONFIG_CHIP_ETHERNET
40+
#include <platform/nxp/zephyr/Ethernet/NxpEthDriver.h>
41+
#endif
42+
3943
#if CONFIG_CHIP_FACTORY_DATA
4044
#include <platform/nxp/common/factory_data/FactoryDataProvider.h>
4145
#else
@@ -69,7 +73,13 @@ chip::DeviceLayer::NetworkCommissioning::WiFiDriver * chip::NXP::App::AppTaskZep
6973
return static_cast<chip::DeviceLayer::NetworkCommissioning::WiFiDriver *>(
7074
&(NetworkCommissioning::ZephyrWifiDriver::Instance()));
7175
}
72-
#endif // CONFIG_CHIP_WIFI
76+
#elif defined(CONFIG_CHIP_ETHERNET)
77+
chip::DeviceLayer::NetworkCommissioning::EthernetDriver * chip::NXP::App::AppTaskZephyr::GetEthernetDriverInstance()
78+
{
79+
return static_cast<chip::DeviceLayer::NetworkCommissioning::EthernetDriver *>(
80+
&(NetworkCommissioning::NxpEthDriver::Instance()));
81+
}
82+
#endif
7383

7484
CHIP_ERROR chip::NXP::App::AppTaskZephyr::AppMatter_Register()
7585
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
CONFIG_SETTINGS_NVS_SECTOR_COUNT=16
18+
19+
# 0xA226
20+
CONFIG_CHIP_DEVICE_PRODUCT_ID=41510
21+
CONFIG_CHIP_DEVICE_PRODUCT_URL="https://www.nxp.com/products/wireless-connectivity/wi-fi-plus-bluetooth-plus-802-15-4/wireless-mcu-with-integrated-tri-radio-1x1-wi-fi-6-plus-bluetooth-low-energy-5-3-802-15-4:RW612"
22+
CONFIG_CHIP_DEVICE_PRODUCT_LABEL="RW612"
23+
CONFIG_CHIP_DEVICE_PART_NUMBER="RW612"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http: //www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/ {
19+
chosen {
20+
zephyr,console = &flexcomm0;
21+
zephyr,shell-uart = &flexcomm3;
22+
};
23+
};
24+
25+
&flexcomm0 {
26+
compatible = "nxp,lpc-usart";
27+
status = "okay";
28+
current-speed = <115200>;
29+
pinctrl-0 = <&pinmux_flexcomm0_usart>;
30+
pinctrl-names = "default";
31+
};
32+
33+
&flexcomm3 {
34+
compatible = "nxp,lpc-usart";
35+
status = "okay";
36+
current-speed = <115200>;
37+
pinctrl-0 = <&pinmux_flexcomm3_usart>;
38+
pinctrl-names = "default";
39+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Copyright (c) 2024 Project CHIP Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# Options needed for Ethernet are located in this file
18+
19+
# ethernet discriminator
20+
CONFIG_CHIP_DEVICE_DISCRIMINATOR=0x700
21+
22+
CONFIG_CHIP_WIFI=n
23+
CONFIG_CHIP_ETHERNET=y
24+
25+
CONFIG_NET_DEFAULT_IF_WIFI=n
26+
CONFIG_BT=n

0 commit comments

Comments
 (0)