color18  2.1.0.0
Data Structures | Macros | Enumerations | Functions
color18.h File Reference

This file contains API for Color 18 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  color18_data_t
 Color 18 Click data object. More...
 
struct  color18_t
 Color 18 Click context object. More...
 
struct  color18_cfg_t
 Color 18 Click configuration object. More...
 

Macros

#define COLOR18_REG_CONTROL_SCL   0x24
 Color 18 register list. More...
 
#define COLOR18_REG_MOD_OFFSET0_LSB   0x40
 
#define COLOR18_REG_MOD_OFFSET0_MSB   0x41
 
#define COLOR18_REG_MOD_OFFSET1_LSB   0x42
 
#define COLOR18_REG_MOD_OFFSET1_MSB   0x43
 
#define COLOR18_REG_MOD_OFFSET2_LSB   0x44
 
#define COLOR18_REG_MOD_OFFSET2_MSB   0x45
 
#define COLOR18_REG_MOD_OFFSET3_LSB   0x46
 
#define COLOR18_REG_MOD_OFFSET3_MSB   0x47
 
#define COLOR18_REG_MOD_OFFSET4_LSB   0x48
 
#define COLOR18_REG_MOD_OFFSET4_MSB   0x49
 
#define COLOR18_REG_MOD_OFFSET5_LSB   0x4A
 
#define COLOR18_REG_MOD_OFFSET5_MSB   0x4B
 
#define COLOR18_REG_MOD_OFFSET6_LSB   0x4C
 
#define COLOR18_REG_MOD_OFFSET6_MSB   0x4D
 
#define COLOR18_REG_MOD_OFFSET7_LSB   0x4E
 
#define COLOR18_REG_MOD_OFFSET7_MSB   0x4F
 
#define COLOR18_REG_OSCEN   0x7F
 
#define COLOR18_REG_ENABLE   0x80
 
#define COLOR18_REG_MEAS_MODE0   0x81
 
#define COLOR18_REG_MEAS_MODE1   0x82
 
#define COLOR18_REG_SAMPLE_TIME0   0x83
 
#define COLOR18_REG_SAMPLE_TIME1   0x84
 
#define COLOR18_REG_SAMPLE_TIME_ALTERNATIVE0   0x85
 
#define COLOR18_REG_SAMPLE_TIME_ALTERNATIVE1   0x86
 
#define COLOR18_REG_ALS_NR_SAMPLES0   0x87
 
#define COLOR18_REG_ALS_NR_SAMPLES1   0x88
 
#define COLOR18_REG_ALS_NR_SAMPLES_ALTERNATIVE0   0x89
 
#define COLOR18_REG_ALS_NR_SAMPLES_ALTERNATIVE1   0x8A
 
#define COLOR18_REG_FD_NR_SAMPLES0   0x8B
 
#define COLOR18_REG_FD_NR_SAMPLES1   0x8C
 
#define COLOR18_REG_FD_NR_SAMPLES_ALTERNATIVE0   0x8D
 
#define COLOR18_REG_FD_NR_SAMPLES_ALTERNATIVE1   0x8E
 
#define COLOR18_REG_WTIME   0x8F
 
#define COLOR18_REG_AUX_ID   0x90
 
#define COLOR18_REG_REV_ID   0x91
 
#define COLOR18_REG_ID   0x92
 
#define COLOR18_REG_AILT0   0x93
 
#define COLOR18_REG_AILT1   0x94
 
#define COLOR18_REG_AILT2   0x95
 
#define COLOR18_REG_AIHT0   0x96
 
#define COLOR18_REG_AIHT1   0x97
 
#define COLOR18_REG_AIHT2   0x98
 
#define COLOR18_REG_AGC_NR_SAMPLES0   0x99
 
#define COLOR18_REG_AGC_NR_SAMPLES1   0x9A
 
#define COLOR18_REG_STATUS   0x9B
 
#define COLOR18_REG_STATUS2   0x9C
 
#define COLOR18_REG_STATUS3   0x9D
 
#define COLOR18_REG_STATUS4   0x9E
 
#define COLOR18_REG_STATUS5   0x9F
 
#define COLOR18_REG_STATUS6   0xA0
 
#define COLOR18_REG_CFG0   0xA1
 
#define COLOR18_REG_CFG1   0xA2
 
#define COLOR18_REG_CFG2   0xA3
 
#define COLOR18_REG_CFG3   0xA4
 
#define COLOR18_REG_CFG4   0xA5
 
#define COLOR18_REG_CFG5   0xA6
 
#define COLOR18_REG_CFG6   0xA7
 
#define COLOR18_REG_CFG7   0xA8
 
#define COLOR18_REG_CFG8   0xA9
 
#define COLOR18_REG_CFG9   0xAA
 
#define COLOR18_REG_MOD_CHANNEL_CTRL   0xAB
 
#define COLOR18_REG_TRIGGER_MODE   0xAD
 
#define COLOR18_REG_OSC_TUNE   0xAE
 
#define COLOR18_REG_VSYNC_GPIO_INT   0xB0
 
#define COLOR18_REG_INTENAB   0xBA
 
#define COLOR18_REG_SIEN   0xBB
 
#define COLOR18_REG_CONTROL   0xBC
 
#define COLOR18_REG_ALS_DATA_STATUS   0xBD
 
#define COLOR18_REG_ALS_DATA_FIRST   0xBE
 
#define COLOR18_REG_ALS_DATA   0xBF
 
#define COLOR18_REG_MEAS_SEQR_STEP0_MOD_GAINX_0   0xC0
 
#define COLOR18_REG_MEAS_SEQR_STEP0_MOD_GAINX_1   0xC1
 
#define COLOR18_REG_MEAS_SEQR_STEP0_MOD_GAINX_2   0xC2
 
#define COLOR18_REG_MEAS_SEQR_STEP0_MOD_GAINX_3   0xC3
 
#define COLOR18_REG_MEAS_SEQR_STEP1_MOD_GAINX_0   0xC4
 
#define COLOR18_REG_MEAS_SEQR_STEP1_MOD_GAINX_1   0xC5
 
#define COLOR18_REG_MEAS_SEQR_STEP1_MOD_GAINX_2   0xC6
 
#define COLOR18_REG_MEAS_SEQR_STEP1_MOD_GAINX_3   0xC7
 
#define COLOR18_REG_MEAS_SEQR_STEP2_MOD_GAINX_0   0xC8
 
#define COLOR18_REG_MEAS_SEQR_STEP2_MOD_GAINX_1   0xC9
 
#define COLOR18_REG_MEAS_SEQR_STEP2_MOD_GAINX_2   0xCA
 
#define COLOR18_REG_MEAS_SEQR_STEP2_MOD_GAINX_3   0xCB
 
#define COLOR18_REG_MEAS_SEQR_STEP3_MOD_GAINX_0   0xCC
 
#define COLOR18_REG_MEAS_SEQR_STEP3_MOD_GAINX_1   0xCD
 
#define COLOR18_REG_MEAS_SEQR_STEP3_MOD_GAINX_2   0xCE
 
#define COLOR18_REG_MEAS_SEQR_STEP3_MOD_GAINX_3   0xCF
 
#define COLOR18_REG_MEAS_SEQR_STEP0_FD   0xD0
 
#define COLOR18_REG_MEAS_SEQR_STEP1_FD   0xD1
 
#define COLOR18_REG_MEAS_SEQR_STEP2_FD   0xD2
 
#define COLOR18_REG_MEAS_SEQR_STEP3_FD   0xD3
 
#define COLOR18_REG_MEAS_SEQR_STEP0_RESIDUAL   0xD4
 
#define COLOR18_REG_MEAS_SEQR_STEP1_RESIDUAL   0xD5
 
#define COLOR18_REG_MEAS_SEQR_STEP2_RESIDUAL   0xD6
 
#define COLOR18_REG_MEAS_SEQR_STEP3_RESIDUAL   0xD7
 
#define COLOR18_REG_MEAS_SEQR_STEP0_ALS   0xD8
 
#define COLOR18_REG_MEAS_SEQR_STEP1_ALS   0xD9
 
#define COLOR18_REG_MEAS_SEQR_STEP2_ALS   0xDA
 
#define COLOR18_REG_MEAS_SEQR_STEP3_ALS   0xDB
 
#define COLOR18_REG_MEAS_SEQR_APERS_AND_VSYNC_WAIT   0xDC
 
#define COLOR18_REG_MEAS_SEQR_AGC   0xDD
 
#define COLOR18_REG_MEAS_SEQR_SMUX_AND_SAMPLE_TIME   0xDE
 
#define COLOR18_REG_MEAS_SEQR_WAIT_AND_TS_ENABLE   0xDF
 
#define COLOR18_REG_MOD_CALIB_CFG0   0xE0
 
#define COLOR18_REG_MOD_CALIB_CFG2   0xE2
 
#define COLOR18_REG_MOD_CALIB_CFG3   0xE3
 
#define COLOR18_REG_MOD_COMP_CFG2   0xE7
 
#define COLOR18_REG_MOD_RESIDUAL_CFG0   0xE8
 
#define COLOR18_REG_MOD_RESIDUAL_CFG1   0xE9
 
#define COLOR18_REG_MOD_RESIDUAL_CFG2   0xEA
 
#define COLOR18_REG_VSYNC_DELAY_CFG0   0xEB
 
#define COLOR18_REG_VSYNC_DELAY_CFG1   0xEC
 
#define COLOR18_REG_VSYNC_PERIOD0   0xED
 
#define COLOR18_REG_VSYNC_PERIOD1   0xEE
 
#define COLOR18_REG_VSYNC_PERIOD_TARGET0   0xEF
 
#define COLOR18_REG_VSYNC_PERIOD_TARGET1   0xF0
 
#define COLOR18_REG_VSYNC_CONTROL   0xF1
 
#define COLOR18_REG_VSYNC_CFG   0xF2
 
#define COLOR18_REG_FIFO_THR   0xF3
 
#define COLOR18_REG_MOD_FIFO_DATA_CFG0   0xF4
 
#define COLOR18_REG_MOD_FIFO_DATA_CFG1   0xF5
 
#define COLOR18_REG_MOD_FIFO_DATA_CFG2   0xF6
 
#define COLOR18_REG_MOD_FIFO_DATA_CFG3   0xF7
 
#define COLOR18_REG_MOD_FIFO_DATA_CFG4   0xF8
 
#define COLOR18_REG_MOD_FIFO_DATA_CFG5   0xF9
 
#define COLOR18_REG_MOD_FIFO_DATA_CFG6   0xFA
 
#define COLOR18_REG_MOD_FIFO_DATA_CFG7   0xFB
 
#define COLOR18_REG_FIFO_STATUS0   0xFC
 
#define COLOR18_REG_FIFO_STATUS1   0xFD
 
#define COLOR18_REG_FIFO_DATA_PROTOCOL   0xFE
 
#define COLOR18_REG_FIFO_DATA   0xFF
 
#define COLOR18_CONTROL_SCL_SOFT_RESET   0x01
 Color 18 CONTROL_SCL register setting. More...
 
#define COLOR18_OSCEN_PON_INIT   0x04
 Color 18 OSCEN register setting. More...
 
#define COLOR18_OSCEN_OSCEN_STATUS   0x02
 
#define COLOR18_OSCEN_OSCEN   0x01
 
#define COLOR18_ENABLE_FDEN   0x40
 Color 18 ENABLE register setting. More...
 
#define COLOR18_ENABLE_AEN   0x02
 
#define COLOR18_ENABLE_PON   0x01
 
#define COLOR18_WTIME_DEFAULT   0x46
 Color 18 WTIME register setting. More...
 
#define COLOR18_TRIGGER_MODE_OFF   0x00
 Color 18 TRIGGER_MODE register setting. More...
 
#define COLOR18_TRIGGER_MODE_NORMAL   0x01
 
#define COLOR18_TRIGGER_MODE_LONG   0x02
 
#define COLOR18_TRIGGER_MODE_FAST   0x03
 
#define COLOR18_TRIGGER_MODE_FASTLONG   0x04
 
#define COLOR18_TRIGGER_MODE_VSYNC   0x05
 
#define COLOR18_TRIGGER_MODE_MASK   0x07
 
#define COLOR18_INTENAB_MIEN   0x80
 Color 18 INTENAB register setting. More...
 
#define COLOR18_INTENAB_AIEN   0x08
 
#define COLOR18_INTENAB_FIEN   0x04
 
#define COLOR18_INTENAB_SIEN   0x01
 
#define COLOR18_FIFO_THR_DEFAULT   15
 Color 18 FIFO interrupt threshold setting. More...
 
#define COLOR18_CONTROL_FIFO_CLR   0x02
 Color 18 CONTROL register setting. More...
 
#define COLOR18_CONTROL_CLEAR_SAI_ACTIVE   0x01
 
#define COLOR18_DEVICE_ID   0x68
 Color 18 device ID value. More...
 
#define COLOR18_DEVICE_ADDRESS   0x39
 Color 18 device address setting. More...
 
#define COLOR18_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

Enumerations

enum  color18_return_value_t { COLOR18_OK = 0, COLOR18_ERROR = -1 }
 Color 18 Click return value data. More...
 

Functions

void color18_cfg_setup (color18_cfg_t *cfg)
 Color 18 configuration object setup function. More...
 
err_t color18_init (color18_t *ctx, color18_cfg_t *cfg)
 Color 18 initialization function. More...
 
err_t color18_default_cfg (color18_t *ctx)
 Color 18 default configuration function. More...
 
err_t color18_write_regs (color18_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Color 18 write regs function. More...
 
err_t color18_read_regs (color18_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Color 18 read regs function. More...
 
err_t color18_write_reg (color18_t *ctx, uint8_t reg, uint8_t data_in)
 Color 18 write reg function. More...
 
err_t color18_read_reg (color18_t *ctx, uint8_t reg, uint8_t *data_out)
 Color 18 read reg function. More...
 
err_t color18_write_reg_word (color18_t *ctx, uint8_t reg, uint16_t data_in)
 Color 18 write reg word function. More...
 
err_t color18_read_reg_word (color18_t *ctx, uint8_t reg, uint16_t *data_out)
 Color 18 read reg word function. More...
 
err_t color18_check_communication (color18_t *ctx)
 Color 18 check communication function. More...
 
void color18_set_vsync_pin (color18_t *ctx, uint8_t state)
 Color 18 set vsync pin state function. More...
 
uint8_t color18_get_int_pin (color18_t *ctx)
 Color 18 get int pin state function. More...
 
err_t color18_soft_reset (color18_t *ctx)
 Color 18 soft reset function. More...
 
err_t color18_clear_fifo (color18_t *ctx)
 Color 18 clear fifo function. More...
 
err_t color18_read_fifo_size (color18_t *ctx, uint16_t *fifo_size)
 Color 18 read fifo size function. More...
 
err_t color18_read_data (color18_t *ctx, color18_data_t *data_out)
 Color 18 read data function. More...
 

Detailed Description

This file contains API for Color 18 Click Driver.

Enumeration Type Documentation

◆ color18_return_value_t

Color 18 Click return value data.

Predefined enum values for driver return values.

Enumerator
COLOR18_OK 
COLOR18_ERROR