Electronic Load 1.0 Programmable Constant Current Sink

screen.h
Go to the documentation of this file.
1
5 #ifndef SCREEN_H_
6 #define SCREEN_H_
7
8 #include "stdint.h"
9 #include "control.h"
10
11 typedef uint8_t screenTimeout_t;
12
18 typedef struct
19 {
20 control_t *control;
21 uint8_t retval;
22 } screenItem_t;
23
26 typedef struct
27 {
28 uint8_t numberOfItems;
29 screenTimeout_t timeout;
30 screenItem_t *item[];
31 } screen_t;
32
33 typedef enum {micro,milli,one,kilo,mega} prefixType;
41 typedef struct
42 {
43 uint8_t lastPrefix;
44 char value[6];
45 } prefixValue_t;
46 void formatPrefixValue(prefixValue_t *val,double newVal);
47
50 typedef struct
51 {
52 prefixValue_t u;
53 prefixValue_t i;
54 prefixValue_t r;
55 prefixValue_t p;
56 } sinkPrefixValues_t;
57
58 uint8_t doScreenManualTest(void);
59 uint8_t doScreenDischgTest(void);
60 void doScreenSystem(void);
61
62 uint8_t Screen(screen_t *screen);
63 screenItem_t inSink1_s;
64
65 extern screen_t screenVersion;
66 extern const char txtSetPoint_t[];
67
68 #endif /* SCREEN_H_ */
doScreenManualTest
uint8_t doScreenManualTest(void)
Definition: screen.c:216
prefixType
prefixType
Definition: screen.h:33
mega
Definition: screen.h:33
sinkPrefixValues_t::r
prefixValue_t r
Definition: screen.h:54
one
Definition: screen.h:33
screen_t::numberOfItems
uint8_t numberOfItems
Computed by initScreen()
Definition: screen.h:28
sinkPrefixValues_t
Contains the prefixValues for all sinks for display.
Definition: screen.h:50
screenTimeout_t
uint8_t screenTimeout_t
Use a suitable unsigned type to allow the longest timeout you would need.
Definition: screen.h:11
milli
Definition: screen.h:33
txtSetPoint_t
const char txtSetPoint_t[]
The Text for Set Point.
Definition: screen.c:200
sinkPrefixValues_t::i
prefixValue_t i
Definition: screen.h:53
prefixValue_t::lastPrefix
uint8_t lastPrefix
Prefix used at last update.
Definition: screen.h:43
screenVersion
screen_t screenVersion
The Version Screen.
Definition: screen.c:133
sinkPrefixValues_t::p
prefixValue_t p
Definition: screen.h:55
screen_t::timeout
screenTimeout_t timeout
If >0, the screen is terminated after <timeout> Seconds.
Definition: screen.h:29
control_t
The control_t is a union of all possible control types.
Definition: control.h:92
inSink1_s
screenItem_t inSink1_s
Definition: screen.h:63
screenItem_t
Holds the data for a screen item.
Definition: screen.h:18
Screen
uint8_t Screen(screen_t *screen)
Handles a screen.
Definition: screen.c:374
doScreenDischgTest
uint8_t doScreenDischgTest(void)
Definition: screen.c:262
control.h
screenItem_t::control
control_t * control
E.g. the text of a text field or the enterNumber_t of an input field.
Definition: screen.h:20
screenItem_t::retval
uint8_t retval
If retval !=0 the screen terminates if the user presses enter.
Definition: screen.h:21
screen_t
Holds the structure to build up a screen.
Definition: screen.h:26
doScreenSystem
void doScreenSystem(void)
sinkPrefixValues_t::u
prefixValue_t u
Definition: screen.h:52
kilo
Definition: screen.h:33
prefixValue_t
Holds the values for a prefix-value.
Definition: screen.h:41
micro
Definition: screen.h:33
formatPrefixValue
void formatPrefixValue(prefixValue_t *val, double newVal)
Formats a value using SI-Prefix Letters.
Definition: screen.c:522