SRD Standelone programmation box: decoder7Seg.h File Reference

| SRD Standelone programmation box 2.0 (16/11/15 10:00:00) Documentation of the SRD standelone programmation box

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Enumerations Enumerator Macros Pages
Data Structures | Functions
decoder7Seg.h File Reference

Headerfile for 7 segment decoder driver. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | t7SegDisplay
| Structure used to control all segments in a 7 segments display. More...

## Macros

#define | DECODER7SEG_A_SHIFT (0)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_A_MASK (1<<DECODER7SEG_A_SHIFT)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_B_SHIFT (1)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_B_MASK (1<<DECODER7SEG_B_SHIFT)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_C_SHIFT (2)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_C_MASK (1<<DECODER7SEG_C_SHIFT)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_D_SHIFT (3)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_D_MASK (1<<DECODER7SEG_D_SHIFT)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_E_SHIFT (4)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_E_MASK (1<<DECODER7SEG_E_SHIFT)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_F_SHIFT (5)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_F_MASK (1<<DECODER7SEG_F_SHIFT)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_G_SHIFT (6)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_G_MASK (1<<DECODER7SEG_G_SHIFT)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_DOT_SHIFT (7)
| Define mask and shift of segments on the 7 segments display. More...
#define | DECODER7SEG_DOT_MASK (1<<DECODER7SEG_DOT_SHIFT)
| Define mask and shift of segments on the 7 segments display. More...

## Functions

t7SegDisplay | Decode7segDigitASCII (char digit)
| Function used to decode a char and display it on a 7 segments digit. More...
t7SegDisplay | Decode7segDigitASCIIDot (char digit, unsigned char dot)
| Function used to decode a char and display it on a 7 segments digit with a dot. More...

## Detailed Description

Headerfile for 7 segment decoder driver.

Author
  Thibaut LALUQUE 3D-Ouest

Date
  26/09/2014

Version
  1.0

All Right Reserved.

Definition in file decoder7Seg.h.

## Macro Definition Documentation

#define DECODER7SEG_A_MASK (1<<DECODER7SEG_A_SHIFT)

Define mask and shift of segments on the 7 segments display.

Definition at line 48 of file decoder7Seg.h.

#define DECODER7SEG_A_SHIFT (0)

Define mask and shift of segments on the 7 segments display.

Definition at line 47 of file decoder7Seg.h.

#define DECODER7SEG_B_MASK (1<<DECODER7SEG_B_SHIFT)

Define mask and shift of segments on the 7 segments display.

Definition at line 51 of file decoder7Seg.h.

#define DECODER7SEG_B_SHIFT (1)

Define mask and shift of segments on the 7 segments display.

Definition at line 50 of file decoder7Seg.h.

#define DECODER7SEG_C_MASK (1<<DECODER7SEG_C_SHIFT)

Define mask and shift of segments on the 7 segments display.

Definition at line 54 of file decoder7Seg.h.

#define DECODER7SEG_C_SHIFT (2)

Define mask and shift of segments on the 7 segments display.

Definition at line 53 of file decoder7Seg.h.

#define DECODER7SEG_D_MASK (1<<DECODER7SEG_D_SHIFT)

Define mask and shift of segments on the 7 segments display.

Definition at line 57 of file decoder7Seg.h.

#define DECODER7SEG_D_SHIFT (3)

Define mask and shift of segments on the 7 segments display.

Definition at line 56 of file decoder7Seg.h.

#define DECODER7SEG_DOT_MASK (1<<DECODER7SEG_DOT_SHIFT)

Define mask and shift of segments on the 7 segments display.

Definition at line 69 of file decoder7Seg.h.

#define DECODER7SEG_DOT_SHIFT (7)

Define mask and shift of segments on the 7 segments display.

Definition at line 68 of file decoder7Seg.h.

#define DECODER7SEG_E_MASK (1<<DECODER7SEG_E_SHIFT)

Define mask and shift of segments on the 7 segments display.

Definition at line 60 of file decoder7Seg.h.

#define DECODER7SEG_E_SHIFT (4)

Define mask and shift of segments on the 7 segments display.

Definition at line 59 of file decoder7Seg.h.

#define DECODER7SEG_F_MASK (1<<DECODER7SEG_F_SHIFT)

Define mask and shift of segments on the 7 segments display.

Definition at line 63 of file decoder7Seg.h.

#define DECODER7SEG_F_SHIFT (5)

Define mask and shift of segments on the 7 segments display.

Definition at line 62 of file decoder7Seg.h.

#define DECODER7SEG_G_MASK (1<<DECODER7SEG_G_SHIFT)

Define mask and shift of segments on the 7 segments display.

Definition at line 66 of file decoder7Seg.h.

#define DECODER7SEG_G_SHIFT (6)

Define mask and shift of segments on the 7 segments display.

Definition at line 65 of file decoder7Seg.h.

## Function Documentation

t7SegDisplay Decode7segDigitASCII | ( | char | digit | ) |

Function used to decode a char and display it on a 7 segments digit.

Parameters

  [in] | digit | (char) : char to display in ASCII.

Returns
  (t7SegDisplay) : return the control structure of a 7 segments digit.

Definition at line 78 of file decoder7Seg.c.

References t7SegDisplay::allSeg.

Referenced by Decode7segDigitASCIIDot(), and DisplaySetDataDisplayed().

78 {
79 t7SegDisplay result;
80
81 switch(digit) {
82
83 case 'O' :
84 case '0' :
85 result.allSeg = 0b00111111;
86 break;
87
88 case '1' :
89 result.allSeg = 0b00000110;
90 break;
91
92 case '2':
93 result.allSeg = 0b01011011;
94 break;
95
96 case '3':
97 result.allSeg = 0b01001111;
98 break;
99
100 case '4':
101 result.allSeg = 0b01100110;
102 break;
103
104 case 's' :
105 case 'S' :
106 case '5' :
107 result.allSeg = 0b01101101;
108 break;
109
110 case '6' :
111 result.allSeg = 0b01111101;
112 break;
113
114 case '7':
115 result.allSeg = 0b00000111;
116 break;
117
118 case '8' :
119 result.allSeg = 0b01111111;
120 break;
121
122 case '9' :
123 case 'g' :
124 case 'G' :
125 result.allSeg = 0b01101111;
126 break;
127
128 case 'o' :
129 result.allSeg = 0b01011100;
130 break;
131
132 case 'a' :
133 case 'A' :
134 result.allSeg = 0b01110111;
135 break;
136
137 case 'b':
138 case 'B':
139 result.allSeg = 0b01111100;
140 break;
141
142 case 'c':
143 result.allSeg = 0b01011000;
144 break;
145
146 case 'C':
147 result.allSeg = 0b00111001;
148 break;
149
150 case 'e':
151 case 'E':
152 result.allSeg = 0b01111001;
153 break;
154
155 case 'f':
156 case 'F':
157 result.allSeg = 0b01110001;
158 break;
159
160 case 'h':
161 case 'H':
162 result.allSeg = 0b01110110;
163 break;
164
165 case 'l':
166 case 'L':
167 result.allSeg = 0b00111000;
168 break;
169
170 case 'n':
171 case 'N':
172 result.allSeg = 0b01010100;
173 break;
174
175 case 'p':
176 case 'P':
177 result.allSeg = 0b01110011;
178 break;
179
180 case 'u':
181 case 'U':
182 result.allSeg = 0b00111110;
183 break;
184
185 case 'r':
186 case 'R':
187 result.allSeg = 0b01010000;
188 break;
189
190 case '.' :
191 result.allSeg = 0b10000000;
192 break;
193
194 default :
195 result.allSeg = 0x00;
196 break;
197 }
198
199 return result;
200 }
t7SegDisplay
Structure used to control all segments in a 7 segments display.
Definition: decoder7Seg.h:86
t7SegDisplay::allSeg
unsigned char allSeg
Definition: decoder7Seg.h:98

Here is the caller graph for this function:

t7SegDisplay Decode7segDigitASCIIDot | ( | char | digit,
|  | unsigned char | dot
| ) |  |

Function used to decode a char and display it on a 7 segments digit with a dot.

Parameters

  [in] | digit | (char) : char to display in ASCII.
  [in] | dot | (unsigned char) : dot to display in the 7 segments.

Returns
  (t7SegDisplay) : return the control structure of a 7 segments digit.

Definition at line 202 of file decoder7Seg.c.

References Decode7segDigitASCII(), and t7SegDisplay::seg.

202 {
203 t7SegDisplay decoded;
204
205 decoded = Decode7segDigitASCII(digit);
206
207 if(dot != 0) {
208 decoded.seg.dot = 1;
209 }
210
211 return decoded;
212 }
Decode7segDigitASCII
t7SegDisplay Decode7segDigitASCII(char digit)
Function used to decode a char and display it on a 7 segments digit.
Definition: decoder7Seg.c:78
t7SegDisplay::seg
struct t7SegDisplay::@25::@27 seg
t7SegDisplay
Structure used to control all segments in a 7 segments display.
Definition: decoder7Seg.h:86

Here is the call graph for this function: