color11 2.1.0.0
color11.h File Reference

This file contains API for Color 11 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  color11_t
 Color 11 Click context object. More...
 
struct  color11_cfg_t
 Color 11 Click configuration object. More...
 
struct  color11_als_data_t
 Color 11 Click ALS data object. More...
 
struct  color11_identification_t
 Color 11 Click device identification object. More...
 

Macros

#define COLOR11_REG_RAM_START   0x00
 Color 11 description register.
 
#define COLOR11_REG_ENABLE   0x80
 
#define COLOR11_REG_ATIME   0x81
 
#define COLOR11_REG_PTIME   0x82
 
#define COLOR11_REG_WTIME   0x83
 
#define COLOR11_REG_AILTL   0x84
 
#define COLOR11_REG_AILTH   0x85
 
#define COLOR11_REG_AIHTL   0x86
 
#define COLOR11_REG_AIHTH   0x87
 
#define COLOR11_REG_AUXID   0x90
 
#define COLOR11_REG_REVID   0x91
 
#define COLOR11_REG_ID   0x92
 
#define COLOR11_REG_STATUS   0x93
 
#define COLOR11_REG_ASTATUS   0x94
 
#define COLOR11_REG_ADATAL0   0x95
 
#define COLOR11_REG_ADATAH0   0x96
 
#define COLOR11_REG_ADATAL1   0x97
 
#define COLOR11_REG_ADATAH1   0x98
 
#define COLOR11_REG_ADATAL2   0x99
 
#define COLOR11_REG_ADATAH2   0x9A
 
#define COLOR11_REG_ADATAL3   0x9B
 
#define COLOR11_REG_ADATAH3   0x9C
 
#define COLOR11_REG_ADATAL4   0x9D
 
#define COLOR11_REG_ADATAH4   0x9E
 
#define COLOR11_REG_ADATAL5   0x9F
 
#define COLOR11_REG_ADATAH5   0xA0
 
#define COLOR11_REG_STATUS2   0xA3
 
#define COLOR11_REG_STATUS3   0xA4
 
#define COLOR11_REG_STATUS5   0xA6
 
#define COLOR11_REG_STATUS6   0xA7
 
#define COLOR11_REG_CFG0   0xA9
 
#define COLOR11_REG_CFG1   0xAA
 
#define COLOR11_REG_CFG3   0xAC
 
#define COLOR11_REG_CFG4   0xAD
 
#define COLOR11_REG_CFG6   0xAF
 
#define COLOR11_REG_CFG8   0xB1
 
#define COLOR11_REG_CFG9   0xB2
 
#define COLOR11_REG_CFG10   0xB3
 
#define COLOR11_REG_CFG11   0xB4
 
#define COLOR11_REG_CFG12   0xB5
 
#define COLOR11_REG_PERS   0xBD
 
#define COLOR11_REG_POFFSETH   0xC8
 
#define COLOR11_REG_ASTEPL   0xCA
 
#define COLOR11_REG_ASTEPH   0xCB
 
#define COLOR11_REG_AGC_GAIN_MAX   0xCF
 
#define COLOR11_REG_AZCONFIG   0xD6
 
#define COLOR11_REG_FD_STATUS   0xDB
 
#define COLOR11_REG_INTENAB   0xF9
 
#define COLOR11_REG_CONTROL   0xFA
 
#define COLOR11_ID_AUX   0x4A
 Color 11 identification data values.
 
#define COLOR11_ID_REV   0x53
 
#define COLOR11_ID_DEV   0x18
 
#define COLOR11_ALS_INTEG_TIME_DEFAULT   19000
 Color 11 ALS default configuration values.
 
#define COLOR11_ALS_STEP_DEFAULT   2780
 
#define COLOR11_ALS_THOLD_LOW_DEFAULT   0x0000u
 
#define COLOR11_ALS_THOLD_HIGH_DEFAULT   0xFFFFu
 
#define COLOR11_SET_INTENAB_ASI_DIS   0x00
 Color 11 interrupt enable bit mask values.
 
#define COLOR11_SET_INTENAB_ASI_EN   0x80
 
#define COLOR11_SET_INTENAB_AI_DIS   0x00
 
#define COLOR11_SET_INTENAB_AI_EN   0x08
 
#define COLOR11_SET_INTENAB_SI_DIS   0x00
 
#define COLOR11_SET_INTENAB_SI_EN   0x01
 
#define COLOR11_STATUS2_AVALID   0x40
 Color 11 valid status bit mask.
 
#define COLOR11_STATUS2_ASAT_DIGITAL   0x10
 
#define COLOR11_STATUS2_ASAT_ANALOG   0x08
 
#define COLOR11_STATUS2_FDSAT_ANALOG   0x02
 
#define COLOR11_STATUS2_FDSAT_DIGITAL   0x01
 
#define COLOR11_ALS_STEP_CONV_TO_US   100
 Color 11 step calculation values.
 
#define COLOR11_ALS_STEP_MIN_ASTEP   278
 
#define COLOR11_ALS_STEP_COR_FACT   50
 
#define COLOR11_COEF_SCALE_DEFAULT   1000.0f
 Color 11 default coefficient values.
 
#define COLOR11_COEF_DGF_DEFAULT   898.0f
 
#define COLOR11_COEF_CLR_DEFAULT   210.0f
 
#define COLOR11_COEF_RED_DEFAULT   -60.0f
 
#define COLOR11_COEF_GREEN_DEFAULT   10.0f
 
#define COLOR11_COEF_BLUE_DEFAULT   -290.0f
 
#define COLOR11_DEVICE_ADDRESS   0x39
 Color 11 device address setting.
 
#define COLOR11_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  color11_return_value_t { COLOR11_OK = 0 , COLOR11_ERROR = -1 }
 Color 11 Click return value data. More...
 
enum  color11_pwr_ctrl_t { COLOR11_DISABLE = 0 , COLOR11_ENABLE }
 Color 11 Click power, enable, and operation value data. More...
 
enum  color11_again_t {
  COLOR11_AGAIN_X0_5 = 0 , COLOR11_AGAIN_X1 , COLOR11_AGAIN_X2 , COLOR11_AGAIN_X4 ,
  COLOR11_AGAIN_X8 , COLOR11_AGAIN_X16 , COLOR11_AGAIN_X32 , COLOR11_AGAIN_X64 ,
  COLOR11_AGAIN_X128 , COLOR11_AGAIN_X256 , COLOR11_AGAIN_X512 , COLOR11_AGAIN_X1024 ,
  COLOR11_AGAIN_X2048
}
 Color 11 Click ALS Gain value data. More...
 

Functions

void color11_cfg_setup (color11_cfg_t *cfg)
 Color 11 configuration object setup function.
 
err_t color11_init (color11_t *ctx, color11_cfg_t *cfg)
 Color 11 initialization function.
 
err_t color11_default_cfg (color11_t *ctx)
 Color 11 default configuration function.
 
err_t color11_generic_write (color11_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Color 11 I2C writing function.
 
err_t color11_generic_read (color11_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Color 11 I2C reading function.
 
err_t color11_get_identification (color11_t *ctx, color11_identification_t *id)
 Color 11 get identification function.
 
err_t color11_set_als_thold (color11_t *ctx, uint16_t l_thold, uint16_t h_thold)
 Color 11 set ALS interrupt threshold function.
 
err_t color11_set_power_ctrl (color11_t *ctx, color11_pwr_ctrl_t pwr, color11_pwr_ctrl_t aen, color11_pwr_ctrl_t wen, color11_pwr_ctrl_t fden)
 Color 11 set power control function.
 
err_t color11_set_als_step (color11_t *ctx, uint32_t als_step)
 Color 11 set ALS step function.
 
err_t color11_get_als_step (color11_t *ctx, uint32_t *als_step)
 Color 11 get ALS step function.
 
err_t color11_set_als_wait (color11_t *ctx, uint8_t wait_time)
 Color 11 set ALS wait time function.
 
err_t color11_set_als_time (color11_t *ctx, uint32_t als_time)
 Color 11 set ALS integration time function.
 
err_t color11_get_als_time (color11_t *ctx, float *als_time)
 Color 11 get ALS integration time function.
 
err_t color11_set_gain (color11_t *ctx, color11_again_t gain)
 Color 11 set gain function.
 
err_t color11_get_gain (color11_t *ctx, uint8_t *gain)
 Color 11 get gain function.
 
err_t color11_set_interrupt (color11_t *ctx, uint8_t intenab)
 Color 11 set interrupt function.
 
err_t color11_get_data_valid_status (color11_t *ctx, uint8_t *status)
 Color 11 get data valid status function.
 
err_t color11_get_als_data (color11_t *ctx, color11_als_data_t *als_data)
 Color 11 get ALS data function.
 
err_t color11_get_ir (color11_t *ctx, float *ir)
 Color 11 get IR data function.
 
err_t color11_get_illuminance (color11_t *ctx, float *lux)
 Color 11 get illuminance function.
 
uint8_t color11_get_interrupt (color11_t *ctx)
 Color 11 get interrupt function.
 

Detailed Description

This file contains API for Color 11 Click Driver.

Enumeration Type Documentation

◆ color11_again_t

Color 11 Click ALS Gain value data.

Predefined enum values for ALS Gain.

Enumerator
COLOR11_AGAIN_X0_5 
COLOR11_AGAIN_X1 
COLOR11_AGAIN_X2 
COLOR11_AGAIN_X4 
COLOR11_AGAIN_X8 
COLOR11_AGAIN_X16 
COLOR11_AGAIN_X32 
COLOR11_AGAIN_X64 
COLOR11_AGAIN_X128 
COLOR11_AGAIN_X256 
COLOR11_AGAIN_X512 
COLOR11_AGAIN_X1024 
COLOR11_AGAIN_X2048 

◆ color11_pwr_ctrl_t

Color 11 Click power, enable, and operation value data.

Predefined enum values for power, enable, and operation values.

Enumerator
COLOR11_DISABLE 
COLOR11_ENABLE 

◆ color11_return_value_t

Color 11 Click return value data.

Predefined enum values for driver return values.

Enumerator
COLOR11_OK 
COLOR11_ERROR