color17 2.1.0.0
color17.h File Reference

This file contains API for Color 17 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  color17_t
 Color 17 Click context object. More...
 
struct  color17_cfg_t
 Color 17 Click configuration object. More...
 
struct  color17_config_t
 Color 17 Click configuration data object. More...
 
struct  color17_status_flag_t
 Color 17 Click status flag object. More...
 

Macros

#define COLOR17_REG_CH0_EXP_RESMSB   0x00
 Color 17 description register.
 
#define COLOR17_REG_CH0_RESMSB_CNT_CRC   0x01
 
#define COLOR17_REG_CH1_EXP_RES_MSB   0x02
 
#define COLOR17_REG_CH1_RESMSB_CNT_CRC   0x03
 
#define COLOR17_REG_CH2_EXP_RES_MSB   0x04
 
#define COLOR17_REG_CH2_RESMSB_CNT_CRC   0x05
 
#define COLOR17_REG_CH3_EXP_RES_MSB   0x06
 
#define COLOR17_REG_CH4_RESMSB_CNT_CRC   0x07
 
#define COLOR17_REG_THLD_EXP_RES_L   0x08
 
#define COLOR17_REG_THLD_EXP_RES_H   0x09
 
#define COLOR17_REG_CONFIG_0   0x0A
 
#define COLOR17_REG_CONFIG_1   0x0B
 
#define COLOR17_REG_CONFIG_2   0x0C
 
#define COLOR17_REG_DEVICE_ID   0x11
 
#define COLOR17_DEVICE_ID   0x0821u
 Color 17 description device ID value.
 
#define COLOR17_CONFIG_0_QWAKE_DIS   0x00
 Color 17 description COLOR17_REG_CONFIG_0 register values.
 
#define COLOR17_CONFIG_0_QWAKE_EN   0x01
 
#define COLOR17_CONFIG_0_RANGE_2_2KLUX   0x00
 
#define COLOR17_CONFIG_0_RANGE_4_5KLUX   0x01
 
#define COLOR17_CONFIG_0_RANGE_9KLUX   0x02
 
#define COLOR17_CONFIG_0_RANGE_18KLUX   0x03
 
#define COLOR17_CONFIG_0_RANGE_36KLUX   0x04
 
#define COLOR17_CONFIG_0_RANGE_72KLUX   0x05
 
#define COLOR17_CONFIG_0_RANGE_144KLUX   0x06
 
#define COLOR17_CONFIG_0_RANGE_AUTO   0x0C
 
#define COLOR17_CONFIG_0_CONV_600US   0x00
 
#define COLOR17_CONFIG_0_CONV_1_MS   0x01
 
#define COLOR17_CONFIG_0_CONV_1_8MS   0x02
 
#define COLOR17_CONFIG_0_CONV_3_4MS   0x03
 
#define COLOR17_CONFIG_0_CONV_6_5MS   0x04
 
#define COLOR17_CONFIG_0_CONV_12_7MS   0x05
 
#define COLOR17_CONFIG_0_CONV_25MS   0x06
 
#define COLOR17_CONFIG_0_CONV_50MS   0x07
 
#define COLOR17_CONFIG_0_CONV_100MS   0x08
 
#define COLOR17_CONFIG_0_CONV_200MS   0x09
 
#define COLOR17_CONFIG_0_CONV_400MS   0x0A
 
#define COLOR17_CONFIG_0_CONV_800MS   0x0B
 
#define COLOR17_CONFIG_0_OP_MODE_PD   0x00
 
#define COLOR17_CONFIG_0_OP_MODE_F_ONESHOT   0x01
 
#define COLOR17_CONFIG_0_OP_MODE_ONESHOT   0x02
 
#define COLOR17_CONFIG_0_OP_MODE_CONTINUOUS   0x03
 
#define COLOR17_CONFIG_0_LATCH_DIS   0x00
 
#define COLOR17_CONFIG_0_LATCH_EN   0x01
 
#define COLOR17_CONFIG_0_INT_POL_LOW   0x00
 
#define COLOR17_CONFIG_0_INT_POL_HIGH   0x01
 
#define COLOR17_CONFIG_0_FAULT_COUNT_0   0x00
 
#define COLOR17_CONFIG_0_FAULT_COUNT_2   0x01
 
#define COLOR17_CONFIG_0_FAULT_COUNT_4   0x02
 
#define COLOR17_CONFIG_0_FAULT_COUNT_8   0x03
 
#define COLOR17_CONFIG_1_MUST_READ_WRITE   0x8000u
 Color 17 description COLOR17_REG_CONFIG_1 register values.
 
#define COLOR17_CONFIG_1_THRESHOLD_CH0   0x00
 
#define COLOR17_CONFIG_1_THRESHOLD_CH1   0x01
 
#define COLOR17_CONFIG_1_THRESHOLD_CH2   0x02
 
#define COLOR17_CONFIG_1_THRESHOLD_CH3   0x03
 
#define COLOR17_CONFIG_1_INT_DIR_INPUT   0x00
 
#define COLOR17_CONFIG_1_INT_DIR_OUTPUT   0x01
 
#define COLOR17_CONFIG_1_INT_CFG_SMBUS_ALR   0x00
 
#define COLOR17_CONFIG_1_INT_CFG_NEXT_CH   0x01
 
#define COLOR17_CONFIG_1_INT_CFG_ALL_CH   0x03
 
#define COLOR17_CONFIG_1_I2C_BURST_DISABLE   0x00
 
#define COLOR17_CONFIG_1_I2C_BURST_ENABLE   0x01
 
#define COLOR17_CONFIG_2_FLAG_DISABLE   0x00
 Color 17 description COLOR17_REG_CONFIG_2 register values.
 
#define COLOR17_CONFIG_2_FLAG_ENABLE   0x01
 
#define COLOR17_SEL_CHANNEL_0   0x00
 Color 17 description channel number values.
 
#define COLOR17_SEL_CHANNEL_1   0x01
 
#define COLOR17_SEL_CHANNEL_2   0x02
 
#define COLOR17_SEL_CHANNEL_3   0x03
 
#define COLOR17_DEVICE_ADDRESS_GND   0x44
 Color 17 device address setting.
 
#define COLOR17_DEVICE_ADDRESS_VCC   0x45
 
#define COLOR17_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  color17_return_value_t { COLOR17_OK = 0 , COLOR17_ERROR = -1 }
 Color 17 Click return value data. More...
 

Functions

void color17_cfg_setup (color17_cfg_t *cfg)
 Color 17 configuration object setup function.
 
err_t color17_init (color17_t *ctx, color17_cfg_t *cfg)
 Color 17 initialization function.
 
err_t color17_default_cfg (color17_t *ctx)
 Color 17 default configuration function.
 
err_t color17_generic_write (color17_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Color 17 I2C writing function.
 
err_t color17_generic_read (color17_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Color 17 I2C reading function.
 
err_t color17_write_reg (color17_t *ctx, uint8_t reg, uint16_t data_in)
 Color 17write register function.
 
err_t color17_read_reg (color17_t *ctx, uint8_t reg, uint16_t *data_out)
 Color 17 read register function.
 
err_t color17_get_device_id (color17_t *ctx, uint16_t *device_id)
 Color 17 gets device ID function.
 
err_t color17_set_config (color17_t *ctx, color17_config_t config)
 Color 17 set the configuration function.
 
err_t color17_get_status_flag (color17_t *ctx, color17_status_flag_t *status_flag)
 Color 17 gets the status flag function.
 
err_t color17_get_ch_measurement (color17_t *ctx, uint8_t ch, uint32_t *adc_codes)
 Color 17 gets the channel measurements data function.
 
err_t color17_get_measurement (color17_t *ctx, uint32_t *adc_codes)
 Color 17 gets light and color measurement data function.
 
err_t color17_get_cct (color17_t *ctx, float *cct, float *light_intensity)
 Color 17 gets correlated color temperature data function.
 
uint8_t color17_get_int_pin (color17_t *ctx)
 Color 17 gets interrupt function.
 

Detailed Description

This file contains API for Color 17 Click Driver.

Enumeration Type Documentation

◆ color17_return_value_t

Color 17 Click return value data.

Predefined enum values for driver return values.

Enumerator
COLOR17_OK 
COLOR17_ERROR