-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QPG] Adding thermostat and light-switch apps for QPG platform (#31366)
* [QPG] Added light-switch app to gn build * [QPG] Added thermostat app to gn build * [QPG] Added requirements needed * [QPG] Light-switch and thermostat added to build targets * [QPG] Bump qpg_sdk subrepo * Restyled by gn * Fixes * Fixed switch zap and matter files * Fix zap and matter for thermostat part 1 --------- Co-authored-by: Restyled.io <[email protected]>
- Loading branch information
Showing
49 changed files
with
19,168 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/build.gni") | ||
|
||
# The location of the build configuration file. | ||
buildconfig = "${build_root}/config/BUILDCONFIG.gn" | ||
|
||
# CHIP uses angle bracket includes. | ||
check_system_includes = true | ||
|
||
default_args = { | ||
target_cpu = "arm" | ||
target_os = "freertos" | ||
|
||
import("//args.gni") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Matter QPG6105 Light Switch Example Application | ||
|
||
## Light-switch-app | ||
|
||
A light switch example application showing the use of | ||
[Matter](https://github.com/project-chip/connectedhomeip) on the Qorvo QPG6105 | ||
can be found in this folder. | ||
|
||
## Qorvo SDK | ||
|
||
More detailed information on the Qorvo SDK can be found in the | ||
[Qorvo Matter SDK](https://github.com/Qorvo/QMatter). | ||
|
||
## More information | ||
|
||
For more information on our product line and support options, please visit | ||
[www.qorvo.com](https://www.qorvo.com) or contact us at <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
# Copyright(c) 2021 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/openthread.gni") | ||
import("//build_overrides/qpg_sdk.gni") | ||
|
||
import("${build_root}/config/defaults.gni") | ||
import("${chip_root}/src/platform/device.gni") | ||
import("${qpg_sdk_build_root}/qpg_executable.gni") | ||
import("${qpg_sdk_build_root}/qpg_sdk.gni") | ||
|
||
# declares chip_build_libshell = false | ||
import("${chip_root}/src/lib/lib.gni") | ||
|
||
# declares chip_enable_pw_rpc = false | ||
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") | ||
if (chip_enable_pw_rpc) { | ||
import("//build_overrides/pigweed.gni") | ||
import("$dir_pw_build/target_types.gni") | ||
} | ||
|
||
assert(current_os == "freertos") | ||
|
||
qpg_project_dir = "${chip_root}/examples/light-switch-app/qpg" | ||
examples_plat_dir = "${chip_root}/examples/platform/qpg" | ||
|
||
qpg_sdk("sdk") { | ||
include_dirs = [ | ||
"${chip_root}/src/platform/qpg", | ||
"${examples_plat_dir}", | ||
"${qpg_project_dir}/include", | ||
] | ||
|
||
defines = [ "PW_RPC_ENABLED=${chip_enable_pw_rpc}" ] | ||
} | ||
|
||
qpg_executable("light_switch_app") { | ||
output_name = "chip-${qpg_target_ic}-light-switch-example.out" | ||
|
||
sources = [ | ||
"${chip_root}/src/app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerDelegate.cpp", | ||
"${examples_plat_dir}/app/main.cpp", | ||
"${examples_plat_dir}/ota/ota.cpp", | ||
"src/AppTask.cpp", | ||
"src/SwitchManager.cpp", | ||
"src/ZclCallbacks.cpp", | ||
"src/binding-handler.cpp", | ||
] | ||
|
||
deps = [ | ||
":sdk", | ||
"${chip_root}/examples/light-switch-app/qpg/zap/", | ||
"${chip_root}/examples/providers:device_info_provider", | ||
"${chip_root}/src/lib", | ||
"${chip_root}/src/setup_payload", | ||
"${chip_root}/third_party/openthread/platforms:libopenthread-platform", | ||
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", | ||
"${chip_root}/third_party/qpg_sdk:qpg_switch_factorydata_lib", | ||
"${chip_root}/third_party/qpg_sdk:qpg_switch_firmwaredata_lib", | ||
] | ||
|
||
if (chip_openthread_ftd) { | ||
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-ftd" ] | ||
} else { | ||
deps += [ "${chip_root}/third_party/openthread/repo:libopenthread-mtd" ] | ||
} | ||
|
||
include_dirs = [ | ||
"include", | ||
"${examples_plat_dir}/ota", | ||
] | ||
|
||
defines = [] | ||
|
||
if (chip_enable_pw_rpc) { | ||
defines += [ | ||
"PW_RPC_ATTRIBUTE_SERVICE=1", | ||
"PW_RPC_BUTTON_SERVICE=1", | ||
"PW_RPC_DEVICE_SERVICE=1", | ||
"PW_RPC_LOCKING_SERVICE=1", | ||
] | ||
|
||
sources += [ | ||
"${chip_root}/examples/common/pigweed/RpcService.cpp", | ||
"${chip_root}/examples/common/pigweed/qpg/PigweedLoggerMutex.cpp", | ||
"${examples_plat_dir}/PigweedLogger.cpp", | ||
"${examples_plat_dir}/Rpc.cpp", | ||
"${examples_plat_dir}/uart.c", | ||
] | ||
|
||
deps += [ | ||
"$dir_pw_hdlc:rpc_channel_output", | ||
"$dir_pw_stream:sys_io_stream", | ||
"${chip_root}/config/qpg/lib/pw_rpc:pw_rpc", | ||
"${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", | ||
"${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", | ||
"${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", | ||
"${chip_root}/examples/common/pigweed:locking_service.nanopb_rpc", | ||
"${examples_plat_dir}/pw_sys_io:pw_sys_io_qpg", | ||
] | ||
|
||
deps += pw_build_LINK_DEPS | ||
|
||
include_dirs += [ | ||
"${chip_root}/examples/common", | ||
"${chip_root}/examples/common/pigweed/qpg", | ||
] | ||
} else { | ||
# The below gives compiler erros in pigweed, therefore it is only enabled | ||
# when rpc is not | ||
cflags = [ "-Wconversion" ] | ||
} | ||
|
||
if (chip_build_libshell) { | ||
deps += [ "${examples_plat_dir}:qpg-matter-shell" ] | ||
} else { | ||
if (chip_openthread_ftd) { | ||
deps += | ||
[ "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd" ] | ||
} else { | ||
deps += | ||
[ "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd" ] | ||
} | ||
} | ||
|
||
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld" | ||
|
||
inputs = [ ldscript ] | ||
|
||
ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] | ||
|
||
output_dir = root_out_dir | ||
} | ||
|
||
group("qpg") { | ||
deps = [ ":light_switch_app" ] | ||
} | ||
|
||
group("default") { | ||
deps = [ ":qpg" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
orphan: true | ||
--- | ||
|
||
# Matter QPG6105 SDK | ||
|
||
## Qorvo SDK | ||
|
||
More detailed information on the Qorvo SDK can be found in the | ||
[Qorvo Matter SDK](https://github.com/Qorvo/QMatter). | ||
|
||
## More information | ||
|
||
For more information on our product line and support options, please visit | ||
[www.qorvo.com](https://www.qorvo.com) or contact us at <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/pigweed.gni") | ||
import("${chip_root}/config/standalone/args.gni") | ||
import("${chip_root}/examples/platform/qpg/args.gni") | ||
|
||
qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain") | ||
|
||
chip_enable_ota_requestor = true | ||
chip_openthread_ftd = false | ||
enable_sleepy_device = true | ||
chip_enable_icd_server = true | ||
|
||
# Disable lock tracking, since our FreeRTOS configuration does not set | ||
# INCLUDE_xSemaphoreGetMutexHolder | ||
chip_stack_lock_tracking = "none" | ||
|
||
matter_device_vid = "0xFFF1" | ||
matter_device_pid = "0x8006" | ||
|
||
pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip" | ||
pw_assert_BACKEND = "$dir_pw_assert_log:check_backend" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../build_overrides |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef APP_CONFIG_H | ||
#define APP_CONFIG_H | ||
|
||
#define APP_TASK_NAME "APP" | ||
|
||
// Mapping of Functional buttons | ||
#define APP_FUNCTION1_BUTTON BTN_SW1 | ||
#define APP_FUNCTION2_SWITCH BTN_SW2 | ||
#define APP_FUNCTION3_BUTTON BTN_SW3 | ||
#define APP_FUNCTION4_BUTTON BTN_SW4 | ||
#define APP_FUNCTION5_BUTTON BTN_SW5 | ||
|
||
// Mapping of LEDs | ||
#define SYSTEM_STATE_LED LED_GREEN | ||
|
||
#endif // APP_CONFIG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef APP_EVENT_H | ||
#define APP_EVENT_H | ||
|
||
struct AppEvent; | ||
typedef void (*EventHandler)(AppEvent *); | ||
|
||
struct AppEvent | ||
{ | ||
enum AppEventTypes | ||
{ | ||
kEventType_Button = 0, | ||
kEventType_Timer, | ||
}; | ||
|
||
uint16_t Type; | ||
|
||
union | ||
{ | ||
struct | ||
{ | ||
uint8_t ButtonIdx; | ||
uint8_t Action; | ||
} ButtonEvent; | ||
struct | ||
{ | ||
void * Context; | ||
} TimerEvent; | ||
}; | ||
|
||
EventHandler Handler; | ||
}; | ||
|
||
#endif // APP_EVENT_H |
Oops, something went wrong.