mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
esp_matter: Adding data model APIs for endpoints, clusters, attributes and commands.
This is a middle layer between application and chip submodule. esp_matter_core: Data model APIs in the form of linked lists. It also has the APIs for initialisations for matter. esp_matter_endpoint: APIs for endpoint. This adds the mandatory clusters for the endpoint. esp_matter_cluster: APIs for cluster. This adds the mandatory attributes and commands for the cluster. esp_matter_attribute: APIs for attribute value. It also manages the attribute related matter callbacks. esp_matter_command: Callback APIs for commands. esp_matter_attribute: Giving 2 callbacks to the application, pre_attribute and post_attribute. app_main: Dynamically creating the data model using the top level APIs. app_matter: Moved to esp_matter_start() in esp_matter. Also moved the post_attribute_callback to esp_matter_attribute and moved the event_callback to app_main. app_driver: Moved with app_main. Using IDs instead of macros. app_driver: Changing the console usage from names to IDs. app_rainmaker: Dynamically creating the rainmaker data model from the matter data model. The endpoint_id, cluster_id, attribute_id need to be handled accordingly. cmake: Moved the chip submodule sources and includes from app_main to esp_matter. zap-generated: Using esp_matter_command instead of IMClusterCommandHandler. Dynamically creating the data model instead of using macros from endpoint_config. zap-generated: Regenerated using the zap tool with matter_root_node and matter_color_dimmable_light device types. Also enabled wifi and thread for network commissioning cluster. device_hal: Added support for esp32s2 with hollow drivers. zap_light: Adding another example which uses the zap-generated data model instead of the esp_matter data model. ci: Added zap_light example to ci.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake)
|
||||
idf_component_register(SRC_DIRS "${device_name}"
|
||||
INCLUDE_DIRS include
|
||||
PRIV_REQUIRES ${used_driver})
|
||||
REQUIRES ${used_driver})
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
// Copyright 2021 Espressif Systems (Shanghai) CO LTD
|
||||
//
|
||||
// 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
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
#include <button_driver.h>
|
||||
#include <light_driver.h>
|
||||
|
||||
static const char *TAG = "device";
|
||||
|
||||
static esp_err_t device_light_init()
|
||||
{
|
||||
light_driver_config_t config = {
|
||||
.gpio = -1,
|
||||
.channel = -1,
|
||||
};
|
||||
return light_driver_init(&config);
|
||||
}
|
||||
|
||||
static esp_err_t device_button_init()
|
||||
{
|
||||
return button_driver_init(NULL);
|
||||
}
|
||||
|
||||
esp_err_t device_init()
|
||||
{
|
||||
ESP_LOGI(TAG, "Initializing device");
|
||||
device_light_init();
|
||||
device_button_init();
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
if(NOT ("${IDF_TARGET}" STREQUAL "esp32s2" ))
|
||||
message(FATAL_ERROR "please set esp32s2 as the IDF_TARGET using 'idf.py set-target esp32s2'")
|
||||
endif()
|
||||
|
||||
SET(device_hal_path $ENV{ESP_MATTER_DEVICE_PATH}/../../)
|
||||
SET(device_name esp32s2_devkit_c)
|
||||
SET(light_type hollow)
|
||||
SET(button_type hollow)
|
||||
SET(used_driver light_driver button_driver)
|
||||
SET(extra_components_dirs_append "${device_hal_path}/light_driver"
|
||||
"${device_hal_path}/button_driver")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user