unleashed-firmware/firmware/targets/f6/furi-hal/furi-hal-usb-cdc_i.h
Nikolay Minaylov efded63bcb
USB-UART: New GUI (#826)
* USB-UART: new gui
* Furi: use furi_console for logging instead of printf.
* CDC: calling open/close callbacks on interface change
* fix vcp_tx block on disconnect
* USB mode set by struct pointer
* FuriHal: proper event sequence on vcp reconnect
* disable debug prints
* HAL: add context to UART IRQ's
* Context usage in UART IRQ and CDC callbacks
* USB-UART: geting rid of baudrate limitations
* FuriHal: remove struct pollutant in usb api.

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
2021-11-21 18:17:43 +03:00

25 lines
767 B
C

#pragma once
#include <stdint.h>
#include "usb_cdc.h"
#define CDC_DATA_SZ 64
typedef struct {
void (*tx_ep_callback)(void* context);
void (*rx_ep_callback)(void* context);
void (*state_callback)(void* context, uint8_t state);
void (*ctrl_line_callback)(void* context, uint8_t state);
void (*config_callback)(void* context, struct usb_cdc_line_coding* config);
} CdcCallbacks;
void furi_hal_cdc_set_callbacks(uint8_t if_num, CdcCallbacks* cb, void* context);
struct usb_cdc_line_coding* furi_hal_cdc_get_port_settings(uint8_t if_num);
uint8_t furi_hal_cdc_get_ctrl_line_state(uint8_t if_num);
void furi_hal_cdc_send(uint8_t if_num, uint8_t* buf, uint16_t len);
int32_t furi_hal_cdc_receive(uint8_t if_num, uint8_t* buf, uint16_t max_len);