Closed mkostrun closed 4 years ago
Add to that a creative way of finding the calibrationModeEE in
void ExtractCILCParameters(uint16_t eeData, paramsMLX90640 mlx90640) { float ilChessC[3]; uint8_t calibrationModeEE;
// calibrationModeEE = (eeData[10] & 0x0800) >> 4; // calibrationModeEE = calibrationModeEE ^ 0x80; calibrationModeEE = ((eeData[12] & 0x1000) >> 12);
... ... }
which should be 0 for interleaved or 1for chess mode.
This then means that in
void MLX90640::CalculateTo(uint16_t frameData, float emissivity, float tr, float result) { ... mode = (frameData[832] & 0x1000) >> 12; ... } as 832 carries the copy of the control Register 1.
Well, this is a matter of implementation. Both codes would return the same result. Note that mode is either checked for being 0 or compared to calibrationModeEE and both are aligned in the same way (0x80). So, it does not matter whether you align the relevant bit to bit 0 or bit 7 as long as you have it in the same place in both variables - mode and calibrationModeEE. The only thing is that the correct place to look for the calibrationModeEE would be eeData[10] and not eeData[12].
Best regards
in API in function void MLX90640_CalculateTo(uint16_t frameData, const paramsMLX90640 params, float emissivity, float tr, float *result){..}
shouldn't mode be determined instead l.308: mode = (frameData[832] & 0x1000) >> 5;
as l.308: mode = (frameData[832] & 0x1000) >> 12;