Go to the documentation of this file.
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 GRIDEYE2_REG_PCLT 0x00
74 #define GRIDEYE2_REG_RST 0x01
75 #define GRIDEYE2_REG_FPSC 0x02
76 #define GRIDEYE2_REG_INTC 0x03
77 #define GRIDEYE2_REG_STAT 0x04
78 #define GRIDEYE2_REG_SCLR 0x05
79 #define GRIDEYE2_REG_AVE 0x07
80 #define GRIDEYE2_REG_INTHL 0x08
81 #define GRIDEYE2_REG_INTHH 0x09
82 #define GRIDEYE2_REG_INTLL 0x0A
83 #define GRIDEYE2_REG_INTLH 0x0B
84 #define GRIDEYE2_REG_IHYSL 0x0C
85 #define GRIDEYE2_REG_IHYSH 0x0D
86 #define GRIDEYE2_REG_TTHL 0x0E
87 #define GRIDEYE2_REG_TTHH 0x0F
88 #define GRIDEYE2_REG_INT0 0x10
89 #define GRIDEYE2_REG_INT1 0x11
90 #define GRIDEYE2_REG_INT2 0x12
91 #define GRIDEYE2_REG_INT3 0x13
92 #define GRIDEYE2_REG_INT4 0x14
93 #define GRIDEYE2_REG_INT5 0x15
94 #define GRIDEYE2_REG_INT6 0x16
95 #define GRIDEYE2_REG_INT7 0x17
96 #define GRIDEYE2_REG_AVE_SET 0x1F
97 #define GRIDEYE2_REG_TO1L 0x80
98 #define GRIDEYE2_REG_TO1H 0x81
116 #define GRIDEYE2_PCLT_NORMAL_MODE 0x00
117 #define GRIDEYE2_PCLT_SLEEP_MODE 0x10
123 #define GRIDEYE2_RST_FLAG 0x30
124 #define GRIDEYE2_RST_INITIAL 0x3F
130 #define GRIDEYE2_FPSC_10FPS 0x00
131 #define GRIDEYE2_FPSC_1FPS 0x01
137 #define GRIDEYE2_INTC_INTMOD_DIFF 0x00
138 #define GRIDEYE2_INTC_INTMOD_ABS 0x02
139 #define GRIDEYE2_INTC_INTMOD_MASK 0x02
140 #define GRIDEYE2_INTC_INTEN_INACTIVE 0x00
141 #define GRIDEYE2_INTC_INTEN_ACTIVE 0x01
142 #define GRIDEYE2_INTC_INTEN_MASK 0x01
148 #define GRIDEYE2_STAT_OVF_IRS 0x04
149 #define GRIDEYE2_STAT_INTF 0x02
157 #define GRIDEYE2_AVE_MAMOD_OFF 0x00
158 #define GRIDEYE2_AVE_MAMOD_ON 0x20
159 #define GRIDEYE2_AVE_SET_0 0x50
160 #define GRIDEYE2_AVE_SET_1 0x45
161 #define GRIDEYE2_AVE_SET_2 0x57
162 #define GRIDEYE2_AVE_SET_3 0x00
168 #define GRIDEYE2_DATA_SIGN_BIT 0x0800
169 #define GRIDEYE2_DATA_FILL_SIGN 0xF000
170 #define GRIDEYE2_DATA_LSB 0.25f
171 #define GRIDEYE2_NUM_PIXELS 64
178 #define GRIDEYE2_DEVICE_ADDRESS_0 0x68
179 #define GRIDEYE2_DEVICE_ADDRESS_1 0x69
197 #define GRIDEYE2_MAP_MIKROBUS( cfg, mikrobus ) \
198 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
199 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
200 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
digital_in_t int_pin
Definition: grideye2.h:212
err_t grideye2_clear_status(grideye2_t *ctx)
Grid-EYE 2 clear status function.
err_t grideye2_read_grid(grideye2_t *ctx)
Grid-EYE 2 read grid function.
pin_name_t sda
Definition: grideye2.h:231
err_t grideye2_init(grideye2_t *ctx, grideye2_cfg_t *cfg)
Grid-EYE 2 initialization function.
uint8_t grideye2_get_int_pin(grideye2_t *ctx)
Grid-EYE 2 get INT pin function.
err_t grideye2_write_reg_byte(grideye2_t *ctx, uint8_t reg, uint8_t data_in)
Grid-EYE 2 write reg byte function.
Grid-EYE 2 Click configuration object.
Definition: grideye2.h:229
uint8_t slave_address
Definition: grideye2.h:218
pin_name_t int_pin
Definition: grideye2.h:233
@ GRIDEYE2_ERROR
Definition: grideye2.h:247
err_t grideye2_default_cfg(grideye2_t *ctx)
Grid-EYE 2 default configuration function.
err_t grideye2_read_reg_bytes(grideye2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Grid-EYE 2 read reg bytes function.
#define GRIDEYE2_NUM_PIXELS
Definition: grideye2.h:171
@ GRIDEYE2_OK
Definition: grideye2.h:246
Grid-EYE 2 Click context object.
Definition: grideye2.h:210
err_t grideye2_read_reg_word(grideye2_t *ctx, uint8_t reg, uint16_t *data_out)
Grid-EYE 2 read reg word function.
err_t grideye2_write_reg_word(grideye2_t *ctx, uint8_t reg, uint16_t data_in)
Grid-EYE 2 write reg word function.
err_t grideye2_write_reg_bytes(grideye2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Grid-EYE 2 write reg bytes function.
err_t grideye2_read_reg_byte(grideye2_t *ctx, uint8_t reg, uint8_t *data_out)
Grid-EYE 2 read reg byte function.
grideye2_return_value_t
Grid-EYE 2 Click return value data.
Definition: grideye2.h:245
uint8_t i2c_address
Definition: grideye2.h:236
uint32_t i2c_speed
Definition: grideye2.h:235
void grideye2_cfg_setup(grideye2_cfg_t *cfg)
Grid-EYE 2 configuration object setup function.
i2c_master_t i2c
Definition: grideye2.h:215
pin_name_t scl
Definition: grideye2.h:230