15 #define DPT_FLOAT_NEG_SIGN 0x8000
22 if (value < -67108864 || value > 67076096)
33 return DPT_FLOAT_NEG_SIGN | (((int32_t) value) & 2047) | (exp << 11);
43 return value | (exp << 11);
49 uint16_t exp = (dptValue >> 11) & 15;
52 if (dptValue == 0x7fff)
53 return INVALID_DPT_FLOAT;
55 if (dptValue >= 0x8000)
56 value = dptValue | (-1L & ~2047);
58 value = dptValue & 2047;
int32_t dptFromFloat(uint16_t dptValue)
Convert a value from 2 uint8_t float (DPT9/EIS5) to integer.
uint16_t dptToFloat(int32_t value)
Convert a value from uint32_t to 2 uint8_t float (DPT9/EIS5).