mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
hollow_button: Add support for hollow button driver
hollow_led: Minor renaming.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake)
|
||||
|
||||
set(requires driver)
|
||||
if ("${button_type}" STREQUAL "gpio")
|
||||
list(APPEND requires button)
|
||||
elseif ("${button_type}" STREQUAL "adc")
|
||||
list(APPEND requires button)
|
||||
set(src_dirs )
|
||||
set(requires driver button)
|
||||
|
||||
if ("${button_type}" STREQUAL "hollow_button")
|
||||
list(APPEND src_dirs hollow_button)
|
||||
endif()
|
||||
|
||||
idf_component_register(SRC_DIRS
|
||||
idf_component_register(SRC_DIRS ${src_dirs}
|
||||
INCLUDE_DIRS
|
||||
REQUIRES ${requires})
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
// 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 <iot_button.h>
|
||||
|
||||
static const char *TAG = "button_driver_hollow";
|
||||
|
||||
button_handle_t iot_button_create(const button_config_t *config)
|
||||
{
|
||||
ESP_LOGI(TAG, "Button create");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
esp_err_t iot_button_delete(button_handle_t btn_handle)
|
||||
{
|
||||
ESP_LOGI(TAG, "Button delete");
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t iot_button_register_cb(button_handle_t btn_handle, button_event_t event, button_cb_t cb)
|
||||
{
|
||||
ESP_LOGI(TAG, "Button register callback");
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t iot_button_unregister_cb(button_handle_t btn_handle, button_event_t event)
|
||||
{
|
||||
ESP_LOGI(TAG, "Button unregister callback");
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
button_event_t iot_button_get_event(button_handle_t btn_handle)
|
||||
{
|
||||
ESP_LOGI(TAG, "Button get event");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t iot_button_get_repeat(button_handle_t btn_handle)
|
||||
{
|
||||
ESP_LOGI(TAG, "Button get repeat");
|
||||
return 0;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ if (NOT ("${IDF_TARGET}" STREQUAL "esp32s2" ))
|
||||
endif()
|
||||
|
||||
SET(device_type esp32s2_devkit_c)
|
||||
SET(led_type hollow)
|
||||
SET(led_type hollow_led)
|
||||
SET(button_type gpio)
|
||||
|
||||
SET(extra_components_dirs_append "$ENV{ESP_MATTER_DEVICE_PATH}/../../led_driver"
|
||||
|
||||
Reference in New Issue
Block a user