Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
UHI for Communication Device Class

Common APIs used by high level application to use this USB host class.

These routines are used by memory to transfer its data to/from USB CDC endpoint.

See Quick start guide for USB host Communication Device Class module (UHI CDC).

Modules

 
 Quick Start Guide(s)
 In this section you can find a list of all Quick Start guides related to the UHI for Communication Device Class.
 
 Implementation of UHI Communication Device Class
 Class internal implementation.
 
 Interface with USB Host Core (UHC)
 Define and functions required by UHC.
 

Functions

void uhi_cdc_close (uint8_t port)
 Close a port. More...
 
iram_size_t uhi_cdc_get_nb_received (uint8_t port)
 This function returns the number of character available on the CDC line. More...
 
int uhi_cdc_getc (uint8_t port)
 Waits and gets a value on CDC line. More...
 
bool uhi_cdc_is_rx_ready (uint8_t port)
 This function checks if a character has been received on the CDC line. More...
 
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. More...
 
bool uhi_cdc_open (uint8_t port, usb_cdc_line_coding_t *configuration)
 Open a port of UHI CDC interface. More...
 
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. More...
 
iram_size_t uhi_cdc_read_buf (uint8_t port, void *buf, iram_size_t size)
 Reads a RAM buffer on CDC line. More...
 
iram_size_t uhi_cdc_write_buf (uint8_t port, const void *buf, iram_size_t size)
 Writes a RAM buffer on CDC line. More...
 

void uhi_cdc_close ( uint8_t  port)

Close a port.

Parameters
portCommunication port number
iram_size_t uhi_cdc_get_nb_received ( uint8_t  port)

This function returns the number of character available on the CDC line.

Parameters
portCommunication port number
Returns
the number of data received
int uhi_cdc_getc ( uint8_t  port)

Waits and gets a value on CDC line.

Parameters
portCommunication port number
Returns
value read on CDC line
bool uhi_cdc_is_rx_ready ( uint8_t  port)

This function checks if a character has been received on the CDC line.

Parameters
portCommunication 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
portCommunication port number
Returns
true if a new character can be sent
bool uhi_cdc_open ( uint8_t  port,
usb_cdc_line_coding_t configuration 
)

Open a port of UHI CDC interface.

Parameters
portCommunication port number
configurationPointer 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
portCommunication port number
valueValue 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
portCommunication port number
bufValues read
sizeNumber of value read
Returns
the number of data remaining
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
portCommunication port number
bufValues to write
sizeNumber of value to write
Returns
the number of data remaining