MLX90632 Driver Library
a258525c
Universal MCU library for the 90632
|
range measurements implementation for MLX90632 driver with virtual i2c communication More...
Macros | |
#define | POW10 10000000000LL |
#define | VERSION "test" |
#define | STATIC static |
#define | POW10 10000000000LL |
#define | VERSION "test" |
#define | STATIC static |
Functions | |
int | mlx90632_start_measurement (void) |
Trigger start measurement for mlx90632. More... | |
STATIC int32_t | mlx90632_channel_new_select (int32_t ret, uint8_t *channel_new, uint8_t *channel_old) |
Based on mlx90632_start_measurement return value fill channel_new and channel_old variables with proper values. More... | |
STATIC int32_t | mlx90632_read_temp_ambient_raw (int16_t *ambient_new_raw, int16_t *ambient_old_raw) |
Read ambient raw old and new values based on mlx90632_start_measurement return value. More... | |
STATIC int32_t | mlx90632_read_temp_object_raw (int32_t start_measurement_ret, int16_t *object_new_raw, int16_t *object_old_raw) |
Read object raw old and new values based on mlx90632_start_measurement return value. More... | |
int32_t | mlx90632_read_temp_raw (int16_t *ambient_new_raw, int16_t *ambient_old_raw, int16_t *object_new_raw, int16_t *object_old_raw) |
Read raw ambient and object temperature. More... | |
int32_t | mlx90632_read_temp_raw_burst (int16_t *ambient_new_raw, int16_t *ambient_old_raw, int16_t *object_new_raw, int16_t *object_old_raw) |
Read raw ambient and object temperature in sleeping step mode. More... | |
double | mlx90632_preprocess_temp_ambient (int16_t ambient_new_raw, int16_t ambient_old_raw, int16_t Gb) |
Calculation of raw ambient output. More... | |
double | mlx90632_preprocess_temp_object (int16_t object_new_raw, int16_t object_old_raw, int16_t ambient_new_raw, int16_t ambient_old_raw, int16_t Ka) |
Calculation of raw object output. More... | |
double | mlx90632_calc_temp_ambient (int16_t ambient_new_raw, int16_t ambient_old_raw, int32_t P_T, int32_t P_R, int32_t P_G, int32_t P_O, int16_t Gb) |
Calculation of ambient temperature. More... | |
STATIC double | mlx90632_calc_temp_object_iteration (double prev_object_temp, int32_t object, double TAdut, int32_t Ga, int32_t Fa, int32_t Fb, int16_t Ha, int16_t Hb, double emissivity) |
Iterative calculation of object temperature. More... | |
STATIC double | mlx90632_calc_temp_object_iteration_reflected (double prev_object_temp, int32_t object, double TAdut, double TaTr4, int32_t Ga, int32_t Fa, int32_t Fb, int16_t Ha, int16_t Hb, double emissivity) |
Iterative calculation of object temperature when the environment temperature differs from the sensor temperature. More... | |
void | mlx90632_set_emissivity (double value) |
Set emissivity which is retained in single variable. More... | |
double | mlx90632_get_emissivity (void) |
Read value of emissivity. More... | |
double | mlx90632_calc_temp_object (int32_t object, int32_t ambient, int32_t Ea, int32_t Eb, int32_t Ga, int32_t Fa, int32_t Fb, int16_t Ha, int16_t Hb) |
Calculation of object temperature. More... | |
double | mlx90632_calc_temp_object_reflected (int32_t object, int32_t ambient, double reflected, int32_t Ea, int32_t Eb, int32_t Ga, int32_t Fa, int32_t Fb, int16_t Ha, int16_t Hb) |
Calculation of object temperature when the environment temperature differs from the sensor temperature. More... | |
int32_t | mlx90632_init (void) |
Initialize MLX90632 driver and confirm EEPROM version. More... | |
int32_t | mlx90632_addressed_reset (void) |
Trigger system reset for mlx90632. More... | |
int32_t | mlx90632_get_measurement_time (uint16_t meas) |
Reads the refresh rate and calculates the time needed for a single measurment from the EEPROM settings. More... | |
int32_t | mlx90632_calculate_dataset_ready_time (void) |
Reads the refresh rate and calculates the time needed for a whole measurment table from the EEPROM settings. More... | |
int32_t | mlx90632_start_measurement_burst (void) |
Trigger start of burst measurement for mlx90632. More... | |
STATIC int32_t | mlx90632_unlock_eeporm () |
STATIC int32_t | mlx90632_wait_for_eeprom_not_busy () |
STATIC int32_t | mlx90632_erase_eeprom (uint16_t address) |
STATIC int32_t | mlx90632_write_eeprom (uint16_t address, uint16_t data) |
int32_t | mlx90632_set_refresh_rate (mlx90632_meas_t measRate) |
Sets the refresh rate of the sensor using the MLX90632_EE_MEAS_1 and MLX90632_EE_MEAS_2 registers. More... | |
mlx90632_meas_t | mlx90632_get_refresh_rate (void) |
Gets the value in MLX90632_EE_MEAS_1 and converts it to the appropriate MLX90632_MEAS enum. More... | |
STATIC int32_t | mlx90632_read_temp_ambient_raw_extended (int16_t *ambient_new_raw, int16_t *ambient_old_raw) |
Read ambient raw old and new values for the extended range based on mlx90632_start_measurement return value. More... | |
STATIC int32_t | mlx90632_read_temp_object_raw_extended (int16_t *object_new_raw) |
Read object raw values for the extended range based on mlx90632_start_measurement return value. More... | |
int32_t | mlx90632_read_temp_raw_extended (int16_t *ambient_new_raw, int16_t *ambient_old_raw, int16_t *object_new_raw) |
Read raw ambient and object temperature for extended range. More... | |
int32_t | mlx90632_read_temp_raw_extended_burst (int16_t *ambient_new_raw, int16_t *ambient_old_raw, int16_t *object_new_raw) |
Read raw ambient and object temperature for extended range sleeping step mode. More... | |
double | mlx90632_preprocess_temp_ambient_extended (int16_t ambient_new_raw, int16_t ambient_old_raw, int16_t Gb) |
Calculation of raw ambient output for the extended range. More... | |
double | mlx90632_preprocess_temp_object_extended (int16_t object_new_raw, int16_t ambient_new_raw, int16_t ambient_old_raw, int16_t Ka) |
Calculation of raw object output for the extended range. More... | |
double | mlx90632_calc_temp_ambient_extended (int16_t ambient_new_raw, int16_t ambient_old_raw, int32_t P_T, int32_t P_R, int32_t P_G, int32_t P_O, int16_t Gb) |
Calculation of ambient temperature for the extended range. More... | |
static double | mlx90632_calc_temp_object_iteration_extended (double prev_object_temp, int32_t object, double TAdut, double TaTr4, int32_t Ga, int32_t Fa, int32_t Fb, int16_t Ha, int16_t Hb, double emissivity) |
Iterative calculation of object temperature. More... | |
double | mlx90632_calc_temp_object_extended (int32_t object, int32_t ambient, double reflected, int32_t Ea, int32_t Eb, int32_t Ga, int32_t Fa, int32_t Fb, int16_t Ha, int16_t Hb) |
Calculation of object temperature for the extended range. More... | |
int32_t | mlx90632_set_meas_type (uint8_t type) |
Switch the measurement type of the MLX90632. More... | |
int32_t | mlx90632_get_meas_type (void) |
Get the current measurement type set in the MLX90632. More... | |
Variables | |
static const char | mlx90632version [] = { VERSION } |
static double | emissivity = 0.0 |
range measurements implementation for MLX90632 driver with virtual i2c communication
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
#define POW10 10000000000LL |
Definition at line 34 of file mlx90632_extended_meas.c.
#define POW10 10000000000LL |
Definition at line 35 of file mlx90632.c.
#define STATIC static |
Definition at line 41 of file mlx90632_extended_meas.c.
#define STATIC static |
Definition at line 44 of file mlx90632.c.
#define VERSION "test" |
Definition at line 37 of file mlx90632_extended_meas.c.
#define VERSION "test" |
Definition at line 38 of file mlx90632.c.
int32_t mlx90632_addressed_reset | ( | void | ) |
Trigger system reset for mlx90632.
Perform full reset of mlx90632 using reset command. It also waits for at least 150us to ensure the mlx90632 device is properly reset and ready for further communications.
<0 | Something failed. Check errno.h for more information |
0 | The mlx90632 device was properly reset and is now ready for communication. |
Definition at line 475 of file mlx90632.c.
double mlx90632_calc_temp_ambient | ( | int16_t | ambient_new_raw, |
int16_t | ambient_old_raw, | ||
int32_t | P_T, | ||
int32_t | P_R, | ||
int32_t | P_G, | ||
int32_t | P_O, | ||
int16_t | Gb | ||
) |
Calculation of ambient temperature.
DSPv5 implementation of ambient temperature calculation
[in] | ambient_new_raw | ambient temperature from MLX90632_RAM_3. The channel 1 or 2 is determined by value in MLX90632_STAT_CYCLE_POS |
[in] | ambient_old_raw | ambient temperature from MLX90632_RAM_3. The channel 1 or 2 is determined by value not in MLX90632_STAT_CYCLE_POS |
[in] | P_T | Register value on MLX90632_EE_P_T |
[in] | P_R | Register value on MLX90632_EE_P_R |
[in] | P_G | Register value on MLX90632_EE_P_G |
[in] | P_O | Register value on MLX90632_EE_P_O |
[in] | Gb | Register value on MLX90632_EE_Gb |
Definition at line 264 of file mlx90632.c.
double mlx90632_calc_temp_ambient_extended | ( | int16_t | ambient_new_raw, |
int16_t | ambient_old_raw, | ||
int32_t | P_T, | ||
int32_t | P_R, | ||
int32_t | P_G, | ||
int32_t | P_O, | ||
int16_t | Gb | ||
) |
Calculation of ambient temperature for the extended range.
[in] | ambient_new_raw | ambient temperature from MLX90632_RAM_3 from meas num 17 |
[in] | ambient_old_raw | ambient temperature from MLX90632_RAM_3 from meas num 18 |
[in] | P_T | Register value on MLX90632_EE_P_T |
[in] | P_R | Register value on MLX90632_EE_P_R |
[in] | P_G | Register value on MLX90632_EE_P_G |
[in] | P_O | Register value on MLX90632_EE_P_O |
[in] | Gb | Register value on MLX90632_EE_Gb |
Definition at line 207 of file mlx90632_extended_meas.c.
double mlx90632_calc_temp_object | ( | int32_t | object, |
int32_t | ambient, | ||
int32_t | Ea, | ||
int32_t | Eb, | ||
int32_t | Ga, | ||
int32_t | Fa, | ||
int32_t | Fb, | ||
int16_t | Ha, | ||
int16_t | Hb | ||
) |
Calculation of object temperature.
DSPv5 implementation of object temperature calculation with customer calibration data
[in] | object | object temperature from mlx90632_preprocess_temp_object |
[in] | ambient | ambient temperature from mlx90632_preprocess_temp_ambient |
[in] | Ea | Register value on MLX90632_EE_Ea |
[in] | Eb | Register value on MLX90632_EE_Eb |
[in] | Ga | Register value on MLX90632_EE_Ga |
[in] | Fb | Register value on MLX90632_EE_Fb |
[in] | Fa | Register value on MLX90632_EE_Fa |
[in] | Ha | Register value on MLX90632_EE_Ha |
[in] | Hb | Register value on MLX90632_EE_Hb |
Definition at line 389 of file mlx90632.c.
double mlx90632_calc_temp_object_extended | ( | int32_t | object, |
int32_t | ambient, | ||
double | reflected, | ||
int32_t | Ea, | ||
int32_t | Eb, | ||
int32_t | Ga, | ||
int32_t | Fa, | ||
int32_t | Fb, | ||
int16_t | Ha, | ||
int16_t | Hb | ||
) |
Calculation of object temperature for the extended range.
[in] | object | object temperature from mlx90632_preprocess_temp_object |
[in] | ambient | sensor ambient temperature from mlx90632_preprocess_temp_ambient |
[in] | reflected | reflected (environment) temperature from a sensor different than the MLX90632 or acquired by other means |
[in] | Ea | Register value on MLX90632_EE_Ea |
[in] | Eb | Register value on MLX90632_EE_Eb |
[in] | Ga | Register value on MLX90632_EE_Ga |
[in] | Fb | Register value on MLX90632_EE_Fb |
[in] | Fa | Register value on MLX90632_EE_Fa |
[in] | Ha | Register value on MLX90632_EE_Ha |
[in] | Hb | Register value on MLX90632_EE_Hb |
Definition at line 267 of file mlx90632_extended_meas.c.
STATIC double mlx90632_calc_temp_object_iteration | ( | double | prev_object_temp, |
int32_t | object, | ||
double | TAdut, | ||
int32_t | Ga, | ||
int32_t | Fa, | ||
int32_t | Fb, | ||
int16_t | Ha, | ||
int16_t | Hb, | ||
double | emissivity | ||
) |
Iterative calculation of object temperature.
DSPv5 requires 3 iterations to reduce noise for object temperature. Since each iteration requires same calculations this helper function is implemented.
[in] | prev_object_temp | previously calculated object temperature. If there is no previously calculated temperature input 25.0 |
[in] | object | object temperature from mlx90632_preprocess_temp_object |
[in] | TAdut | ambient temperature coefficient |
[in] | Ga | Register value on MLX90632_EE_Ga |
[in] | Fa | Register value on MLX90632_EE_Fa |
[in] | Fb | Register value on MLX90632_EE_Fb |
[in] | Ha | Register value on MLX90632_EE_Ha |
[in] | Hb | Register value on MLX90632_EE_Hb |
[in] | emissivity | Value provided by user of the object emissivity |
Definition at line 300 of file mlx90632.c.
|
static |
Iterative calculation of object temperature.
The DSP requires few iterations to reduce noise for object temperature. Since each iteration requires same calculations this helper function is implemented.
[in] | prev_object_temp | previously calculated object temperature. If there is no previously calculated temperature input 25.0 |
[in] | object | object temperature from mlx90632_preprocess_temp_object_extended |
[in] | TAdut | ambient temperature coefficient |
[in] | TaTr4 | compensation coefficient for reflected (environment) temperature |
[in] | Ga | Register value on MLX90632_EE_Ga |
[in] | Fa | Register value on MLX90632_EE_Fa |
[in] | Fb | Register value on MLX90632_EE_Fb |
[in] | Ha | Register value on MLX90632_EE_Ha |
[in] | Hb | Register value on MLX90632_EE_Hb |
[in] | emissivity | Value provided by user of the object emissivity |
Definition at line 244 of file mlx90632_extended_meas.c.
STATIC double mlx90632_calc_temp_object_iteration_reflected | ( | double | prev_object_temp, |
int32_t | object, | ||
double | TAdut, | ||
double | TaTr4, | ||
int32_t | Ga, | ||
int32_t | Fa, | ||
int32_t | Fb, | ||
int16_t | Ha, | ||
int16_t | Hb, | ||
double | emissivity | ||
) |
Iterative calculation of object temperature when the environment temperature differs from the sensor temperature.
DSPv5 requires 3 iterations to reduce noise for object temperature. Since each iteration requires same calculations this helper function is implemented.
[in] | prev_object_temp | previously calculated object temperature. If there is no previously calculated temperature input 25.0 |
[in] | object | object temperature from mlx90632_preprocess_temp_object |
[in] | TAdut | ambient temperature coefficient |
[in] | TaTr4 | compensation coefficient for reflected (environment) temperature. The compensation coefficient is calculated from ambient temperature either from a sensor different than the MLX90632 or acquired by other means. |
[in] | Ga | Register value on MLX90632_EE_Ga |
[in] | Fa | Register value on MLX90632_EE_Fa |
[in] | Fb | Register value on MLX90632_EE_Fb |
[in] | Ha | Register value on MLX90632_EE_Ha |
[in] | Hb | Register value on MLX90632_EE_Hb |
[in] | emissivity | Value provided by user of the object emissivity |
Definition at line 348 of file mlx90632.c.
double mlx90632_calc_temp_object_reflected | ( | int32_t | object, |
int32_t | ambient, | ||
double | reflected, | ||
int32_t | Ea, | ||
int32_t | Eb, | ||
int32_t | Ga, | ||
int32_t | Fa, | ||
int32_t | Fb, | ||
int16_t | Ha, | ||
int16_t | Hb | ||
) |
Calculation of object temperature when the environment temperature differs from the sensor temperature.
when the object has emissivity lower than 1 then it does not just emit InfraRed light, but also reflects it. That is why measurement of the ambient temperature around object is important to help calculating more precise object temperature. This function makes it possible to add object environment temperature and offset it with sensor's ambient temperature to calculate more precise object temperature. DSPv5 implementation of object temperature calculation with customer calibration data
[in] | object | object temperature from mlx90632_preprocess_temp_object |
[in] | ambient | sensor ambient temperature from mlx90632_preprocess_temp_ambient |
[in] | reflected | reflected (environment) temperature from a sensor different than the MLX90632 or acquired by other means |
[in] | Ea | Register value on MLX90632_EE_Ea |
[in] | Eb | Register value on MLX90632_EE_Eb |
[in] | Ga | Register value on MLX90632_EE_Ga |
[in] | Fb | Register value on MLX90632_EE_Fb |
[in] | Fa | Register value on MLX90632_EE_Fa |
[in] | Ha | Register value on MLX90632_EE_Ha |
[in] | Hb | Register value on MLX90632_EE_Hb |
Definition at line 410 of file mlx90632.c.
int32_t mlx90632_calculate_dataset_ready_time | ( | void | ) |
Reads the refresh rate and calculates the time needed for a whole measurment table from the EEPROM settings.
The function is returning valid measurement time only for burst mode measurements. An error will be returned if it is called with a continuous measurement type parameter.
>=0 | Refresh time in ms |
<0 | Something went wrong. Check errno.h for more details. |
Definition at line 503 of file mlx90632.c.
STATIC int32_t mlx90632_channel_new_select | ( | int32_t | ret, |
uint8_t * | channel_new, | ||
uint8_t * | channel_old | ||
) |
Based on mlx90632_start_measurement return value fill channel_new and channel_old variables with proper values.
This is to provide a bit more flexibility in case other channels are returned and need a bit more mingeling than usual maths can provide.
So far there are just two use cases. If returned value is not 1 or 2, it will leave channel_new and channel_old unassigned.
[in] | ret | mlx90632_start_measurement return value |
[out] | *channel_new | Pointer to memory location where new channel value is stored |
[out] | *channel_old | Pointer to memory location where old channel value is stored |
0 | When both memory locations are updated as per ret |
-EINVAL | channel_new and channel_old were not updated |
Definition at line 97 of file mlx90632.c.
STATIC int32_t mlx90632_erase_eeprom | ( | uint16_t | address | ) |
Definition at line 616 of file mlx90632.c.
double mlx90632_get_emissivity | ( | void | ) |
int32_t mlx90632_get_meas_type | ( | void | ) |
Get the current measurement type set in the MLX90632.
= | MLX90632_MTYP_MEDICAL - medical range measurement type |
= | MLX90632_MTYP_EXTENDED - extended range measurement type |
<0 | Something went wrong. Consult errno.h for more details. |
Definition at line 341 of file mlx90632_extended_meas.c.
int32_t mlx90632_get_measurement_time | ( | uint16_t | meas | ) |
Reads the refresh rate and calculates the time needed for a single measurment from the EEPROM settings.
[in] | meas | Measurement to read the frefresh rate for |
>=0 | Refresh time in ms |
<0 | Something went wrong. Check errno.h for more details. |
Definition at line 488 of file mlx90632.c.
mlx90632_meas_t mlx90632_get_refresh_rate | ( | void | ) |
Gets the value in MLX90632_EE_MEAS_1 and converts it to the appropriate MLX90632_MEAS enum.
MLX90632_MEAS_HZ_ERROR | if there is an error |
refresh_rate | as the mlx90632_meas_e |
Definition at line 681 of file mlx90632.c.
int32_t mlx90632_init | ( | void | ) |
Initialize MLX90632 driver and confirm EEPROM version.
EEPROM version is important to match sensor EEPROM content and calculations. This is why this function checks for correct EEPROM version before it does checksum validation of the EEPROM content.
0 | Successfully initialized MLX90632 driver, extended range measurement not supported |
Definition at line 441 of file mlx90632.c.
double mlx90632_preprocess_temp_ambient | ( | int16_t | ambient_new_raw, |
int16_t | ambient_old_raw, | ||
int16_t | Gb | ||
) |
Calculation of raw ambient output.
Preprocessing of the raw ambient value
[in] | ambient_new_raw | ambient temperature from MLX90632_RAM_3. The meas_num 1 or 2 is determined by value in MLX90632_STAT_CYCLE_POS |
[in] | ambient_old_raw | ambient temperature from MLX90632_RAM_3. The meas_num 1 or 2 is determined by value not in MLX90632_STAT_CYCLE_POS |
[in] | Gb | Register value on MLX90632_EE_Gb |
Definition at line 242 of file mlx90632.c.
double mlx90632_preprocess_temp_ambient_extended | ( | int16_t | ambient_new_raw, |
int16_t | ambient_old_raw, | ||
int16_t | Gb | ||
) |
Calculation of raw ambient output for the extended range.
Preprocessing of the raw ambient value
[in] | ambient_new_raw | ambient temperature from MLX90632_RAM_3 from meas num 17 |
[in] | ambient_old_raw | ambient temperature from MLX90632_RAM_3 from meas num 18 |
[in] | Gb | Register value on MLX90632_EE_Gb |
Definition at line 186 of file mlx90632_extended_meas.c.
double mlx90632_preprocess_temp_object | ( | int16_t | object_new_raw, |
int16_t | object_old_raw, | ||
int16_t | ambient_new_raw, | ||
int16_t | ambient_old_raw, | ||
int16_t | Ka | ||
) |
Calculation of raw object output.
Preprocessing of the raw object value
[in] | object_new_raw | object temperature from MLX90632_RAM_1 or MLX90632_RAM_2. The meas_number 1 or 2 is determined by value in MLX90632_STAT_CYCLE_POS |
[in] | object_old_raw | object temperature from MLX90632_RAM_1 or MLX90632_RAM_2. The meas_number 1 or 2 is determined by value not in MLX90632_STAT_CYCLE_POS |
[in] | ambient_new_raw | ambient temperature from MLX90632_RAM_3. The meas_number 1 or 2 is determined by value in MLX90632_STAT_CYCLE_POS |
[in] | ambient_old_raw | ambient temperature from MLX90632_RAM_3. The meas_number 1 or 2 is determined by value not in MLX90632_STAT_CYCLE_POS |
[in] | Ka | Register value on MLX90632_EE_Ka |
Definition at line 252 of file mlx90632.c.
double mlx90632_preprocess_temp_object_extended | ( | int16_t | object_new_raw, |
int16_t | ambient_new_raw, | ||
int16_t | ambient_old_raw, | ||
int16_t | Ka | ||
) |
Calculation of raw object output for the extended range.
Preprocessing of the raw object value
[in] | object_new_raw | object temperature from MLX90632_RAM_1 and MLX90632_RAM_2 from meas_number 17, 18 and 19 |
[in] | ambient_new_raw | ambient temperature from MLX90632_RAM_3 from meas num 17 |
[in] | ambient_old_raw | ambient temperature from MLX90632_RAM_3 from meas num 18 |
[in] | Ka | Register value on MLX90632_EE_Ka |
Definition at line 196 of file mlx90632_extended_meas.c.
STATIC int32_t mlx90632_read_temp_ambient_raw | ( | int16_t * | ambient_new_raw, |
int16_t * | ambient_old_raw | ||
) |
Read ambient raw old and new values based on mlx90632_start_measurement return value.
Two i2c_reads are needed to obtain necessary raw ambient values from the sensor, as they are then preprocessed before going to calculation functions. Because one value is newer than other (see mlx90632_start_measurement) this function provides dynamics based on return value of the mlx90632_start_measurement.
[out] | *ambient_new_raw | Pointer to memory location where new ambient value from sensor is stored |
[out] | *ambient_old_raw | Pointer to memory location where old ambient value from sensor is stored |
0 | Successfully read both values |
<0 | Something went wrong. Check errno.h for more details. |
Definition at line 130 of file mlx90632.c.
STATIC int32_t mlx90632_read_temp_ambient_raw_extended | ( | int16_t * | ambient_new_raw, |
int16_t * | ambient_old_raw | ||
) |
Read ambient raw old and new values for the extended range based on mlx90632_start_measurement return value.
Two i2c_reads are needed to obtain necessary raw ambient values from the sensor, as they are then preprocessed before going to calculation functions
[out] | *ambient_new_raw | Pointer to memory location where new ambient value from sensor is stored |
[out] | *ambient_old_raw | Pointer to memory location where old ambient value from sensor is stored |
0 | Successfully read both values |
<0 | Something went wrong. Check errno.h for more details. |
Definition at line 54 of file mlx90632_extended_meas.c.
STATIC int32_t mlx90632_read_temp_object_raw | ( | int32_t | start_measurement_ret, |
int16_t * | object_new_raw, | ||
int16_t * | object_old_raw | ||
) |
Read object raw old and new values based on mlx90632_start_measurement return value.
Four i2c_reads are needed to obtain necessary raw object values from the sensor. These values are grouped per new and old and then averaged before return of the function. After that they are then preprocessed before going to calculation functions. Because one value is newer than other (see mlx90632_start_measurement) this function provides dynamics based on return value of the mlx90632_start_measurement.
[in] | start_measurement_ret | Return value of mlx90632_start_measurement |
[out] | *object_new_raw | Pointer to memory location where average of new object values from sensor is stored |
[out] | *object_old_raw | Pointer to memory location where average of old object values from sensor is stored |
0 | Successfully read both values |
<0 | Something went wrong. Check errno.h for more details. |
Definition at line 162 of file mlx90632.c.
STATIC int32_t mlx90632_read_temp_object_raw_extended | ( | int16_t * | object_new_raw | ) |
Read object raw values for the extended range based on mlx90632_start_measurement return value.
Six i2c_reads are needed to obtain necessary raw object values from the sensor. These values are grouped and then averaged before return of the function. After that they are then preprocessed before going to calculation functions
[out] | *object_new_raw | Pointer to memory location where average of new object values from sensor is stored |
0 | Successfully read values |
<0 | Something went wrong. Check errno.h for more details. |
Definition at line 83 of file mlx90632_extended_meas.c.
int32_t mlx90632_read_temp_raw | ( | int16_t * | ambient_new_raw, |
int16_t * | ambient_old_raw, | ||
int16_t * | object_new_raw, | ||
int16_t * | object_old_raw | ||
) |
Read raw ambient and object temperature.
Trigger and read raw ambient and object temperatures. This values still need to be pre-processed via mlx90632_preprocess_temp_ambient and mlx90632_preprocess_temp_object functions and then processed via mlx90632_calc_temp_ambient and mlx90632_calc_temp_object to retrieve values in milliCelsius
[out] | ambient_new_raw | Pointer to where new raw ambient temperature is written |
[out] | object_new_raw | Pointer to where new raw object temperature is written |
[out] | ambient_old_raw | Pointer to where old raw ambient temperature is written |
[out] | object_old_raw | Pointer to where old raw object temperature is written |
0 | Successfully read both temperatures |
<0 | Something went wrong. Check errno.h for more details |
Read new and old ambient values from sensor
Read new and old object values from sensor
Definition at line 198 of file mlx90632.c.
int32_t mlx90632_read_temp_raw_burst | ( | int16_t * | ambient_new_raw, |
int16_t * | ambient_old_raw, | ||
int16_t * | object_new_raw, | ||
int16_t * | object_old_raw | ||
) |
Read raw ambient and object temperature in sleeping step mode.
Trigger and read raw ambient and object temperatures. This values still need to be pre-processed via mlx90632_preprocess_temp_ambient and mlx90632_preprocess_temp_object functions and then processed via mlx90632_calc_temp_ambient and mlx90632_calc_temp_object to retrieve values in milliCelsius
[out] | ambient_new_raw | Pointer to where new raw ambient temperature is written |
[out] | object_new_raw | Pointer to where new raw object temperature is written |
[out] | ambient_old_raw | Pointer to where old raw ambient temperature is written |
[out] | object_old_raw | Pointer to where old raw object temperature is written |
0 | Successfully read both temperatures |
<0 | Something went wrong. Check errno.h for more details |
Read new and old ambient values from sensor
Read new and old object values from sensor
Definition at line 219 of file mlx90632.c.
int32_t mlx90632_read_temp_raw_extended | ( | int16_t * | ambient_new_raw, |
int16_t * | ambient_old_raw, | ||
int16_t * | object_new_raw | ||
) |
Read raw ambient and object temperature for extended range.
Trigger and read raw ambient and object temperatures. This values still need to be pre-processed via mlx90632_preprocess_temp_ambient_extended and mlx90632_preprocess_temp_object_extended functions and then processed via mlx90632_calc_temp_ambient_extended and mlx90632_calc_temp_object_extended to retrieve values in milliCelsius
[out] | ambient_new_raw | Pointer to where new raw ambient temperature is written |
[out] | object_new_raw | Pointer to where new raw object temperature is written |
[out] | ambient_old_raw | Pointer to where old raw ambient temperature is written |
[out] | object_old_raw | Pointer to where old raw object temperature is written |
0 | Successfully read both temperatures |
<0 | Something went wrong. Check errno.h for more details |
Read new and old ambient values from sensor
Read new object value from sensor
Definition at line 133 of file mlx90632_extended_meas.c.
int32_t mlx90632_read_temp_raw_extended_burst | ( | int16_t * | ambient_new_raw, |
int16_t * | ambient_old_raw, | ||
int16_t * | object_new_raw | ||
) |
Read raw ambient and object temperature for extended range sleeping step mode.
Trigger and read raw ambient and object temperatures. This values still need to be pre-processed via mlx90632_preprocess_temp_ambient_extended and mlx90632_preprocess_temp_object_extended functions and then processed via mlx90632_calc_temp_ambient_extended and mlx90632_calc_temp_object_extended to retrieve values in milliCelsius
[out] | ambient_new_raw | Pointer to where new raw ambient temperature is written |
[out] | object_new_raw | Pointer to where new raw object temperature is written |
[out] | ambient_old_raw | Pointer to where old raw ambient temperature is written |
[out] | object_old_raw | Pointer to where old raw object temperature is written |
0 | Successfully read both temperatures |
<0 | Something went wrong. Check errno.h for more details |
Read new and old ambient values from sensor
Read new object value from sensor
Definition at line 166 of file mlx90632_extended_meas.c.
void mlx90632_set_emissivity | ( | double | value | ) |
Set emissivity which is retained in single variable.
[in] | value | Value provided by user of object emissivity. Defaults to 1.0 and cannot be 0.0. |
Definition at line 372 of file mlx90632.c.
int32_t mlx90632_set_meas_type | ( | uint8_t | type | ) |
Switch the measurement type of the MLX90632.
[in] | type | measurement type to switch to |
0 | Successfully swithed the meausurement mode |
<0 | Something went wrong. Check errno.h for more details |
Definition at line 299 of file mlx90632_extended_meas.c.
int32_t mlx90632_set_refresh_rate | ( | mlx90632_meas_t | measRate | ) |
Sets the refresh rate of the sensor using the MLX90632_EE_MEAS_1 and MLX90632_EE_MEAS_2 registers.
[in] | measRate | refresh rate to set with mlx90632_meas_e |
<0 | Something went wrong. Consult errno.h for more details. |
Definition at line 650 of file mlx90632.c.
int mlx90632_start_measurement | ( | void | ) |
Trigger start measurement for mlx90632.
Trigger measurement cycle and wait for data to be ready. It does not read anything, just triggers and completes.
<0 | Something failed. Check errno.h for more information |
>=0 | Channel position where new (recently updated) measurement can be found |
Definition at line 47 of file mlx90632.c.
int32_t mlx90632_start_measurement_burst | ( | void | ) |
Trigger start of burst measurement for mlx90632.
Trigger a single measurement cycle and wait for data to be ready. It does not read anything, just triggers and completes. The SOB bit is set so that the complete measurement table is re-freshed.
<0 | Something failed. Check errno.h for more information |
0 | New data is available and waiting to be processed |
Definition at line 553 of file mlx90632.c.
STATIC int32_t mlx90632_unlock_eeporm | ( | ) |
Definition at line 598 of file mlx90632.c.
STATIC int32_t mlx90632_wait_for_eeprom_not_busy | ( | ) |
Definition at line 603 of file mlx90632.c.
STATIC int32_t mlx90632_write_eeprom | ( | uint16_t | address, |
uint16_t | data | ||
) |
Definition at line 631 of file mlx90632.c.
|
static |
Definition at line 371 of file mlx90632.c.
|
static |
Definition at line 41 of file mlx90632.c.