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 IRGRID2_SET_DEV_ADDR 0x33
96#define IRGRID2_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 ];
uint8_t irgrid2_extract_parameters(irgrid2_t *ctx, uint16_t *eeprom_data)
Parameters storage function.
void irgrid2_set_chess_mode(irgrid2_t *ctx)
Function for setting chess mode.
uint16_t irgrid2_get_refresh_rate(irgrid2_t *ctx)
Function for getting current refresh Rate.
void irgrid2_get_pixel_temperature(irgrid2_t *ctx, float *temp_ambient, float *pixel_temp)
Function for getting pixels temperature.
void irgrid2_get_image(irgrid2_t *ctx, uint16_t *frame_data, float *px_matrix)
Function for getting Image.
void irgrid2_set_interleaved_mode(irgrid2_t *ctx)
Function for setting interleaved mode.
err_t irgrid2_init(irgrid2_t *ctx, irgrid2_cfg_t *cfg)
IR Grid 2 initialization function.
float irgrid2_get_temp_ambient(irgrid2_t *ctx, uint16_t *frame_data)
Function for getting Ambient temperature.
void irgrid2_set_refresh_rate(irgrid2_t *ctx, uint8_t refresh_rate)
Function for setting refresh rate.
void irgrid2_default_cfg(irgrid2_t *ctx)
IR Grid 2 default configuration function.
void irgrid2_set_resolution(irgrid2_t *ctx, uint8_t resolution)
Function for setting resolution.
void irgrid2_calculate_temp_obj(irgrid2_t *ctx, uint16_t *frame_data, float tr_data, float *px_matrix)
Function for calculating temperature objects.
float irgrid2_get_vdd(irgrid2_t *ctx, uint16_t *frame_data)
Function for getting Vdd.
void irgrid2_generic_read(irgrid2_t *ctx, uint16_t reg, uint8_t *rx_buf, uint16_t rx_len)
IR Grid 2 I2C reading function.
void irgrid2_cfg_setup(irgrid2_cfg_t *cfg)
IR Grid 2 configuration object setup function.
uint16_t irgrid2_get_frame_data(irgrid2_t *ctx, uint16_t *frame_data)
Function for getting frame data.
uint16_t irgrid2_get_current_mode(irgrid2_t *ctx)
Function for getting current mode.
uint16_t irgrid2_get_current_res(irgrid2_t *ctx)
Function for getting current resolution.
void irgrid2_generic_write(irgrid2_t *ctx, uint16_t reg, uint8_t *data_buf, uint16_t len)
IR Grid 2 I2C writing function.
void irgrid2_read_eeprom(irgrid2_t *ctx, uint16_t *eeprom_data)
Function for reading EEPROM.
uint16_t irgrid2_get_subpage_number(uint16_t *frame_data)
Function for getting sub page number.
irgrid2_return_value_t
IR Grid 2 Click return value data.
Definition irgrid2.h:169
@ IRGRID2_OUTLIER_PIX_ERROR
Definition irgrid2.h:178
@ IRGRID2_2_PIX_ERROR
Definition irgrid2.h:179
@ IRGRID2_INIT_ERROR
Definition irgrid2.h:172
@ IRGRID2_ADJ_PIXELS_ERROR
Definition irgrid2.h:175
@ IRGRID2_ERROR
Definition irgrid2.h:171
@ IRGRID2_EEPROM_OK
Definition irgrid2.h:173
@ IRGRID2_ADJ_PIXELS_OK
Definition irgrid2.h:176
@ IRGRID2_OK
Definition irgrid2.h:170
@ IRGRID2_EEPROM_ERROR
Definition irgrid2.h:174
@ IRGRID2_BROKEN_PIX_ERROR
Definition irgrid2.h:177
IR Grid 2 Click configuration object.
Definition irgrid2.h:155
uint32_t i2c_speed
Definition irgrid2.h:159
pin_name_t scl
Definition irgrid2.h:156
pin_name_t sda
Definition irgrid2.h:157
uint8_t i2c_address
Definition irgrid2.h:160
IR Grid 2 Click params definition.
Definition irgrid2.h:108
int16_t k_vdd
Definition irgrid2.h:109
float ks_ta
Definition irgrid2.h:121
float kt_ptat
Definition irgrid2.h:112
uint8_t calibration_mode_eeprom
Definition irgrid2.h:120
float cp_kv
Definition irgrid2.h:117
float alpha_ptat
Definition irgrid2.h:114
int16_t vdd_25
Definition irgrid2.h:110
float kv_ptat
Definition irgrid2.h:111
float cp_kta
Definition irgrid2.h:118
uint8_t resolution_eeprom
Definition irgrid2.h:119
uint16_t v_ptat_25
Definition irgrid2.h:113
int16_t gain_eeprom
Definition irgrid2.h:115
float tgc
Definition irgrid2.h:116
IR Grid 2 Click context object.
Definition irgrid2.h:140
irgrid2_params_t params
Definition irgrid2.h:146
i2c_master_t i2c
Definition irgrid2.h:142
uint8_t slave_address
Definition irgrid2.h:145