USB Host Interface (UHI) for Communication Class Device (CDC) provides an interface for the configuration and management of USB CDC serial host.
The outline of this documentation is as follows:
For more details for Atmel® Software Framework (ASF) USB Host Stack, refer to following application note:
API Overview
|
Definition and functions required by UHC.
|
#define | UHI_CDC |
| Global definition which contains standard UHI API for UHC. More...
|
|
Value:{ \
}
uhc_enum_status_t uhi_cdc_install(uhc_device_t *dev)
Install interface.
void uhi_cdc_enable(uhc_device_t *dev)
Enable the interface.
void uhi_cdc_uninstall(uhc_device_t *dev)
Uninstall the interface (if installed).
void uhi_cdc_sof(bool b_micro)
Signal that a SOF has occurred.
Global definition which contains standard UHI API for UHC.
It must be added in USB_HOST_UHI define from conf_usb_host.h file.
void uhi_cdc_close |
( |
uint8_t |
port | ) |
|
Close a port.
- Parameters
-
[in] | port | Communication port number |
Enable the interface.
Enable a USB interface corresponding to UHI.
- Parameters
-
iram_size_t uhi_cdc_get_nb_received |
( |
uint8_t |
port | ) |
|
This function returns the number of character available on the CDC line.
- Parameters
-
[in] | port | Communication port number |
- Returns
- The number of data received.
int uhi_cdc_getc |
( |
uint8_t |
port | ) |
|
Waits and gets a value on CDC line.
- Parameters
-
[in] | port | Communication port number |
- Returns
- Value read on CDC line.
Install interface.
Allocate interface endpoints if supported.
- Parameters
-
- Returns
- Status of the install.
bool uhi_cdc_is_rx_ready |
( |
uint8_t |
port | ) |
|
This function checks if a character has been received on the CDC line.
- Parameters
-
[in] | port | Communication port number |
- Returns
true
if a byte is ready to be read.
bool uhi_cdc_is_tx_ready |
( |
uint8_t |
port | ) |
|
This function checks if a new character sent is possible.
The type int is used to support scanf redirection from compiler LIB.
- Parameters
-
[in] | port | Communication port number |
- Returns
true
if a new character can be sent.
Open a port of UHI CDC interface.
- Parameters
-
[in] | port | Communication port number |
[in] | configuration | Pointer on port configuration |
- Returns
true
if the port is available.
int uhi_cdc_putc |
( |
uint8_t |
port, |
|
|
int |
value |
|
) |
| |
Puts a byte on CDC line.
The type int is used to support printf redirection from compiler LIB.
- Parameters
-
[in] | port | Communication port number |
[in] | value | Value to put |
- Returns
true
if function was successfully done, otherwise false
.
iram_size_t uhi_cdc_read_buf |
( |
uint8_t |
port, |
|
|
void * |
buf, |
|
|
iram_size_t |
size |
|
) |
| |
Reads a RAM buffer on CDC line.
- Parameters
-
[in] | port | Communication port number |
[out] | buf | Values read |
[in] | size | Number of value read |
- Returns
- The number of data remaining.
void uhi_cdc_sof |
( |
bool |
b_micro | ) |
|
Signal that a SOF has occurred.
Uninstall the interface (if installed).
- Parameters
-
iram_size_t uhi_cdc_write_buf |
( |
uint8_t |
port, |
|
|
const void * |
buf, |
|
|
iram_size_t |
size |
|
) |
| |
Writes a RAM buffer on CDC line.
- Parameters
-
[in] | port | Communication port number |
[in] | buf | Values to write |
[in] | size | Number of value to write |
- Returns
- The number of data remaining.