Friedrich-Alexander-Universität Erlangen-Nürnberg  /   Technische Fakultät  /   Department Informatik

SPiCboard library (libspicboard, revision 14673M) API documentation

Found a bug or something ambiguous? Mail us to get it fixed!

7seg.h
Go to the documentation of this file.
1 #ifndef _7SEG_H
2 #define _7SEG_H
3 
4 #include <stdint.h>
5 
6 
7 /**
8  *
9  * \addtogroup 7seg 7SEG (Seven Segment Display)
10  *
11  * \brief Controls the two 7-segment displays on the board.
12  *
13  * The two 7-segment displays of the SPiCboard share one common
14  * port of the MCU. The two displays can be connected and
15  * disconnected from the port using two transistors. By quickly
16  * and periodically connecting and disconnecting the displays
17  * an observer will not be able to notice when a display is
18  * disabled and both displays can be used apparently simultaneously.
19  * \note As the timer-library is used, interrupts must be enabled for the
20  * display to work
21  * \sa timer.h
22  * @{
23  * \file 7seg.h
24  * \version \$Rev: 9414 $
25  */
26 
27 /**
28  * \brief prints a number in the range [-9; 99] on the 7-segment display
29  *
30  *
31  * \param nmbr the number to print
32  * \retval 0 success
33  * \retval -1 nmbr is smaller than -9
34  * \retval -2 nmbr is greater than 99
35  */
36 int8_t sb_7seg_showNumber(int8_t nmbr);
37 
38 /**
39  * \brief prints the hexadecimal representation of an 8-bit unsigned integer on the 7-segment display
40  *
41  * \param nmbr the number to print
42  * \retval 0 on success
43  * \retval !0 on error
44  */
45 int8_t sb_7seg_showHexNumber(uint8_t nmbr);
46 
47 /**
48  * \brief prints a 2 character string on the 7-segment display
49  *
50  * Supported characters are in the group [-_ 0-9A-Za-z] (contains space).
51  * Read <a href="http://en.wikipedia.org/wiki/Seven-segment_display_character_representations">this</a>
52  * article for possible representations of these characters. Two
53  * characters of the set should never have the same representation.
54  * No differentiation is made between upper- and lowercase characters.
55  *
56  * \param str the 0-terminated string
57  *
58  * \retval 0 success
59  * \retval -1 character at position 0 not printable
60  * \retval -2 character at position 1 not printable
61  * \retval -3 both characters not printable
62  * \retval -4 str is an empty string
63  *
64  */
65 int8_t sb_7seg_showStr(const char *str);
66 
67 /**
68  * \brief disables the 7-segment displays
69  *
70  * Any running alarms are unregistered.
71  */
72 void sb_7seg_disable(void);
73 
74 /** @}*/
75 
76 #endif
77 
int8_t sb_7seg_showNumber(int8_t nmbr)
prints a number in the range [-9; 99] on the 7-segment display
void sb_7seg_disable(void)
disables the 7-segment displays
int8_t sb_7seg_showHexNumber(uint8_t nmbr)
prints the hexadecimal representation of an 8-bit unsigned integer on the 7-segment display ...
int8_t sb_7seg_showStr(const char *str)
prints a 2 character string on the 7-segment display