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. |
Low level functions for USB input and output.
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.
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.
c | the received character. This will be set if a character has been received. |
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.
c | the character to send |
int usb_puti | ( | int | value | ) |
int usb_puts | ( | char * | s | ) |
Print a string to USB.
Sends a sequence of characters over USB.
s | the string to send |