USB communication class.
More...
#include <Usb.h>
List of all members.
Public Member Functions |
| Usb (void) |
| Constructor.
|
| ~Usb (void) |
| Destructor (shut down USB).
|
void | commHandler (void) |
| USB communication handler which must be invoked every 1msec while application is running.
|
bool | isConnected (void) const |
| Check connection status.
|
U32 | send (U8 *data, U32 offset, U32 length) |
| Send data to the host device.
|
U32 | receive (U8 *data, U32 offset, U32 length) const |
| Receive data from the host device.
|
bool | close (void) |
| Close the existing connection.
|
Static Public Attributes |
static const U32 | MAX_USB_DATA_LENGTH = 64 |
| Maximum length of data in byte for send/receive.
|
Detailed Description
Constructor & Destructor Documentation
Constructor.
Note:
This class must be constructed as a global object. Otherwise, a device assertion will be displayed
in the LCD when the object is constructed as a non global object. When the object is destructed while the system is shut down, USB is shut down automatically.
- Parameters:
-
- Returns:
- -
Destructor (shut down USB).
- Parameters:
-
- Returns:
- -
Member Function Documentation
Close the existing connection.
- Parameters:
-
- Returns:
- true:closed/false failed to close
USB communication handler which must be invoked every 1msec while application is running.
- Parameters:
-
- Returns:
- -
Check connection status.
- Parameters:
-
- Returns:
- true:connected/false:not connected
Receive data from the host device.
- Parameters:
-
data | Data to be received |
offset | Offset of data to be received |
length | Length of data to be received |
- Returns:
- Length of received data
Send data to the host device.
- Parameters:
-
data | Data to be sent |
offset | Offset of data to be sent |
length | Length of data to be sent |
- Returns:
- Length of sent data
The documentation for this class was generated from the following file: