diff --git a/device_hal/button_driver/CMakeLists.txt b/device_hal/button_driver/CMakeLists.txt index 1c0ce544f..d12d588ea 100644 --- a/device_hal/button_driver/CMakeLists.txt +++ b/device_hal/button_driver/CMakeLists.txt @@ -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}) diff --git a/device_hal/button_driver/hollow_button/button_driver.c b/device_hal/button_driver/hollow_button/button_driver.c new file mode 100644 index 000000000..dc99d059d --- /dev/null +++ b/device_hal/button_driver/hollow_button/button_driver.c @@ -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 +#include + +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; +} diff --git a/device_hal/device/esp32s2_devkit_c/esp_matter_device.cmake b/device_hal/device/esp32s2_devkit_c/esp_matter_device.cmake index 63ecd5692..3109d21af 100644 --- a/device_hal/device/esp32s2_devkit_c/esp_matter_device.cmake +++ b/device_hal/device/esp32s2_devkit_c/esp_matter_device.cmake @@ -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" diff --git a/device_hal/led_driver/hollow/led_driver.c b/device_hal/led_driver/hollow_led/led_driver.c similarity index 100% rename from device_hal/led_driver/hollow/led_driver.c rename to device_hal/led_driver/hollow_led/led_driver.c