Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define COLOR4_CMD_CODE_CONF 0x00
60 #define COLOR4_CMD_CODE_RED 0x08
61 #define COLOR4_CMD_CODE_GREEN 0x09
62 #define COLOR4_CMD_CODE_BLUE 0x0A
63 #define COLOR4_CMD_CODE_WHITE 0x0B
81 #define COLOR4_INTEGRATION_TIME_40MS 0x00
82 #define COLOR4_INTEGRATION_TIME_80MS 0x10
83 #define COLOR4_INTEGRATION_TIME_160MS 0x20
84 #define COLOR4_INTEGRATION_TIME_320MS 0x30
85 #define COLOR4_INTEGRATION_TIME_640MS 0x40
86 #define COLOR4_INTEGRATION_TIME_1280MS 0x50
87 #define COLOR4_INTEGRATION_BIT_MASK 0x70
89 #define COLOR4_TRIG_DISABLE 0x00
90 #define COLOR4_TRIG_ENABLE 0x04
91 #define COLOR4_TRIG_BIT_MASK 0x04
93 #define COLOR4_AF_AUTO 0x00
94 #define COLOR4_AF_FORCE 0x02
95 #define COLOR4_AF_BIT_MASK 0x02
97 #define COLOR4_SD_ENABLE 0x00
98 #define COLOR4_SD_DISABLE 0x01
99 #define COLOR4_SD_BIT_MASK 0x01
107 #define COLOR4_DEVICE_ADDRESS 0x10
125 #define COLOR4_MAP_MIKROBUS( cfg, mikrobus ) \
126 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
127 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
@ COLOR4_RED
Definition: color4.h:179
err_t color4_generic_write(color4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Color 4 I2C writing function.
Color 4 Click configuration object.
Definition: color4.h:153
uint32_t i2c_speed
Definition: color4.h:157
err_t color4_default_cfg(color4_t *ctx)
Color 4 default configuration function.
err_t color4_init(color4_t *ctx, color4_cfg_t *cfg)
Color 4 initialization function.
uint8_t chip_shutdown
Definition: color4.h:195
uint8_t integration_time
Definition: color4.h:192
color4_ch_color_t
Color 4 Click channel selection value data.
Definition: color4.h:178
err_t color4_get_color_data(color4_t *ctx, color4_ch_color_t ch_color, uint16_t *color_data)
Color 4 get color data function.
@ COLOR4_WHITE
Definition: color4.h:182
void color4_cfg_setup(color4_cfg_t *cfg)
Color 4 configuration object setup function.
@ COLOR4_ERROR
Definition: color4.h:169
float offset
Definition: color4.h:144
err_t color4_set_config(color4_t *ctx, color4_config_t config)
Color 4 set configuration function.
err_t color4_generic_read(color4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Color 4 I2C reading function.
pin_name_t sda
Definition: color4.h:155
@ COLOR4_GREEN
Definition: color4.h:180
uint8_t slave_address
Definition: color4.h:142
Color 4 Click sensor configuration object.
Definition: color4.h:191
Color 4 Click context object.
Definition: color4.h:137
uint8_t trig
Definition: color4.h:193
i2c_master_t i2c
Definition: color4.h:139
uint8_t i2c_address
Definition: color4.h:158
pin_name_t scl
Definition: color4.h:154
@ COLOR4_BLUE
Definition: color4.h:181
color4_return_value_t
Color 4 Click return value data.
Definition: color4.h:167
err_t color4_get_cct(color4_t *ctx, float *cct)
Color 4 get CCT data function.
err_t color4_get_ambient_light(color4_t *ctx, float *ambient_light)
Color 4 get ambient light level function.
uint8_t mode
Definition: color4.h:194
@ COLOR4_OK
Definition: color4.h:168
err_t color4_get_config(color4_t *ctx, color4_config_t *config)
Color 4 get configuration function.