-
Notifications
You must be signed in to change notification settings - Fork 0
/
bar_config_example.h
116 lines (102 loc) · 3.1 KB
/
bar_config_example.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
/**
* ----------------------------------------------------------------------------
*
* "THE ANY BEVERAGE-WARE LICENSE" (Revision 42 - based on beer-ware license):
* <[email protected]> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a be(ve)er(age) in return. (I don't
* like beer much.)
*
* Matthias Kleemann
*
* ----------------------------------------------------------------------------
*
* \file bar_config_example.h
*
* \date Created: 04.02.2012 21:18:18
* \author Matthias Kleemann
*
**/
#ifndef BAR_CONFIG_H_
#define BAR_CONFIG_H_
/***************************************************************************/
/* GENERAL CONFIGURATION */
/***************************************************************************/
/**
* @brief maximum value which causes all bargraph pins to be high
*
* The algorithm used will result in the following match:
* 0..BAR_MAX_VALUE -> 0..P_BAR_RANGE-1
*/
#define BAR_MAX_VALUE 254
/**
* @brief reverse bargraph (MAX -> 0; 0 -> P_BAR_RANGE-1)
*
* Sometimes it is wanted to set all pins when the value is 0, but clear
* them when the value is near maximum. This is used e.g. in park distance
* control units to visualize the measured values as a warning to the user.
*
* Comment this defintion to avoid using this feature.
*/
#define BAR_REVERSE
/**
* @brief invert bits, e.g. to show value left
*
* This means, the bargraph reacts like normal, but the 1s and 0s are
* inverted.
*
* Comment this defintion to avoid using this feature.
*/
#ifdef __DOXYGEN__
#define BAR_INVERTED
#else
//#define BAR_INVERTED
#endif
/***************************************************************************/
/* PORT/PIN DEFINITIONS */
/***************************************************************************/
/**
* @brief define port to use for bargraph
*/
#define P_BAR C
/**
* @brief define range of port used for bargraph
*
* The bargraph uses the port pin range (pin 0..P_BAR_RANGE-1). Nothing else
* should be connected to it than the hardware to use, e.g. LEDs.
*/
#define P_BAR_RANGE 5
/**
* @brief adds an offset to the port pins used (not starting at pin0)
*
* Note: Adds to P_BAR_RANGE, so P_BAR_OFFSET + P_BAR_RANGE must not
* exceed port range. Set to 0, if unused.
*/
#define P_BAR_OFFSET 1
/**
* @brief definition of chip select
*
* If you need a chip select, define it here too. If the definition is not
* set here, the pin won't be used.
*
* Comment this defintion to avoid using this feature.
*/
#ifdef __DOXYGEN__
#define P_BAR_CS D,5
#else
//#define P_BAR_CS D,5
#endif
/**
* @brief define if chip select pin is inverted
*
* To comment this define use a HIGH level for a CS. Set this define and the
* /CS is set LOW active.
*
* Comment this defintion to avoid using this feature.
*/
#ifdef __DOXYGEN__
#define P_BAR_CS_INVERTED
#else
//#define P_BAR_CS_INVERTED
#endif
#endif