42 lines
817 B
C++
42 lines
817 B
C++
#ifndef SERIAL_USB_HOST_H
|
|
#define SERIAL_USB_HOST_H
|
|
|
|
#include "esp_log.h"
|
|
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/semphr.h"
|
|
#include "freertos/task.h"
|
|
|
|
#include "usb/cdc_acm_host.h"
|
|
#include "usb/vcp_ch34x.hpp"
|
|
#include "usb/vcp_cp210x.hpp"
|
|
#include "usb/vcp_ftdi.hpp"
|
|
#include "usb/vcp.hpp"
|
|
#include "usb/usb_host.h"
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
class SerialUSBHost {
|
|
|
|
public:
|
|
SerialUSBHost() = delete;
|
|
static void init();
|
|
|
|
static void handle_event(const cdc_acm_host_dev_event_data_t *event, void *user_ctx);
|
|
static bool handle_rx(const uint8_t *data, size_t data_len, void *arg);
|
|
|
|
static void takeSem();//XXX
|
|
private:
|
|
/**
|
|
* @brief USB Host library handling task
|
|
*
|
|
* @param arg unused but required for task
|
|
*/
|
|
static void usb_lib_task(void* arg);
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif |