Project

General

Profile

Revision 891

Moved comments to headers. That was painful.

View differences:

serial.h
83 83
#define USB_BAUD 115200
84 84
#endif
85 85

  
86
/** @brief Initialize the USB **/
86
/**
87
 * @brief Initialize the USB
88
 *
89
 * Initializes communication over the USB serial port.
90
 * This must be called before any other usb function
91
 * may be used.
92
 **/
87 93
void usb_init(void);
88
/** @brief Print a character to USB **/
94
/**
95
 * @brief Print a character to USB
96
 *
97
 * Sends a character over USB.
98
 *
99
 * @param c the character to send
100
 * @return 0 for success, nonzero for failure
101
 **/
89 102
int usb_putc(char c);
90
/** @brief Read a character from USB **/
103
/**
104
 * @brief Read a character from USB
105
 *
106
 * Returns the first character in the buffer received from USB.
107
 * This function blocks execution until a character has been received.
108
 * usb_init must be called before this function may be used.
109
 * 
110
 * @return the first character in the usb buffer
111
 *
112
 * @see usb_init, usb_getc_nb
113
 **/
91 114
int usb_getc(void);
92
/** @brief Read a character from USB without blocking **/
115
/**
116
 * @brief Read a character from USB without blocking
117
 *
118
 * Non blocking version of usb_getc. If a character is present in the buffer,
119
 * it is returned, otherwise -1 is returned immediately. usb_init must be
120
 * called before this function can be used.
121
 *
122
 * @param c the received character. This will be set if a character has
123
 * been received.
124
 * 
125
 * @return -1 if no character is available, 0 otherwise
126
 * 
127
 * @see usb_init, usb_getc
128
 **/
93 129
int usb_getc_nb(char *c);
94
/** @brief Print a string to USB **/
130
/**
131
 * @brief Print a string to USB
132
 *
133
 * Sends a sequence of characters over USB.
134
 *
135
 * @param s the string to send
136
 * @return 0 for success, nonzero for failure
137
 **/
95 138
int usb_puts(char *s);
96
/** @brief Print an integer to USB **/
139
/**
140
 * @brief Print an integer to USB
141
 *
142
 * Prints an integer, converted to ASCII, to usb. usb_init must be called
143
 * before this function can be used.
144
 *
145
 * @param value the integer to print
146
 * 
147
 * @return 0 if successful, nonzero otherwise
148
 *
149
 * @see usb_init, usb_putc
150
 **/
97 151
int usb_puti(int value);
98 152

  
99 153
/** @} **/ //end addtogroup
......
115 169
#define XBEE_BAUD 9600
116 170
#endif
117 171

  
118
/** @brief Initialize the XBee **/
172
/**
173
 * @brief Initialize the XBee
174
 *
175
 * Initializes communication over the XBee.
176
 * This must be called before any other xbee function
177
 * may be used.
178
**/
119 179
void xbee_init(void);
120
/** @brief Print a character to the XBee **/
180
/**
181
 * @brief Print a character to the XBee
182
 *
183
 * Sends a character to the XBee.
184
 *
185
 * @param c the character to send
186
 * @return 0 for success, nonzero for failure
187
 **/
121 188
int xbee_putc(char c);
122
/** @brief Read a character from the XBee **/
189
/**
190
 * @brief Read a character from the XBee
191
 *
192
 * Returns the first character in the buffer received from USB.
193
 * This function blocks execution until a character has been
194
 * received. xbee_init must be called before this function
195
 * may be used.
196
 * 
197
 * @return the first character in the xbee buffer
198
 * 
199
 * @see xbee_init, xbee_getc_nb
200
 **/
123 201
int xbee_getc(void);
124
/** @brief Read a character from the XBee without blocking **/
202
/**
203
 * @brief Read a character from the XBee without blocking
204
 *
205
 * Non blocking version of xbee_getc. If a character is present in the buffer,
206
 * it is returned, otherwise -1 is returned immediately. xbee_init
207
 * must be called before this function can be used.
208
 *
209
 * @param c the received character. This will be set if a character has
210
 * been received.
211
 * 
212
 * @return -1 if no character is available, 0 otherwise
213
 *
214
 * @see xbee_init, xbee_getc
215
 **/
125 216
int xbee_getc_nb(char *c);
126 217

  
127 218
/** @} **/ //end addtogroup

Also available in: Unified diff