3.6.2.2.3 USB

The entire application related to the USB is implemented in the usbApp.c file.

In CDC mode:

  • Copies data from the pcCOMM layer to the USB peripheral and performs the following steps:
    • Checking for new data to be transmitted
    • If new data is available in pcCOMM, that data is sent to PC
  • Copies data from the USB peripheral to the pcCOMM buffer and performs the following steps:
    • Checking for new data from PC
    • If new data are received from PC, that data is copied to the pcCOMM buffer

In CAPBridge mode:

  • USB interacts directly with the I2C drivers to read/write data to the CAP devices. The address and read/write instructions from the CAP GUI are directly routed to the I2C drivers. The capBridge.c files handle this part.

Other than the data transaction, the handling of USB connect/disconnect, COMPORT open/close, etc., are also handled in this layer.