annotate uart_addon.h @ 329:740438e21ea0

Fix bugs in server code (try actually running it)
author Matt Johnston <matt@ucc.asn.au>
date Mon, 04 Jun 2012 23:50:42 +0800
parents 7d409dded901
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
315
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
1 #ifndef UART_ADDON_H
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
2 #define UART_ADDON_H
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 /************************************************************************
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4 Title: UART addon-library
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5 Author: Martin Thomas <[email protected]>
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6 http://www.siwawi.arubi.uni-kl.de/avr_projects
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7 Software: AVR-GCC 3.3/3.4, Peter Fleury's UART-Library
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
8 ************************************************************************/
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
9
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10 #ifdef __cplusplus
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11 extern "C" {
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12 #endif
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 /**
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
15 * @defgroup UART library-addon
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
16 * @code #include <uart_addon.h> @endcode
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
17 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
18 * @brief Additional functions for send numbers as decimal and hex to UART
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
19 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
20 * @note needs Peter Fleury's UART-Library http://jump.to/fleury
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
21 * @author Martin Thomas [email protected]
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
22 */
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
23
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
24 /*@{*/
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
25
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
26 /**
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
27 * @brief Put long integer to ringbuffer for transmitting via UART.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
28 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
29 * The integer is converted to a string which is buffered by the uart
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
30 * library in a circular buffer and one character at a time is transmitted
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
31 * to the UART using interrupts.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
32 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
33 * @param value to transfer
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
34 * @return none
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
35 * @see uart_puts_p
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
36 */
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
37 extern void uart_put_longint( long int i );
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
38
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
39
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
40 /**
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
41 * @brief Put unsigned long integer to ringbuffer for transmitting via UART.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
42 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
43 * The integer is converted to a string which is buffered by the uart
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
44 * library in a circular buffer and one character at a time is transmitted
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
45 * to the UART using interrupts.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
46 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
47 * @param value to transfer
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
48 * @return none
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
49 * @see uart_puts_p
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
50 */
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
51 extern void uart_put_ulongint( unsigned long int i );
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
52
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
53
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
54 /**
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
55 * @brief Put integer to ringbuffer for transmitting via UART.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
56 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
57 * The integer is converted to a string which is buffered by the uart
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
58 * library in a circular buffer and one character at a time is transmitted
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
59 * to the UART using interrupts.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
60 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
61 * @param value to transfer
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
62 * @return none
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
63 * @see uart_puts_p
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
64 */
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
65 extern void uart_put_int( int i );
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
66
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
67
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
68 /**
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
69 * @brief Put nibble as hex to ringbuffer for transmit via UART.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
70 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
71 * The lower nibble of the parameter is convertet to correspondig
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
72 * hex-char and put in a circular buffer and one character at a time
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
73 * is transmitted to the UART using interrupts.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
74 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
75 * @param value to transfer (byte, only lower nibble converted)
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
76 * @return none
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
77 * @see uart_putc
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
78 */
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
79 extern void uart_puthex_nibble( const unsigned char b );
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
80
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
81 /**
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
82 * @brief Put byte as hex to ringbuffer for transmit via UART.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
83 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
84 * The upper and lower nibble of the parameter are convertet to
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
85 * correspondig hex-chars and put in a circular buffer and one
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
86 * character at a time is transmitted to the UART using interrupts.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
87 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
88 * @param value to transfer
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
89 * @return none
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
90 * @see uart_puthex_nibble
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
91 */
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
92 extern void uart_puthex_byte( const unsigned char b );
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
93
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
94 /**
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
95 * @brief Put unsigned long as ASCII to ringbuffer for transmit via UART.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
96 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
97 * @param value to transfer
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
98 * @return none
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
99 * @see none
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
100 */
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
101 extern void uart_puthex_long( unsigned long l );
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
102
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
103 /**
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
104 * @brief Put byte as bin to ringbuffer for transmit via UART.
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
105 *
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
106 * @param value to transfer
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
107 * @return none
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
108 * @see uart_putc
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
109 */
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
110 extern void uart_putbin_byte( const unsigned char b );
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
111
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
112
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
113 /*@}*/
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
114
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
115 #ifdef __cplusplus
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
116 }
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
117 #endif
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
118
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
119
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
120 #endif /* UART_ADDON_H */
7d409dded901 Import ds18x20 code
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
121