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