50 lines
891 B
C++
50 lines
891 B
C++
/*
|
|
* Config.h
|
|
*
|
|
* Created on: 04.03.2014
|
|
* Author: wn
|
|
*/
|
|
|
|
#ifndef CONFIG_H_
|
|
#define CONFIG_H_
|
|
|
|
|
|
|
|
typedef union {
|
|
float f;
|
|
uint8_t e[sizeof(float)];
|
|
} u_float;
|
|
|
|
typedef union {
|
|
unsigned int i;
|
|
uint8_t e[sizeof(unsigned int)];
|
|
} u_uint;
|
|
|
|
typedef union {
|
|
unsigned long l;
|
|
uint8_t e[sizeof(unsigned long)];
|
|
} u_ulong;
|
|
|
|
|
|
namespace Config {
|
|
const unsigned int MAGIC_TOKEN = 0xDEADBEEF;
|
|
|
|
const int MAGIC = 0; // 4
|
|
const int THERMOMETER_ALPHA = 4; // 4
|
|
const int THERMOMETER_PERIOD = 8; // 8
|
|
const int THERMOMETER_CAL[4] = {12, 16, 20, 24}; // 4 x 4
|
|
|
|
float getFloat(int pos);
|
|
void setFloat(int pos, float value);
|
|
unsigned int getUInt(int pos);
|
|
void setUInt(int pos, unsigned int value);
|
|
unsigned long getULong(int pos);
|
|
void setULong(int pos, unsigned long value);
|
|
|
|
bool isInitialized();
|
|
|
|
void setMagic();
|
|
}
|
|
|
|
#endif /* CONFIG_H_ */
|