25 #ifndef HAL_SERIAL_USB_H 26 #define HAL_SERIAL_USB_H 28 #if (HAL_USE_SERIAL_USB == TRUE) || defined(__DOXYGEN__) 51 #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) 52 #define SERIAL_USB_BUFFERS_SIZE 256 59 #if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) 60 #define SERIAL_USB_BUFFERS_NUMBER 2 68 #if HAL_USE_USB == FALSE 69 #error "Serial over USB Driver requires HAL_USE_USB" 119 #define _serial_usb_driver_data \ 120 _base_asynchronous_channel_data \ 124 input_buffers_queue_t ibqueue; \ 126 output_buffers_queue_t obqueue; \ 128 uint8_t ib[BQ_BUFFER_SIZE(SERIAL_USB_BUFFERS_NUMBER, \ 129 SERIAL_USB_BUFFERS_SIZE)]; \ 131 uint8_t ob[BQ_BUFFER_SIZE(SERIAL_USB_BUFFERS_NUMBER, \ 132 SERIAL_USB_BUFFERS_SIZE)]; \ 135 const SerialUSBConfig *config; 140 #define _serial_usb_driver_methods \ 141 _base_asynchronous_channel_methods #define _serial_usb_driver_data
SerialDriver specific data.
USBDriver * usbp
USB driver to use.
void sduWakeupHookI(SerialUSBDriver *sdup)
USB device wakeup handler.
void sduStop(SerialUSBDriver *sdup)
Stops the driver.
void sduConfigureHookI(SerialUSBDriver *sdup)
USB device configured handler.
void sduInterruptTransmitted(USBDriver *usbp, usbep_t ep)
Default data received callback.
void sduInit(void)
Serial Driver initialization.
bool sduRequestsHook(USBDriver *usbp)
Default requests hook.
void sduDataTransmitted(USBDriver *usbp, usbep_t ep)
Default data transmitted callback.
const struct SerialUSBDriverVMT * vmt
Virtual Methods Table.
Structure representing an USB driver.
usbep_t bulk_out
Bulk OUT endpoint used for incoming data transfer.
void sduStart(SerialUSBDriver *sdup, const SerialUSBConfig *config)
Configures and starts the driver.
int32_t msg_t
Type of a message.
sdustate_t
Driver state machine possible states.
void sduSOFHookI(SerialUSBDriver *sdup)
SOF handler.
void sduDataReceived(USBDriver *usbp, usbep_t ep)
Default data received callback.
void sduObjectInit(SerialUSBDriver *sdup)
Initializes a generic full duplex driver object.
usbep_t bulk_in
Bulk IN endpoint used for outgoing data transfer.
usbep_t int_in
Interrupt IN endpoint used for notifications.
#define _serial_usb_driver_methods
SerialUSBDriver specific methods.
void sduSuspendHookI(SerialUSBDriver *sdup)
USB device suspend handler.
Full duplex serial driver class.
SerialDriver virtual methods table.
uint8_t usbep_t
Type of an endpoint identifier.
msg_t sduControl(USBDriver *usbp, unsigned int operation, void *arg)
Control operation on a serial USB port.
USB CDC macros and structures.
Serial over USB Driver configuration structure.