00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __INCLUDE_LCDPROXIMA_H
00011 #define __INCLUDE_LCDPROXIMA_H
00012
00013 extern uint64_t latches;
00014
00015 #define LCDP_DDR (DDRD)
00016 #define LCDP_PORT (PORTD)
00017 #define LCDP_DATA (1 << PD2)
00018 #define LCDP_CLB (1 << PD3)
00019 #define LCDP_DLEN (1 << PD4)
00020
00021 #define LCDP_SELECT_LATCH_A (32ul)
00022 #define LCDP_SELECT_LATCH_B (0ul)
00023
00024
00025
00026 #define LCDP_SEGMENT_TSD ((uint64_t) 1 << (0 + LCDP_SELECT_LATCH_A)) ///< tsd=
00027 #define LCDP_SEGMENT_ISD ((uint64_t) 1 << (23 + LCDP_SELECT_LATCH_A)) ///< Isd=
00028 #define LCDP_SEGMENT_TR ((uint64_t) 1 << (24 + LCDP_SELECT_LATCH_A)) ///< Ir=
00029 #define LCDP_SEGMENT_IDELTAN ((uint64_t) 1 << (25 + LCDP_SELECT_LATCH_A)) ///< I/\n=
00030
00031 #define LCDP_SEGMENT_TG ((uint64_t) 1 << (0 + LCDP_SELECT_LATCH_B)) ///< tg=
00032 #define LCDP_SEGMENT_DELTAT ((uint64_t) 1 << (1 + LCDP_SELECT_LATCH_B)) ///< /\t=
00033 #define LCDP_SEGMENT_II ((uint64_t) 1 << (23 + LCDP_SELECT_LATCH_B)) ///< Ii=
00034 #define LCDP_SEGMENT_IR ((uint64_t) 1 << (24 + LCDP_SELECT_LATCH_B)) ///< Ir=
00035 #define LCDP_SEGMENT_IG ((uint64_t) 1 << (25 + LCDP_SELECT_LATCH_B)) ///< Ig=
00036
00037 #define LCDP_SEGMENT_ARROW0 ((uint64_t) 1 << (8 + LCDP_SELECT_LATCH_A))
00038 #define LCDP_SEGMENT_ARROW1 ((uint64_t) 1 << (8 + LCDP_SELECT_LATCH_B))
00039 #define LCDP_SEGMENT_ARROW2 ((uint64_t) 1 << (3 + LCDP_SELECT_LATCH_A))
00040 #define LCDP_SEGMENT_ARROW3 ((uint64_t) 1 << (3 + LCDP_SELECT_LATCH_B))
00041
00042 #define LCDP_SEGMENT_KILO ((uint64_t) 1 << (11 + LCDP_SELECT_LATCH_A)) ///< k
00043 #define LCDP_SEGMENT_AMPER ((uint64_t) 1 << (11 + LCDP_SELECT_LATCH_B)) ///< A
00044 #define LCDP_SEGMENT_SIEMENS ((uint64_t) 1 << (14 + LCDP_SELECT_LATCH_A)) ///< S
00045
00046 #define LCDP_SEGMENT_BATTERY ((uint64_t) 1 << (14 + LCDP_SELECT_LATCH_B))
00047 #define LCDP_SEGMENT_BATTERY_LOW ((uint64_t) 1 << (16 + LCDP_SELECT_LATCH_A))
00048 #define LCDP_SEGMENT_BATTERY_FULL ((uint64_t) 1 << (16 + LCDP_SELECT_LATCH_B))
00049
00050 #define LCDP_SEGMENT_MAX ((uint64_t) 1 << (19 + LCDP_SELECT_LATCH_A)) ///< Max
00051 #define LCDP_SEGMENT_GROUND ((uint64_t) 1 << (19 + LCDP_SELECT_LATCH_B))
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #define LCDP_SEGMENT_3A ((uint64_t) 1 << (22 + LCDP_SELECT_LATCH_A))
00063 #define LCDP_SEGMENT_3B ((uint64_t) 1 << (21 + LCDP_SELECT_LATCH_A))
00064 #define LCDP_SEGMENT_3C ((uint64_t) 1 << (2 + LCDP_SELECT_LATCH_A))
00065 #define LCDP_SEGMENT_3D ((uint64_t) 1 << (1 + LCDP_SELECT_LATCH_A))
00066 #define LCDP_SEGMENT_3E ((uint64_t) 1 << (2 + LCDP_SELECT_LATCH_B))
00067 #define LCDP_SEGMENT_3F ((uint64_t) 1 << (22 + LCDP_SELECT_LATCH_B))
00068 #define LCDP_SEGMENT_3G ((uint64_t) 1 << (21 + LCDP_SELECT_LATCH_B))
00069 #define LCDP_SEGMENT_3DP ((uint64_t) 1 << (4 + LCDP_SELECT_LATCH_B))
00070
00071 #define LCDP_SEGMENT_2A ((uint64_t) 1 << (20 + LCDP_SELECT_LATCH_A))
00072 #define LCDP_SEGMENT_2B ((uint64_t) 1 << (18 + LCDP_SELECT_LATCH_A))
00073 #define LCDP_SEGMENT_2C ((uint64_t) 1 << (5 + LCDP_SELECT_LATCH_A))
00074 #define LCDP_SEGMENT_2D ((uint64_t) 1 << (4 + LCDP_SELECT_LATCH_A))
00075 #define LCDP_SEGMENT_2E ((uint64_t) 1 << (5 + LCDP_SELECT_LATCH_B))
00076 #define LCDP_SEGMENT_2F ((uint64_t) 1 << (20 + LCDP_SELECT_LATCH_B))
00077 #define LCDP_SEGMENT_2G ((uint64_t) 1 << (18 + LCDP_SELECT_LATCH_B))
00078 #define LCDP_SEGMENT_2DP ((uint64_t) 1 << (6 + LCDP_SELECT_LATCH_B))
00079
00080 #define LCDP_SEGMENT_1A ((uint64_t) 1 << (17 + LCDP_SELECT_LATCH_A))
00081 #define LCDP_SEGMENT_1B ((uint64_t) 1 << (16 + LCDP_SELECT_LATCH_A))
00082 #define LCDP_SEGMENT_1C ((uint64_t) 1 << (7 + LCDP_SELECT_LATCH_A))
00083 #define LCDP_SEGMENT_1D ((uint64_t) 1 << (6 + LCDP_SELECT_LATCH_A))
00084 #define LCDP_SEGMENT_1E ((uint64_t) 1 << (7 + LCDP_SELECT_LATCH_B))
00085 #define LCDP_SEGMENT_1F ((uint64_t) 1 << (17 + LCDP_SELECT_LATCH_B))
00086 #define LCDP_SEGMENT_1G ((uint64_t) 1 << (16 + LCDP_SELECT_LATCH_B))
00087 #define LCDP_SEGMENT_1DP ((uint64_t) 1 << (9 + LCDP_SELECT_LATCH_B))
00088
00089 #define LCDP_SEGMENT_0A ((uint64_t) 1 << (13 + LCDP_SELECT_LATCH_A))
00090 #define LCDP_SEGMENT_0B ((uint64_t) 1 << (12 + LCDP_SELECT_LATCH_A))
00091 #define LCDP_SEGMENT_0C ((uint64_t) 1 << (10 + LCDP_SELECT_LATCH_A))
00092 #define LCDP_SEGMENT_0D ((uint64_t) 1 << (9 + LCDP_SELECT_LATCH_A))
00093 #define LCDP_SEGMENT_0E ((uint64_t) 1 << (10 + LCDP_SELECT_LATCH_B))
00094 #define LCDP_SEGMENT_0F ((uint64_t) 1 << (13 + LCDP_SELECT_LATCH_B))
00095 #define LCDP_SEGMENT_0G ((uint64_t) 1 << (12 + LCDP_SELECT_LATCH_B))
00096
00097
00098
00099 inline void LCDP_init (void);
00100 void LCDP_clear (void);
00101 void LCDP_all (void);
00102 void LCDP_writeLatch (uint32_t segments, bool_t latchA);
00103 void LCDP_writeLatches (void);
00104 void LCDP_printNumber (uint16_t number, bool_t leadingZeros);
00105 void LCDP_printNumberHex (uint16_t number);
00106 void LCDP_printNumberHexLZ (uint16_t number);
00107
00108 #endif // __INCLUDE_LCDP_H