USB Input / Output

Functions for USB input / output. More...

Defines

#define USB_BAUD   115200
 the USB baud rate

Functions

void usb_init (void)
 Initialize the USB.
int usb_putc (char c)
 Print a character to USB.
int usb_getc (void)
 Read a character from USB.
int usb_getc_nb (char *c)
 Read a character from USB without blocking.
int usb_puts (char *s)
 Print a string to USB.
int usb_puti (int value)
 Print an integer to USB.

Detailed Description

Functions for USB input / output.

Low level functions for USB input and output.


Function Documentation

int usb_getc ( void   ) 

Read a character from USB.

Returns the first character in the buffer received from USB. This function blocks execution until a character has been received. xbee_init must be called before this function may be used.

Returns:
the first character in the usb buffer
See also:
usb_init, usb_getc_nb

int usb_getc_nb ( char *  c  ) 

Read a character from USB without blocking.

Non blocking version of usb_getc. If a character is present in the buffer, it is returned, otherwise -1 is returned immediately. usb_init must be called before this function can be used.

Parameters:
c the received character. This will be set if a character has been received.
Returns:
-1 if no character is available, 0 otherwise
See also:
usb_init, usb_getc

void usb_init ( void   ) 

Initialize the USB.

Initializes communication over the USB serial port. This must be called before any other usb function may be used.

int usb_putc ( char  c  ) 

Print a character to USB.

Sends a character over USB.

Parameters:
c the character to send
Returns:
0 for success, nonzero for failure

int usb_puti ( int  value  ) 

Print an integer to USB.

Prints an integer, converted to ASCII, to usb. usb_init must be called before this function can be used.

Parameters:
value the integer to print
Returns:
0 if successful, nonzero otherwise
See also:
usb_init, usb_putc

int usb_puts ( char *  s  ) 

Print a string to USB.

Sends a sequence of characters over USB.

Parameters:
s the string to send
Returns:
0 for success, nonzero for failure


Generated on Wed Feb 6 20:27:39 2008 for libdragonfly by  doxygen 1.5.3