39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define IRGRID_CAL_ACOMMON_L 0xD0
74#define IRGRID_CAL_ACOMMON_H 0xD1
75#define IRGRID_CAL_ACP_L 0xD3
76#define IRGRID_CAL_ACP_H 0xD4
77#define IRGRID_CAL_BCP 0xD5
78#define IRGRID_CAL_ALPHA_CP_L 0xD6
79#define IRGRID_CAL_ALPHA_CP_H 0xD7
80#define IRGRID_CAL_TGC 0xD8
81#define IRGRID_CAL_AI_SCALE 0xD9
82#define IRGRID_CAL_BI_SCALE 0xD9
83#define IRGRID_VTH_L 0xDA
84#define IRGRID_VTH_H 0xDB
85#define IRGRID_KT1_L 0xDC
86#define IRGRID_KT1_H 0xDD
87#define IRGRID_KT2_L 0xDE
88#define IRGRID_KT2_H 0xDF
89#define IRGRID_KT_SCALE 0xD2
90#define IRGRID_CAL_A0_L 0xE0
91#define IRGRID_CAL_A0_H 0xE1
92#define IRGRID_CAL_A0_SCALE 0xE2
93#define IRGRID_CAL_DELTA_A_SCALE 0xE3
94#define IRGRID_CAL_EMIS_L 0xE4
95#define IRGRID_CAL_EMIS_H 0xE5
96#define IRGRID_OSC_TRIM_VALUE 0xF7
119#define IRGRID_MAP_MIKROBUS( cfg, mikrobus ) \
120 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
121 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
170 uint8_t eeprom_data[ 256 ];
171 int16_t ir_data[ 64 ];
172 float temperature_data[ 64 ];
175 float alpha_a_data[ 64 ];
void irgrid_read_ram(irgrid_t *ctx, uint8_t *reg, uint8_t *data_buf, uint8_t len)
Read function using RAM slave adress.
void irgrid_write_eeprom(irgrid_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Write function using EEPROM slave adress.
void irgrid_get_temperature(irgrid_data_t *data_str, float *buffer)
Read Calculated Temperature buffer.
void irgrid_read_eeprom(irgrid_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Read function using EEPROM slave adress.
float irgrid_get_amb_temperature(irgrid_t *ctx)
Read Ambient Temperature.
void irgrid_get_ir_raw(irgrid_data_t *data_str, int16_t *buffer)
Read Raw Temperature buffer.
uint8_t irgrid_measure(irgrid_t *ctx, irgrid_data_t *data_str)
Measurement.
void irgrid_cfg_setup(irgrid_cfg_t *cfg)
IR Grid configuration object setup function.
uint8_t irgrid_device_init(irgrid_t *ctx, irgrid_data_t *data_str, uint8_t refrate)
Device Initialization.
err_t irgrid_init(irgrid_t *ctx, irgrid_cfg_t *cfg)
IR Grid initialization function.
void irgrid_write_ram(irgrid_t *ctx, uint8_t *data_buf, uint8_t len)
Write function using RAM slave adress.
irgrid_return_value_t
IR Grid Click return value data.
Definition irgrid.h:184
@ IRGRID_OK
Definition irgrid.h:185
@ IRGRID_ERROR
Definition irgrid.h:186
IR Grid Click configuration object.
Definition irgrid.h:153
uint8_t i2c_ram_address
Definition irgrid.h:158
uint32_t i2c_speed
Definition irgrid.h:157
pin_name_t scl
Definition irgrid.h:154
uint8_t i2c_eeprom_address
Definition irgrid.h:159
pin_name_t sda
Definition irgrid.h:155
Click data object definition.
Definition irgrid.h:167
IR Grid Click context object.
Definition irgrid.h:131
uint8_t slave_eeprom_address
Definition irgrid.h:137
uint8_t refresh_rate
Definition irgrid.h:140
uint8_t slave_ram_address
Definition irgrid.h:136
int16_t cpix
Definition irgrid.h:143
float temperature_amb
Definition irgrid.h:141
int16_t ptat
Definition irgrid.h:144
i2c_master_t i2c
Definition irgrid.h:133
int16_t resolution
Definition irgrid.h:142