Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIO2HOST - USB

This module performs serial input/output functionalities via USB.

Functions

void dtr_cb (bool)
 This function is callled with the value set as true whenever a device is connected to the terminal. More...
 
uint8_t sio2host_getchar (void)
 This function performs a blocking character receive functionality. More...
 
int sio2host_getchar_nowait (void)
 This function performs a non-blocking character receive functionality. More...
 
void sio2host_init (void)
 Initializes the Serial IO Module of the Host Device. More...
 
void sio2host_putchar (uint8_t)
 
uint8_t sio2host_rx (uint8_t *data, uint8_t max_length)
 Receives data from USB. More...
 
uint8_t sio2host_tx (uint8_t *data, uint8_t length)
 Transmits data via USB. More...
 
void usb_rx_notify (void)
 This function is called by the USB data receive Interrupt The Receive buffer is filled in this function. More...
 

void dtr_cb ( bool  )

This function is callled with the value set as true whenever a device is connected to the terminal.

References stdio_usb_disable(), and stdio_usb_enable().

uint8_t sio2host_getchar ( void  )

This function performs a blocking character receive functionality.

Returns
returns the data which is received
int sio2host_getchar_nowait ( void  )

This function performs a non-blocking character receive functionality.

Returns
'-1' if no data is recieved or returns the data if a character is received
void sio2host_init ( void  )

Initializes the Serial IO Module of the Host Device.

Returns
STATUS_OK for successful initialization and FAILURE incase the IO is not initialized
void sio2host_putchar ( uint8_t  )
uint8_t sio2host_rx ( uint8_t *  data,
uint8_t  max_length 
)

Receives data from USB.

Parameters
datapointer to the buffer where the received data is to be stored
max_lengthmaximum length of data to be received
Returns
actual number of bytes received
uint8_t sio2host_tx ( uint8_t *  data,
uint8_t  length 
)

Transmits data via USB.

Parameters
dataPointer to the buffer where the data to be transmitted is present
lengthNumber of bytes to be transmitted
Returns
Number of bytes actually transmitted
void usb_rx_notify ( void  )

This function is called by the USB data receive Interrupt The Receive buffer is filled in this function.

References cpu_irq_disable, cpu_irq_enable, main_b_cdc_enable, serial_rx_buf, serial_rx_buf_tail, serial_rx_count, temp, udi_cdc_getc(), and udi_cdc_is_rx_ready().