39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_i2c_master.h"
78#define IRGRID3_SET_DEV_ADDR 0x33
96#define IRGRID3_MAP_MIKROBUS( cfg, mikrobus ) \
97 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
98 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
125 int16_t offset[ 768 ];
129 int16_t cp_offset[ 2 ];
130 float il_chess_c[ 3 ];
131 uint16_t broken_pixels[ 5 ];
132 uint16_t outlier_pixels[ 5 ];
float irgrid3_get_temp_ambient(irgrid3_t *ctx, uint16_t *frame_data)
Function for getting Ambient temperature.
void irgrid3_cfg_setup(irgrid3_cfg_t *cfg)
IR Grid 3 configuration object setup function.
void irgrid3_default_cfg(irgrid3_t *ctx)
IR Grid 3 default configuration function.
float irgrid3_get_vdd(irgrid3_t *ctx, uint16_t *frame_data)
Function for getting Vdd.
void irgrid3_generic_read(irgrid3_t *ctx, uint16_t reg, uint8_t *rx_buf, uint16_t rx_len)
IR Grid 3 I2C reading function.
void irgrid3_get_pixel_temperature(irgrid3_t *ctx, float *temp_ambient, float *pixel_temp)
Function for getting pixels temperature.
uint16_t irgrid3_get_subpage_number(uint16_t *frame_data)
Function for getting sub page number.
uint16_t irgrid3_get_frame_data(irgrid3_t *ctx, uint16_t *frame_data)
Function for getting frame data.
void irgrid3_set_refresh_rate(irgrid3_t *ctx, uint8_t refresh_rate)
Function for setting refresh rate.
void irgrid3_set_resolution(irgrid3_t *ctx, uint8_t resolution)
Function for setting resolution.
uint16_t irgrid3_get_current_mode(irgrid3_t *ctx)
Function for getting current mode.
void irgrid3_get_image(irgrid3_t *ctx, uint16_t *frame_data, float *px_matrix)
Function for getting Image.
uint16_t irgrid3_get_refresh_rate(irgrid3_t *ctx)
Function for getting current refresh Rate.
err_t irgrid3_init(irgrid3_t *ctx, irgrid3_cfg_t *cfg)
IR Grid 3 initialization function.
void irgrid3_set_chess_mode(irgrid3_t *ctx)
Function for setting chess mode.
uint16_t irgrid3_get_current_res(irgrid3_t *ctx)
Function for getting current resolution.
void irgrid3_calculate_temp_obj(irgrid3_t *ctx, uint16_t *frame_data, float tr_data, float *px_matrix)
Function for calculating temperature objects.
void irgrid3_set_interleaved_mode(irgrid3_t *ctx)
Function for setting interleaved mode.
void irgrid3_read_eeprom(irgrid3_t *ctx, uint16_t *eeprom_data)
Function for reading EEPROM.
uint8_t irgrid3_extract_parameters(irgrid3_t *ctx, uint16_t *eeprom_data)
Parameters storage function.
void irgrid3_generic_write(irgrid3_t *ctx, uint16_t reg, uint8_t *data_buf, uint16_t len)
IR Grid 3 I2C writing function.
irgrid3_return_value_t
IR Grid 3 Click return value data.
Definition irgrid3.h:169
@ IRGRID3_ERROR
Definition irgrid3.h:171
@ IRGRID3_EEPROM_OK
Definition irgrid3.h:173
@ IRGRID3_2_PIX_ERROR
Definition irgrid3.h:179
@ IRGRID3_ADJ_PIXELS_ERROR
Definition irgrid3.h:175
@ IRGRID3_INIT_ERROR
Definition irgrid3.h:172
@ IRGRID3_ADJ_PIXELS_OK
Definition irgrid3.h:176
@ IRGRID3_BROKEN_PIX_ERROR
Definition irgrid3.h:177
@ IRGRID3_EEPROM_ERROR
Definition irgrid3.h:174
@ IRGRID3_OUTLIER_PIX_ERROR
Definition irgrid3.h:178
@ IRGRID3_OK
Definition irgrid3.h:170
IR Grid 3 Click configuration object.
Definition irgrid3.h:155
uint32_t i2c_speed
Definition irgrid3.h:159
pin_name_t scl
Definition irgrid3.h:156
pin_name_t sda
Definition irgrid3.h:157
uint8_t i2c_address
Definition irgrid3.h:160
IR Grid 3 Click params definition.
Definition irgrid3.h:108
int16_t k_vdd
Definition irgrid3.h:109
float ks_ta
Definition irgrid3.h:121
float kt_ptat
Definition irgrid3.h:112
uint8_t calibration_mode_eeprom
Definition irgrid3.h:120
float cp_kv
Definition irgrid3.h:117
float alpha_ptat
Definition irgrid3.h:114
int16_t vdd_25
Definition irgrid3.h:110
float kv_ptat
Definition irgrid3.h:111
float cp_kta
Definition irgrid3.h:118
uint8_t resolution_eeprom
Definition irgrid3.h:119
uint16_t v_ptat_25
Definition irgrid3.h:113
int16_t gain_eeprom
Definition irgrid3.h:115
float tgc
Definition irgrid3.h:116
IR Grid 3 Click context object.
Definition irgrid3.h:140
irgrid3_params_t params
Definition irgrid3.h:146
i2c_master_t i2c
Definition irgrid3.h:142
uint8_t slave_address
Definition irgrid3.h:145