color8 2.0.0.0
color8.h File Reference

This file contains API for Color 8 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  color8_t
 Click ctx object definition. More...
 
struct  color8_cfg_t
 Click configuration structure definition. More...
 

Macros

#define COLOR8_MAP_MIKROBUS(cfg, mikrobus)
 
#define COLOR8_RETVAL   uint8_t
 
#define COLOR8_OK   0x00
 
#define COLOR8_INIT_ERROR   0xFF
 
#define COLOR8_REG_SYSTEM_CONTROL   0x40
 
#define COLOR8_REG_MODE_CONTROL_1   0x41
 
#define COLOR8_REG_MODE_CONTROL_2   0x42
 
#define COLOR8_REG_RED_DATA   0x50
 
#define COLOR8_REG_RED_DATA_LSB   0x50
 
#define COLOR8_REG_RED_DATA_MSB   0x51
 
#define COLOR8_REG_GREEN_DATA   0x52
 
#define COLOR8_REG_GREEN_DATA_LSB   0x52
 
#define COLOR8_REG_GREEN_DATA_MSB   0x53
 
#define COLOR8_REG_BLUE_DATA   0x54
 
#define COLOR8_REG_BLUE_DATA_LSB   0x54
 
#define COLOR8_REG_BLUE_DATA_MSB   0x55
 
#define COLOR8_REG_IR_DATA   0x58
 
#define COLOR8_REG_IR_DATA_LSB   0x58
 
#define COLOR8_REG_IR_DATA_MSB   0x59
 
#define COLOR8_REG_GREEN_DATA_2   0x5A
 
#define COLOR8_REG_GREEN_DATA_2_LSB   0x5A
 
#define COLOR8_REG_GREEN_DATA_2_MSB   0x5B
 
#define COLOR8_REG_INTERRUPT   0x60
 
#define COLOR8_REG_PERSISTENCE   0x61
 
#define COLOR8_REG_THRESHOLD_HIGH_LSB   0x62
 
#define COLOR8_REG_THRESHOLD_HIGH_MSB   0x63
 
#define COLOR8_REG_THRESHOLD_LOW_LSB   0x64
 
#define COLOR8_REG_THRESHOLD_LOW_MSB   0x65
 
#define COLOR8_REG_MANUFACTURER_ID   0x92
 
#define COLOR8_SS_SW_RESET_IS_NOT_DONE   0x00
 
#define COLOR8_SS_SW_RESET_IS_DONE   0x80
 
#define COLOR8_SS_INT_PIN_IS_NOT_ACTIVE   0x00
 
#define COLOR8_SS_INT_PIN_IS_ACTIVE   0x40
 
#define COLOR8_MC1_IR_DATA_GAIN_X1   0x20
 
#define COLOR8_MC1_IR_DATA_GAIN_X32   0x60
 
#define COLOR8_MC1_RGB_DATA_GAIN_X1   0x08
 
#define COLOR8_MC1_RGB_DATA_GAIN_X32   0x18
 
#define COLOR8_MC1_MEASURE_MODE_120ms   0x02
 
#define COLOR8_MC1_MEASURE_MODE_240ms   0x03
 
#define COLOR8_MC1_MEASURE_MODE_35ms   0x05
 
#define COLOR8_MC2_MEASUREMENT_IS_ACTIVE   0x10
 
#define COLOR8_MC2_MEASUREMENT_IS_INACTIVE   0x00
 
#define COLOR8_INT_INTERRUPT_SIGNAL_IS_ACTIVE   0x80
 
#define COLOR8_INT_RED_CHANNEL   0x00
 
#define COLOR8_INT_GREEN_CHANNEL   0x02
 
#define COLOR8_INT_BLUE_CHANNEL   0x04
 
#define COLOR8_INT_PIN_DISABLE   0x00
 
#define COLOR8_INT_PIN_ENABLE   0x01
 
#define COLOR8_PERSISTENCE_INT_SETTINGS_0   0x00
 
#define COLOR8_PERSISTENCE_INT_SETTINGS_1   0x01
 
#define COLOR8_PERSISTENCE_INT_SETTINGS_2   0x02
 
#define COLOR8_PERSISTENCE_INT_SETTINGS_3   0x03
 
#define COLOR8_DEF_MANUFACTURER_ID   0xE0
 
#define COLOR8_DEF_PART_ID   0x0D
 
#define COLOR8_DEF_SLAVE_ADDRESS_0   0x38
 
#define COLOR8_DEF_SLAVE_ADDRESS_1   0x39
 
#define ORANGE_COLOR_FLAG   1
 
#define RED_COLOR_FLAG   2
 
#define PINK_COLOR_FLAG   3
 
#define PURPLE_COLOR_FLAG   4
 
#define BLUE_COLOR_FLAG   5
 
#define CYAN_COLOR_FLAG   6
 
#define GREEN_COLOR_FLAG   7
 
#define YELLOW_COLOR_FLAG   8
 
#define NON_COLOR_FLAG   0
 

Functions

void color8_cfg_setup (color8_cfg_t *cfg)
 Config Object Initialization function.
 
COLOR8_RETVAL color8_init (color8_t *ctx, color8_cfg_t *cfg)
 Initialization function.
 
void color8_generic_write (color8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void color8_generic_read (color8_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void color8_write_byte (color8_t *ctx, uint8_t reg, uint8_t w_data)
 Functions for write one byte in register.
 
uint8_t color8_read_byte (color8_t *ctx, uint8_t reg)
 Functions for read one byte data from register.
 
uint8_t color8_get_interrupt (color8_t *ctx)
 Functions get interrupt.
 
uint16_t color8_read_data (color8_t *ctx, uint8_t reg_data)
 Functions for read data from register.
 
float color8_get_color_value (color8_t *ctx)
 Functions for read color value.
 
uint8_t color8_get_color (color8_t *ctx, float color_value)
 Functions for detect colors.
 

Detailed Description

This file contains API for Color 8 Click driver.