Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/ESP32/WAVESHARE_ESP32C6_DEV_KIT_N16/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config BOARD_CONFIG
bool
default y
select ENABLE_BUTTON
select ENABLE_LED
select PLATFORM_FLASHSIZE_16M

config UART_NUM0_TX_PIN
Expand Down
19 changes: 19 additions & 0 deletions boards/ESP32/WAVESHARE_ESP32C6_DEV_KIT_N16/board_com_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
#include "tal_api.h"

#include "tdd_button_gpio.h"
#include "tdd_led_esp_ws1280.h"

/***********************************************************
************************macro define************************
***********************************************************/
#define BOARD_BUTTON_PIN TUYA_GPIO_NUM_9
#define BOARD_BUTTON_ACTIVE_LV TUYA_GPIO_LEVEL_LOW

#define BOARD_LED_PIN TUYA_GPIO_NUM_8
/***********************************************************
***********************typedef define***********************
***********************************************************/
Expand Down Expand Up @@ -45,8 +47,25 @@ static OPERATE_RET __board_register_button(void)
};

TUYA_CALL_ERR_RETURN(tdd_gpio_button_register(BUTTON_NAME, &button_hw_cfg));

return OPRT_OK;
}

static OPERATE_RET __board_register_led(void)
{
OPERATE_RET rt = OPRT_OK;

TDD_LED_WS1280_CFG_T led_hw_cfg = {
.gpio = BOARD_LED_PIN,
.led_count = 1,
.color = 0x00001F, // 0xRRGGBB format
};

TUYA_CALL_ERR_RETURN(tdd_led_esp_ws1280_register(LED_NAME, &led_hw_cfg));

return OPRT_OK;
}

/**
* @brief Registers all the hardware peripherals (audio, button, LED) on the board.
*
Expand Down
13 changes: 13 additions & 0 deletions boards/ESP32/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ file(GLOB_RECURSE DISPLAY_SRCS "${COMMON_PATH}/display/*.c")
# add lcd source files
file(GLOB_RECURSE LCD_SRCS "${COMMON_PATH}/lcd/*.c")

# add led source files
file(GLOB_RECURSE LED_SRCS "${COMMON_PATH}/led/*.c")

# add io_expander source files
file(GLOB_RECURSE IO_EXPANDER_SRCS "${COMMON_PATH}/io_expander/*.c")

Expand Down Expand Up @@ -47,3 +50,13 @@ if (CONFIG_ENABLE_AUDIO)
"${COMMON_PATH}/audio"
)
endif()

if (CONFIG_ENABLE_LED)
list(APPEND BOARD_SRC
"${LED_SRCS}"
)

list(APPEND BOARD_INC
"${COMMON_PATH}/led"
)
endif()
Loading