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
26 changes: 26 additions & 0 deletions boards/ESP32/ESP32-C6/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
config CHIP_CHOICE
string
default "esp32c6"

config BOARD_CHOICE
string
default "ESP32-C6"

config BOARD_CONFIG
bool
default y
select PLATFORM_FLASHSIZE_16M

config UART_NUM0_TX_PIN
int "UART_NUM0_TX_PIN"
range 0 44
default 16
---help---
esp32-c6 default 16

config UART_NUM0_RX_PIN
int "UART_NUM0_RX_PIN"
range 0 44
default 17
---help---
esp32-c6 default 17
13 changes: 13 additions & 0 deletions boards/ESP32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ choice
rsource "./ESP32-C3/Kconfig"
endif

config BOARD_CHOICE_ESP32_C6
bool "ESP32-C6"
if (BOARD_CHOICE_ESP32_C6)
rsource "./ESP32-C6/Kconfig"
endif

config BOARD_CHOICE_ESP32_S3
bool "ESP32-S3"
if (BOARD_CHOICE_ESP32_S3)
Expand Down Expand Up @@ -96,6 +102,13 @@ choice
rsource "./DNESP32S3_BOX2_WIFI/Kconfig"
endif


config BOARD_CHOICE_WAVESHARE_ESP32C6_DEV_KIT_N16
bool "WAVESHARE_ESP32C6_DEV_KIT_N16"
if (BOARD_CHOICE_WAVESHARE_ESP32C6_DEV_KIT_N16)
rsource "./WAVESHARE_ESP32C6_DEV_KIT_N16/Kconfig"
endif

# <new-board-add: This line cannot be deleted or modified>

endchoice
44 changes: 44 additions & 0 deletions boards/ESP32/WAVESHARE_ESP32C6_DEV_KIT_N16/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
##
# @file CMakeLists.txt
# @brief
#/

# MODULE_PATH
set(MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})

# MODULE_NAME
get_filename_component(MODULE_NAME ${MODULE_PATH} NAME)

# LIB_SRCS
aux_source_directory(${MODULE_PATH} LIB_SRCS)

# LIB_PUBLIC_INC
set(LIB_PUBLIC_INC ${MODULE_PATH})


########################################
# Target Configure
########################################
add_library(${MODULE_NAME})

target_sources(${MODULE_NAME}
PRIVATE
${LIB_SRCS}
)

target_include_directories(${MODULE_NAME}
PRIVATE
${LIB_PRIVATE_INC}

PUBLIC
${LIB_PUBLIC_INC}
)


########################################
# Layer Configure
########################################
list(APPEND COMPONENT_LIBS ${MODULE_NAME})
set(COMPONENT_LIBS "${COMPONENT_LIBS}" PARENT_SCOPE)
list(APPEND COMPONENT_PUBINC ${LIB_PUBLIC_INC})
set(COMPONENT_PUBINC "${COMPONENT_PUBINC}" PARENT_SCOPE)
27 changes: 27 additions & 0 deletions boards/ESP32/WAVESHARE_ESP32C6_DEV_KIT_N16/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
config CHIP_CHOICE
string
default "esp32c6"

config BOARD_CHOICE
string
default "WAVESHARE_ESP32C6_DEV_KIT_N16"

config BOARD_CONFIG
bool
default y
select ENABLE_BUTTON
select PLATFORM_FLASHSIZE_16M

config UART_NUM0_TX_PIN
int "UART_NUM0_TX_PIN"
range 0 44
default 16
---help---
esp32-c6 default 16

config UART_NUM0_RX_PIN
int "UART_NUM0_RX_PIN"
range 0 44
default 17
---help---
esp32-c6 default 17
63 changes: 63 additions & 0 deletions boards/ESP32/WAVESHARE_ESP32C6_DEV_KIT_N16/board_com_api.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/**
* @file board_com_api.c
* @author Tuya Inc.
* @brief Implementation of common board-level hardware registration APIs for audio, button, and LED peripherals.
*
* @copyright Copyright (c) 2021-2025 Tuya Inc. All Rights Reserved.
*/

#include "tuya_cloud_types.h"
#include "tal_api.h"

#include "tdd_button_gpio.h"

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

/***********************************************************
***********************typedef define***********************
***********************************************************/

/***********************************************************
********************function declaration********************
***********************************************************/

/***********************************************************
***********************variable define**********************
***********************************************************/

/***********************************************************
***********************function define**********************
***********************************************************/

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

BUTTON_GPIO_CFG_T button_hw_cfg = {
.pin = BOARD_BUTTON_PIN,
.level = BOARD_BUTTON_ACTIVE_LV,
.mode = BUTTON_TIMER_SCAN_MODE,
.pin_type.gpio_pull = TUYA_GPIO_PULLUP,
};

TUYA_CALL_ERR_RETURN(tdd_gpio_button_register(BUTTON_NAME, &button_hw_cfg));
}

/**
* @brief Registers all the hardware peripherals (audio, button, LED) on the board.
*
* @return Returns OPERATE_RET_OK on success, or an appropriate error code on failure.
*/
OPERATE_RET board_register_hardware(void)
{
OPERATE_RET rt = OPRT_OK;

TUYA_CALL_ERR_LOG(__board_register_button());
TUYA_CALL_ERR_LOG(__board_register_led());

return rt;
}
41 changes: 41 additions & 0 deletions boards/ESP32/WAVESHARE_ESP32C6_DEV_KIT_N16/board_com_api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* @file board_com_api.h
* @author Tuya Inc.
* @brief Header file for common board-level hardware registration APIs.
*
* @copyright Copyright (c) 2021-2025 Tuya Inc. All Rights Reserved.
*/

#ifndef __BOARD_COM_API_H__
#define __BOARD_COM_API_H__

#include "tuya_cloud_types.h"

#ifdef __cplusplus
extern "C" {
#endif

/***********************************************************
************************macro define************************
***********************************************************/

/***********************************************************
***********************typedef define***********************
***********************************************************/

/***********************************************************
********************function declaration********************
***********************************************************/

/**
* @brief Registers all the hardware peripherals (audio, button, LED) on the board.
*
* @return Returns OPERATE_RET_OK on success, or an appropriate error code on failure.
*/
OPERATE_RET board_register_hardware(void);

#ifdef __cplusplus
}
#endif

#endif /* __BOARD_COM_API_H__ */
2 changes: 2 additions & 0 deletions boards/ESP32/config/ESP32-C6.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_BOARD_CHOICE_ESP32=y
CONFIG_BOARD_CHOICE_ESP32_C6=y
2 changes: 1 addition & 1 deletion platform/platform_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ platforms:
- name: ESP32
repo: https://github.com/tuya/TuyaOpen-esp32
branch: dev-esp32
commit: 5c3818c370f9653b90c71d7d1b82b7949d0d9066
commit: 35bb1fc21a63f7bb2a2ee3bba348099e191179d7

- name: LN882H
repo: https://github.com/tuya/TuyaOpen-ln882h
Expand Down
2 changes: 1 addition & 1 deletion src/tal_bluetooth/nimble/host/tuya_ble_mbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @{
*/

STAILQ_HEAD(, os_mbuf_pool) g_msys_pool_list =
static STAILQ_HEAD(, os_mbuf_pool) g_msys_pool_list =
STAILQ_HEAD_INITIALIZER(g_msys_pool_list);

struct os_mbuf *os_dyna_mbuf_get(struct os_mbuf_pool *omp, uint16_t leadingspace);
Expand Down
3 changes: 1 addition & 2 deletions src/tal_bluetooth/nimble/host/tuya_ble_mempool.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static void os_dyna_msys_init_once(struct os_mempool *mempool, struct os_mbuf_po
BLE_PANIC_ASSERT(rc == 0);
}

void os_msys_init(void)
void ty_os_msys_init(void)
{
os_msys_reset();

Expand All @@ -208,7 +208,6 @@ void os_msys_init(void)
#endif
}


static stats_error_t os_mempool_init_internal(struct os_mempool *mp, uint16_t blocks,
uint32_t block_size, void *membuf, char *name,
uint8_t flags)
Expand Down
4 changes: 2 additions & 2 deletions src/tal_bluetooth/nimble/host/tuya_hs_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void* host_main_thread_hdl = NULL;
static tuya_ble_eventq g_eventq_dflt;
static int pre_init_flag = 0;

extern void os_msys_init(void);
extern void ty_os_msys_init(void);
extern void os_mempool_module_init(void);
void tuya_ble_host_pre_init(void *param)
{
Expand All @@ -41,7 +41,7 @@ void tuya_ble_host_pre_init(void *param)

/* Initialize the global memory pool */
os_mempool_module_init();
os_msys_init();
ty_os_msys_init();
/* Initialize the host */
ble_hs_init();
}
Expand Down