color14 2.0.0.0
color14.h File Reference

This file contains API for Color 14 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  color14_t
 Color 14 Click context object. More...
 
struct  color14_cfg_t
 Color 14 Click configuration object. More...
 
struct  color14_color_t
 Color 14 color data object. More...
 

Macros

#define COLOR14_REG_MAIN_CTRL   0x00
 Color 14 description register.
 
#define COLOR14_REG_PS_VCSEL   0x01
 
#define COLOR14_REG_PS_PULSES   0x02
 
#define COLOR14_REG_PS_MEASRATE   0x03
 
#define COLOR14_REG_LS_MEAS_RATE   0x04
 
#define COLOR14_REG_LS_GAIN   0x05
 
#define COLOR14_REG_PART_ID   0x06
 
#define COLOR14_REG_MAIN_STATUS   0x07
 
#define COLOR14_REG_PS_DATA_0   0x08
 
#define COLOR14_REG_PS_DATA_1   0x09
 
#define COLOR14_REG_LS_DATA_IR_0   0x0A
 
#define COLOR14_REG_LS_DATA_IR_1   0x0B
 
#define COLOR14_REG_LS_DATA_IR_2   0x0C
 
#define COLOR14_REG_LS_DATA_GREEN_0   0x0D
 
#define COLOR14_REG_LS_DATA_GREEN_1   0x0E
 
#define COLOR14_REG_LS_DATA_GREEN_2   0x0F
 
#define COLOR14_REG_LS_DATA_BLUE_0   0x10
 
#define COLOR14_REG_LS_DATA_BLUE_1   0x11
 
#define COLOR14_REG_LS_DATA_BLUE_2   0x12
 
#define COLOR14_REG_LS_DATA_RED_0   0x13
 
#define COLOR14_REG_LS_DATA_RED_1   0x14
 
#define COLOR14_REG_LS_DATA_RED_2   0x15
 
#define COLOR14_REG_INT_CFG   0x19
 
#define COLOR14_REG_INT_PST   0x1A
 
#define COLOR14_REG_PS_THRES_UP_0   0x1B
 
#define COLOR14_REG_PS_THRES_UP_1   0x1C
 
#define COLOR14_REG_PS_THRES_LOW_0   0x1D
 
#define COLOR14_REG_PS_THRES_LOW_1   0x1E
 
#define COLOR14_REG_PS_CAN_0   0x1F
 
#define COLOR14_REG_PS_CAN_1_ANA   0x20
 
#define COLOR14_REG_LS_THRES_UP_0   0x21
 
#define COLOR14_REG_LS_THRES_UP_1   0x22
 
#define COLOR14_REG_LS_THRES_UP_2   0x23
 
#define COLOR14_REG_LS_THRES_LOW_0   0x24
 
#define COLOR14_REG_LS_THRES_LOW_1   0x25
 
#define COLOR14_REG_LS_THRES_LOW_2   0x26
 
#define COLOR14_REG_LS_THRES_VAR   0x27
 
#define COLOR14_ID   0xC2
 Color 14 device ID data.
 
#define COLOR14_SET_DEV_ADDR   0x52
 Color 14 device address setting.
 
#define COLOR14_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  color14_return_value_t {
  COLOR14_OK = 0 , COLOR14_ERROR = -1 , COLOR14_ERROR_OVF = -2 , COLOR14_ERROR_PARAM = -3 ,
  COLOR14_ERROR_CFG = -4
}
 Color 14 Click return value data. More...
 

Functions

void color14_cfg_setup (color14_cfg_t *cfg)
 Color 14 configuration object setup function.
 
err_t color14_init (color14_t *ctx, color14_cfg_t *cfg)
 Color 14 initialization function.
 
err_t color14_generic_write (color14_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Color 14 I2C writing function.
 
err_t color14_generic_read (color14_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Color 14 I2C reading function.
 
uint8_t color14_get_int (color14_t *ctx)
 Get interrupt pin state.
 
err_t color14_get_proximity (color14_t *ctx, uint16_t *ps_data)
 Read proximity data from device.
 
err_t color14_get_als (color14_t *ctx, float *als_data)
 Read lux data from device.
 
err_t color14_ls_color (color14_t *ctx, uint8_t ls_reg, uint32_t *ls_data)
 Read ls data from color registers.
 
err_t color14_get_rgb_ir (color14_t *ctx, color14_color_t *color_data)
 Read color data from device.
 
float color14_get_als_resolution (color14_t *ctx)
 Get resolution for the lux calculation.
 

Detailed Description

This file contains API for Color 14 Click Driver.

Enumeration Type Documentation

◆ color14_return_value_t

Color 14 Click return value data.

Predefined enum values for driver return values.

Enumerator
COLOR14_OK 
COLOR14_ERROR 
COLOR14_ERROR_OVF 
COLOR14_ERROR_PARAM 
COLOR14_ERROR_CFG