Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
USB/CDC Standard I/O (stdio)

Standard I/O (stdio) management component that implements a stdio USB CDC interface on AVR devices.

Modules

 
 Quick Start Guide(s)
 In this section you can find a list of all Quick Start guides related to the USB/CDC Standard I/O (stdio).
 

Functions

int _read (int *f)
 
int _write (char c, int *f)
 
void stdio_usb_disable (void)
 Disables the stdio in USB Serial Mode. More...
 
bool stdio_usb_enable (void)
 Enables the stdio in USB Serial Mode. More...
 
void stdio_usb_getchar (void volatile *usart, char *data)
 Waits until a character is received, and returns it. More...
 
void stdio_usb_init (void)
 Initializes the stdio in USB Serial Mode. More...
 
int stdio_usb_putchar (volatile void *usart, char data)
 Sends a character with the USART. More...
 

Variables

void(* ptr_get )(void volatile *, char *)
 Pointer to the external low level read function. More...
 
int(* ptr_put )(void volatile *, char)
 Pointer to the external low level write function. More...
 
volatile void *volatile stdio_base
 Pointer to the base of the USART module instance to use for stdio. More...
 

int _read ( int *  f)

Referenced by stdio_usb_init().

int _write ( char  c,
int *  f 
)

Referenced by stdio_usb_init().

void stdio_usb_disable ( void  )

Disables the stdio in USB Serial Mode.

Returns
Nothing.

References stdio_usb_interface_enable.

bool stdio_usb_enable ( void  )

Enables the stdio in USB Serial Mode.

Returns
1 if function was successfully done, otherwise 0.

References stdio_usb_interface_enable.

void stdio_usb_getchar ( void volatile *  usart,
char *  data 
)

Waits until a character is received, and returns it.

Parameters
usartBase address of the USART instance.
dataData to read
Returns
Nothing.

References stdio_usb_interface_enable, and udi_cdc_getc().

Referenced by stdio_usb_init().

void stdio_usb_init ( void  )

Initializes the stdio in USB Serial Mode.

Returns
Nothing.

References _read(), _write(), NULL, ptr_get, ptr_put, stdio_base, stdio_usb_getchar(), stdio_usb_putchar(), and udc_start().

int stdio_usb_putchar ( volatile void *  usart,
char  data 
)

Sends a character with the USART.

Parameters
usartBase address of the USART instance.
dataCharacter to write.
Returns
Status.
Return values
0The character was written.
-1The function timed out before the transmitter became ready.

References stdio_usb_interface_enable, and udi_cdc_putc().

Referenced by stdio_usb_init().

void(* ptr_get)(void volatile *, char *)

Pointer to the external low level read function.

Referenced by _read(), and stdio_usb_init().

int(* ptr_put)(void volatile *, char)

Pointer to the external low level write function.

Referenced by _write(), and stdio_usb_init().

volatile void* volatile stdio_base

Pointer to the base of the USART module instance to use for stdio.

Referenced by _read(), _write(), and stdio_usb_init().