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 COLOR12_REG_SYSTEM_CONTROL 0x40
60 #define COLOR12_REG_MODE_CONTROL1 0x41
61 #define COLOR12_REG_MODE_CONTROL2 0x42
62 #define COLOR12_REG_MODE_CONTROL3 0x43
63 #define COLOR12_REG_RED_DATA_L 0x50
64 #define COLOR12_REG_RED_DATA_H 0x51
65 #define COLOR12_REG_GREEN_DATA_L 0x52
66 #define COLOR12_REG_GREEN_DATA_H 0x53
67 #define COLOR12_REG_BLUE_DATA_L 0x54
68 #define COLOR12_REG_BLUE_DATA_H 0x55
69 #define COLOR12_REG_IR_DATA_L 0x56
70 #define COLOR12_REG_IR_DATA_H 0x57
71 #define COLOR12_REG_FLICKER_DATA_L 0x58
72 #define COLOR12_REG_FLICKER_DATA_H 0x59
73 #define COLOR12_REG_FLICKER_COUNTER 0x5A
74 #define COLOR12_REG_FIFO_LEVEL 0x5B
75 #define COLOR12_REG_FIFO_DATA_L 0x5C
76 #define COLOR12_REG_FIFO_DATA_H 0x5D
77 #define COLOR12_REG_MANUFACTURER_ID 0x92
95 #define COLOR12_SET_SW_RESET 0x80
101 #define COLOR12_RGB_GAIN_X1 0x00
102 #define COLOR12_RGB_GAIN_X2 0x01
103 #define COLOR12_RGB_GAIN_X4 0x02
104 #define COLOR12_RGB_GAIN_X8 0x03
105 #define COLOR12_RGB_GAIN_X16 0x04
106 #define COLOR12_RGB_GAIN_X32 0x05
112 #define COLOR12_MEAS_MODE_55MS 0x01
113 #define COLOR12_MEAS_MODE_100MS 0x02
119 #define COLOR12_FLC_GAIN_X1 0x00
120 #define COLOR12_FLC_GAIN_X2 0x01
121 #define COLOR12_FLC_GAIN_X4 0x02
122 #define COLOR12_FLC_GAIN_X8 0x03
123 #define COLOR12_FLC_GAIN_X16 0x04
124 #define COLOR12_FLC_GAIN_X32 0x05
130 #define COLOR12_FLC_MODE_1KHZ 0x00
131 #define COLOR12_FLC_MODE_2KHZ 0x01
137 #define COLOR12_INT_SEL_DISABLE 0x00
138 #define COLOR12_INT_SEL_RDY_RGB_IR 0x01
139 #define COLOR12_INT_SEL_RDY_FLICKER 0x02
140 #define COLOR12_INT_SEL_RDY_FIFO 0x03
146 #define COLOR12_RGB_EN_DISABLE 0x00
147 #define COLOR12_RGB_EN_ENABLE 0x01
153 #define COLOR12_FLC_EN_DISABLE 0x00
154 #define COLOR12_FLC_EN_ENABLE 0x01
160 #define COLOR12_MANUFACTURER_ID 0xE0
167 #define COLOR12_DEVICE_ADDRESS 0x38
185 #define COLOR12_MAP_MIKROBUS( cfg, mikrobus ) \
186 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
187 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
188 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
color12_color_sel_t
Color 12 Click color selection value data.
Definition: color12.h:242
Color 12 Click context object.
Definition: color12.h:198
uint8_t slave_address
Definition: color12.h:206
uint8_t color12_get_int_pin(color12_t *ctx)
Color 12 gets the interrupt function.
@ COLOR12_ERROR
Definition: color12.h:233
pin_name_t int_pin
Definition: color12.h:219
err_t color4_get_config(color12_t *ctx, color12_config_t *config)
Color 12 gets the configuration function.
err_t color12_generic_write(color12_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Color 12 I2C writing function.
@ COLOR12_DATA_BLUE
Definition: color12.h:245
uint8_t flc_en
Definition: color12.h:262
pin_name_t scl
Definition: color12.h:216
void color12_cfg_setup(color12_cfg_t *cfg)
Color 12 configuration object setup function.
@ COLOR12_DATA_RED
Definition: color12.h:243
uint8_t int_sel
Definition: color12.h:260
uint8_t meas_mode
Definition: color12.h:257
err_t color12_generic_read(color12_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Color 12 I2C reading function.
err_t color12_default_cfg(color12_t *ctx)
Color 12 default configuration function.
uint8_t rgb_gain
Definition: color12.h:256
uint8_t i2c_address
Definition: color12.h:222
err_t color12_init(color12_t *ctx, color12_cfg_t *cfg)
Color 12 initialization function.
err_t color12_set_config(color12_t *ctx, color12_config_t config)
Color 12 sets the configuration function.
@ COLOR12_DATA_GREEN
Definition: color12.h:244
digital_in_t int_pin
Definition: color12.h:200
i2c_master_t i2c
Definition: color12.h:203
uint8_t flc_gain
Definition: color12.h:258
uint32_t i2c_speed
Definition: color12.h:221
err_t color12_get_device_id(color12_t *ctx, uint8_t *device_id)
Color 12 gets the device ID function.
err_t color12_get_color_data(color12_t *ctx, color12_color_sel_t color_sel, uint16_t *color_data)
Color 12 gets the color measurement result function.
@ COLOR12_OK
Definition: color12.h:232
Color 12 Click sensor configuration object.
Definition: color12.h:255
color12_return_value_t
Color 12 Click return value data.
Definition: color12.h:231
uint8_t rgb_en
Definition: color12.h:261
err_t color12_sw_reset(color12_t *ctx)
Color 12 software reset function.
uint8_t flc_mode
Definition: color12.h:259
Color 12 Click configuration object.
Definition: color12.h:215
@ COLOR12_DATA_IR
Definition: color12.h:246
pin_name_t sda
Definition: color12.h:217