hollow_button: Add support for hollow button driver

hollow_led: Minor renaming.
This commit is contained in:
Chirag Atal
2022-05-05 10:13:38 +05:30
parent bd951b8499
commit 6eb458371e
4 changed files with 60 additions and 7 deletions
+6 -6
View File
@@ -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"