MLX90632 Driver Library  a258525c
Universal MCU library for the 90632
mlx90632.c File Reference

MLX90632 driver with virtual i2c communication. More...

#include <stdint.h>
#include <math.h>
#include <errno.h>
#include "mlx90632.h"
#include "mlx90632_depends.h"
+ Include dependency graph for mlx90632.c:

Go to the source code of this file.

Macros

#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...
 

Variables

static const char mlx90632version [] = { VERSION }
 
static double emissivity = 0.0
 

Detailed Description

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.

Definition in file mlx90632.c.