color13 2.0.0.0
color13.h File Reference

This file contains API for Color 13 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  color13_t
 Color 13 Click context object. More...
 
struct  color13_cfg_t
 Color 13 Click configuration object. More...
 
struct  color13_color_t
 Color 13 color data object. More...
 

Macros

#define COLOR13_REG_MAIN_CTRL   0x00
 Color 13 description register.
 
#define COLOR13_REG_PS_VCSEL   0x01
 
#define COLOR13_REG_PS_PULSES   0x02
 
#define COLOR13_REG_PS_MEASRATE   0x03
 
#define COLOR13_REG_LS_MEAS_RATE   0x04
 
#define COLOR13_REG_LS_GAIN   0x05
 
#define COLOR13_REG_PART_ID   0x06
 
#define COLOR13_REG_MAIN_STATUS   0x07
 
#define COLOR13_REG_PS_DATA_0   0x08
 
#define COLOR13_REG_PS_DATA_1   0x09
 
#define COLOR13_REG_LS_DATA_IR_0   0x0A
 
#define COLOR13_REG_LS_DATA_IR_1   0x0B
 
#define COLOR13_REG_LS_DATA_IR_2   0x0C
 
#define COLOR13_REG_LS_DATA_GREEN_0   0x0D
 
#define COLOR13_REG_LS_DATA_GREEN_1   0x0E
 
#define COLOR13_REG_LS_DATA_GREEN_2   0x0F
 
#define COLOR13_REG_LS_DATA_BLUE_0   0x10
 
#define COLOR13_REG_LS_DATA_BLUE_1   0x11
 
#define COLOR13_REG_LS_DATA_BLUE_2   0x12
 
#define COLOR13_REG_LS_DATA_RED_0   0x13
 
#define COLOR13_REG_LS_DATA_RED_1   0x14
 
#define COLOR13_REG_LS_DATA_RED_2   0x15
 
#define COLOR13_REG_INT_CFG   0x19
 
#define COLOR13_REG_INT_PST   0x1A
 
#define COLOR13_REG_PS_THRES_UP_0   0x1B
 
#define COLOR13_REG_PS_THRES_UP_1   0x1C
 
#define COLOR13_REG_PS_THRES_LOW_0   0x1D
 
#define COLOR13_REG_PS_THRES_LOW_1   0x1E
 
#define COLOR13_REG_PS_CAN_0   0x1F
 
#define COLOR13_REG_PS_CAN_1_ANA   0x20
 
#define COLOR13_REG_LS_THRES_UP_0   0x21
 
#define COLOR13_REG_LS_THRES_UP_1   0x22
 
#define COLOR13_REG_LS_THRES_UP_2   0x23
 
#define COLOR13_REG_LS_THRES_LOW_0   0x24
 
#define COLOR13_REG_LS_THRES_LOW_1   0x25
 
#define COLOR13_REG_LS_THRES_LOW_2   0x26
 
#define COLOR13_REG_LS_THRES_VAR   0x27
 
#define COLOR13_ID   0xC2
 Color 13 device ID data.
 
#define COLOR13_SET_DEV_ADDR   0x52
 Color 13 device address setting.
 
#define COLOR13_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  color13_return_value_t {
  COLOR13_OK = 0 , COLOR13_ERROR = -1 , COLOR13_ERROR_OVF = -2 , COLOR13_ERROR_PARAM = -3 ,
  COLOR13_ERROR_CFG = -4
}
 Color 13 Click return value data. More...
 

Functions

void color13_cfg_setup (color13_cfg_t *cfg)
 Color 13 configuration object setup function.
 
err_t color13_init (color13_t *ctx, color13_cfg_t *cfg)
 Color 13 initialization function.
 
err_t color13_generic_write (color13_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Color 13 I2C writing function.
 
err_t color13_generic_read (color13_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Color 13 I2C reading function.
 
uint8_t color13_get_int (color13_t *ctx)
 Get interrupt pin state.
 
err_t color13_get_proximity (color13_t *ctx, uint16_t *ps_data)
 Read proximity data from device.
 
err_t color13_get_als (color13_t *ctx, float *als_data)
 Read lux data from device.
 
err_t color13_ls_color (color13_t *ctx, uint8_t ls_reg, uint32_t *ls_data)
 Read ls data from color registers.
 
err_t color13_get_rgb_ir (color13_t *ctx, color13_color_t *color_data)
 Read color data from device.
 
float color13_get_als_resolution (color13_t *ctx)
 Get resolution for the lux calculation.
 

Detailed Description

This file contains API for Color 13 Click Driver.

Enumeration Type Documentation

◆ color13_return_value_t

Color 13 Click return value data.

Predefined enum values for driver return values.

Enumerator
COLOR13_OK 
COLOR13_ERROR 
COLOR13_ERROR_OVF 
COLOR13_ERROR_PARAM 
COLOR13_ERROR_CFG