feat(usb_cdc): Add select functionality

This commit is contained in:
Guillaume Souchere
2025-09-25 09:42:52 +02:00
parent 0eb75533e0
commit 862ada0054
13 changed files with 365 additions and 11 deletions
@@ -0,0 +1,31 @@
/*
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "freertos/FreeRTOS.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
CDCACM_SELECT_READ_NOTIF,
CDCACM_SELECT_WRITE_NOTIF,
CDCACM_SELECT_ERROR_NOTIF,
} cdcacm_select_notif_t;
typedef void (*cdcacm_select_notif_callback_t)(cdcacm_select_notif_t cdcacm_select_notif, BaseType_t *task_woken);
/**
* @brief Set notification callback function for select() events
* @param cdcacm_select_notif_callback callback function
*/
void cdcacm_set_select_notif_callback(cdcacm_select_notif_callback_t cdcacm_select_notif_callback);
#ifdef __cplusplus
}
#endif
@@ -1,3 +1,4 @@
/*
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
*
@@ -99,6 +100,15 @@ esp_err_t esp_usb_console_set_cb(esp_usb_console_cb_t rx_cb, esp_usb_console_cb_
*/
void esp_usb_console_poll_interrupts(void); // [refactor-todo] Remove when implementing IDF-12175
/**
* @brief Checks whether the USB console is installed or not
*
* @return
* - true USB console is installed
* - false USB console is not installed
*/
bool esp_usb_console_is_installed(void);
#ifdef __cplusplus
}
#endif