illuminance  2.0.0.0
Data Structures | Macros | Functions
illuminance.h File Reference

This file contains API for Illuminance 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  illuminance_t
 Click ctx object definition. More...
 
struct  illuminance_cfg_t
 Click configuration structure definition. More...
 

Macros

#define ILLUMINANCE_MAP_MIKROBUS(cfg, mikrobus)
 
#define ILLUMINANCE_RETVAL   uint8_t
 
#define ILLUMINANCE_OK   0x00
 
#define ILLUMINANCE_INIT_ERROR   0xFF
 
#define ILLUMINANCE_TSL2561_I2C_ADDR_LOW   0x29
 
#define ILLUMINANCE_TSL2561_I2C_ADDR_FLOAT   0x39
 
#define ILLUMINANCE_TSL2561_I2C_ADDR_HIGH   0x49
 
#define ILLUMINANCE_TSL2561_REGISTER_CONTROL   0x00
 
#define ILLUMINANCE_TSL2561_REGISTER_TIMING   0x01
 
#define ILLUMINANCE_TSL2561_REGISTER_THRESHHOLDL_LOW   0x02
 
#define ILLUMINANCE_TSL2561_REGISTER_THRESHHOLDL_HIGH   0x03
 
#define ILLUMINANCE_TSL2561_REGISTER_THRESHHOLDH_LOW   0x04
 
#define ILLUMINANCE_TSL2561_REGISTER_THRESHHOLDH_HIGH   0x05
 
#define ILLUMINANCE_TSL2561_REGISTER_INTERRUPT   0x06
 
#define ILLUMINANCE_TSL2561_REGISTER_CRC   0x08
 
#define ILLUMINANCE_TSL2561_REGISTER_ID   0x0A
 
#define ILLUMINANCE_TSL2561_REGISTER_CHAN0_LOW   0x0C
 
#define ILLUMINANCE_TSL2561_REGISTER_CHAN0_HIGH   0x0D
 
#define ILLUMINANCE_TSL2561_REGISTER_CHAN1_LOW   0x0E
 
#define ILLUMINANCE_TSL2561_REGISTER_CHAN1_HIGH   0x0F
 
#define ILLUMINANCE_TSL2561_INTEGRATIONTIME_13MS   0x00
 
#define ILLUMINANCE_TSL2561_INTEGRATIONTIME_101MS   0x01
 
#define ILLUMINANCE_TSL2561_INTEGRATIONTIME_402MS   0x02
 
#define ILLUMINANCE_TSL2561_GAIN_0X   0x00
 
#define ILLUMINANCE_TSL2561_GAIN_16X   0x10
 
#define ILLUMINANCE_TSL2561_COMMAND_BIT   0x80
 
#define ILLUMINANCE_TSL2561_CLEAR_BIT   0x40
 
#define ILLUMINANCE_TSL2561_WORD_BIT   0x20
 
#define ILLUMINANCE_TSL2561_BLOCK_BIT   0x10
 
#define ILLUMINANCE_TSL2561_CONTROL_POWERON   0x03
 
#define ILLUMINANCE_TSL2561_CONTROL_POWEROFF   0x00
 
#define ILLUMINANCE_TSL2561_CHSCALE_TINT0   0x7517
 
#define ILLUMINANCE_TSL2561_CHSCALE_TINT1   0x0FE7
 
#define ILLUMINANCE_TSL2561_LUX_SCALE   14
 
#define ILLUMINANCE_TSL2561_RATIO_SCALE   9
 
#define ILLUMINANCE_TSL2561_CH_SCALE   10
 
#define ILLUMINANCE_TSL2561_K1T   0x0040
 
#define ILLUMINANCE_TSL2561_B1T   0x01f2
 
#define ILLUMINANCE_TSL2561_M1T   0x01be
 
#define ILLUMINANCE_TSL2561_K2T   0x0080
 
#define ILLUMINANCE_TSL2561_B2T   0x0214
 
#define ILLUMINANCE_TSL2561_M2T   0x02d1
 
#define ILLUMINANCE_TSL2561_K3T   0x00c0
 
#define ILLUMINANCE_TSL2561_B3T   0x023f
 
#define ILLUMINANCE_TSL2561_M3T   0x037b
 
#define ILLUMINANCE_TSL2561_K4T   0x0100
 
#define ILLUMINANCE_TSL2561_B4T   0x0270
 
#define ILLUMINANCE_TSL2561_M4T   0x03fe
 
#define ILLUMINANCE_TSL2561_K5T   0x0138
 
#define ILLUMINANCE_TSL2561_B5T   0x016f
 
#define ILLUMINANCE_TSL2561_M5T   0x01fc
 
#define ILLUMINANCE_TSL2561_K6T   0x019a
 
#define ILLUMINANCE_TSL2561_B6T   0x00d2
 
#define ILLUMINANCE_TSL2561_M6T   0x00fb
 
#define ILLUMINANCE_TSL2561_K7T   0x029a
 
#define ILLUMINANCE_TSL2561_B7T   0x0018
 
#define ILLUMINANCE_TSL2561_M7T   0x0012
 
#define ILLUMINANCE_TSL2561_K8T   0x029a
 
#define ILLUMINANCE_TSL2561_B8T   0x0000
 
#define ILLUMINANCE_TSL2561_M8T   0x0000
 

Functions

void illuminance_cfg_setup (illuminance_cfg_t *cfg)
 Config Object Initialization function. More...
 
ILLUMINANCE_RETVAL illuminance_init (illuminance_t *ctx, illuminance_cfg_t *cfg)
 Initialization function. More...
 
void illuminance_default_cfg (illuminance_t *ctx)
 Click Default Configuration function. More...
 
void illuminance_generic_write (illuminance_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function. More...
 
void illuminance_generic_read (illuminance_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function. More...
 
void illuminance_write_data (illuminance_t *ctx, uint8_t address, uint8_t write_command)
 Generic write data function. More...
 
uint8_t illuminance_read_data (illuminance_t *ctx, uint8_t addr)
 Generic read data function. More...
 
void illuminance_get_result (illuminance_t *ctx, uint16_t *value_ch0, uint16_t *value_ch1)
 Get Visible & Infrared value. More...
 
uint16_t illuminance_calculate_lux (uint16_t value_gain, uint16_t value_int, uint16_t ch0, uint16_t ch1)
 Calculate lux value. More...
 
uint8_t illuminance_get_interrupt (illuminance_t *ctx)
 Get interrupt pin status. More...
 

Detailed Description

This file contains API for Illuminance Click driver.