Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
Namespaces | Functions | Variables
usb_cdc.cpp File Reference
#include "usb_cdc.h"
#include "../hal/cpu.h"
#include "../hal/watchdog.h"
#include "debug.h"
#include "lufa_config.h"
#include "Descriptors.h"
#include "lufa/LUFA/Drivers/USB/USB.h"
Include dependency graph for usb_cdc.cpp:

Namespaces

 modules
 The modules namespace contains models of MMU's components.
 
 modules::usb
 The usb namespace provides all necessary facilities related to the USB interface.
 

Functions

void EVENT_USB_Device_Connect (void)
 
void EVENT_USB_Device_Disconnect (void)
 
void EVENT_USB_Device_ConfigurationChanged (void)
 
void EVENT_USB_Device_ControlRequest (void)
 
void EVENT_CDC_Device_ControLineStateChanged (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo)
 
void EVENT_CDC_Device_LineEncodingChanged (USB_ClassInfo_CDC_Device_t *const CDCInterfaceInfo)
 

Variables

static FILE USBSerialStream
 
USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface
 
CDC modules::usb::cdc
 The one and only instance of USB CDC in the FW.
 

Function Documentation

◆ EVENT_CDC_Device_ControLineStateChanged()

void EVENT_CDC_Device_ControLineStateChanged ( USB_ClassInfo_CDC_Device_t *const  CDCInterfaceInfo)

CDC class driver callback function the processing of changes to the virtual control lines sent from the host..

Parameters
[in]CDCInterfaceInfoPointer to the CDC class interface configuration structure being referenced

◆ EVENT_USB_Device_ConfigurationChanged()

void EVENT_USB_Device_ConfigurationChanged ( void  )

Event handler for the library USB Configuration Changed event.

◆ EVENT_USB_Device_Connect()

void EVENT_USB_Device_Connect ( void  )

Event handler for the library USB Connection event.

◆ EVENT_USB_Device_ControlRequest()

void EVENT_USB_Device_ControlRequest ( void  )

Event handler for the library USB Control Request reception event.

◆ EVENT_USB_Device_Disconnect()

void EVENT_USB_Device_Disconnect ( void  )

Event handler for the library USB Disconnection event.

Variable Documentation

◆ USBSerialStream

FILE USBSerialStream
static

Standard file stream for the CDC interface when set up, so that the virtual CDC COM port can be used like any regular character stream in the C APIs.

◆ VirtualSerial_CDC_Interface

USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface
Initial value:
= {
.Config = {
.ControlInterfaceNumber = INTERFACE_ID_CDC_CCI,
.DataINEndpoint = {
.Address = CDC_TX_EPADDR,
.Size = CDC_TXRX_EPSIZE,
.Type = EP_TYPE_BULK,
.Banks = 2,
},
.DataOUTEndpoint = {
.Address = CDC_RX_EPADDR,
.Size = CDC_TXRX_EPSIZE,
.Type = EP_TYPE_BULK,
.Banks = 2,
},
.NotificationEndpoint = {
.Address = CDC_NOTIFICATION_EPADDR,
.Size = CDC_NOTIFICATION_EPSIZE,
.Type = EP_TYPE_INTERRUPT,
.Banks = 1,
},
},
}

LUFA CDC Class driver interface configuration and state information. This structure is passed to all CDC Class driver functions, so that multiple instances of the same class within a device can be differentiated from one another.