Hanna
Sourcecode Batteriemanagementsystem
Doku Start
Informationen
Auflistung der Dateien
Datenstrukturen
Batman
Hanna
Documents
Eclipse
ws-bms
bms_main
SD-Card
macros.h
gehe zur Dokumentation dieser Datei
1
14
#ifndef MACROS_H
15
#define MACROS_H
16
17
#define false 0
18
#define true 1
19
20
21
//#################################### Macros
22
#define uniq(LOW,HEIGHT) (HEIGHT << 8)|LOW // 2x 8Bit --> 16Bit
23
#define LOW_BYTE(x) (x & 0xff) // 16Bit --> 8Bit
24
#define HIGH_BYTE(x) (x >> 8) & 0xff // 16Bit --> 8Bit
25
26
27
#define sbi(ADDRESS,BIT) ADDRESS |= (1<<BIT) // set Bit
28
#define cbi(ADDRESS,BIT) ADDRESS &= ~(1<<BIT) // clear Bit
29
#define toggle(ADDRESS,BIT) ADDRESS ^= (1<<BIT) // Bit umschalten
30
31
#define bis(ADDRESS,BIT) ADDRESS & (1<<BIT) // bit is set?
32
#define bic(ADDRESS,BIT) !(ADDRESS & (1<<BIT)) // bit is clear?
33
34
35
//####################################
36
#endif