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