finish usb uart lib

This commit is contained in:
2025-01-31 11:41:18 +01:00
parent 6f07f008c2
commit c3f374cdc7
4 changed files with 130 additions and 84 deletions

View File

@@ -23,20 +23,40 @@ public:
SerialUSBHost() = delete;
static void init(uint32_t baudrate, uint8_t stop_bits, uint8_t parity, uint8_t dataBits);
private:
/**
* @brief Device event callback
*
* Apart from handling device disconnection it doesn't do anything useful
*
* @param[in] event Device event type and data
* @param[in] user_ctx Argument we passed to the device open function
*/
static void handle_event(const cdc_acm_host_dev_event_data_t *event, void *user_ctx);
/**
* @brief Data received callback
*
* Just pass received data to stdout
*
* @param[in] data Pointer to received data
* @param[in] data_len Length of received data in bytes
* @param[in] arg Argument we passed to the device open function
* @return
* true: We have processed the received data
* false: We expect more data
*/
static bool handle_rx(const uint8_t *data, size_t data_len, void *arg);
static void takeSem();//XXX
static cdc_acm_host_device_config_t* getDevConfig();
static cdc_acm_line_coding_t* getLineCoding();
private:
/**
* @brief USB Host library handling task
*
* @param arg unused but required for task
*/
static void usb_lib_task(void* arg);
static void mainTask(void* arg);
};