light2
2.1.0.0
|
This file contains API for Light 2 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 | light2_t |
Light 2 Click context object. More... | |
struct | light2_cfg_t |
Light 2 Click configuration object. More... | |
Macros | |
#define | LIGHT2_REG_COMMAND 0x00 |
Light 2 description register. More... | |
#define | LIGHT2_REG_DATA_LSB 0x01 |
#define | LIGHT2_REG_DATA_MSB 0x02 |
#define | LIGHT2_EN_DEVICE 0x80 |
Light 2 description setting. More... | |
#define | LIGHT2_ONE_TIME_MEASURE 0x00 |
#define | LIGHT2_EN_CONT_MEASURE 0x40 |
#define | LIGHT2_AMBIENT_LIGHT_SENS 0x00 |
#define | LIGHT2_IR_LIGHT_SENS 0x20 |
#define | LIGHT2_16_BIT_ADC 0x00 |
#define | LIGHT2_12_BIT_ADC 0x04 |
#define | LIGHT2_8_BIT_ADC 0x08 |
#define | LIGHT2_4_BIT_ADC 0x0C |
#define | LIGHT2_ADC_RESOLUTION_MASK 0x0C |
#define | LIGHT2_ADC_DATA_OUT 0x10 |
#define | LIGHT2_TIMER_DATA_OUT 0x14 |
#define | LIGHT2_RANGE_1 0x00 |
#define | LIGHT2_RANGE_2 0x01 |
#define | LIGHT2_RANGE_3 0x02 |
#define | LIGHT2_RANGE_4 0x03 |
#define | LIGHT2_RANGE_MASK 0x03 |
#define | LIGHT2_RANGE_1_MAX 1000 |
Light 2 maximum range reading value. More... | |
#define | LIGHT2_RANGE_2_MAX 4000 |
#define | LIGHT2_RANGE_3_MAX 16000 |
#define | LIGHT2_RANGE_4_MAX 64000 |
#define | LIGHT2_16_BIT_MAX 0xFFFFu |
Light 2 maximum ADC value. More... | |
#define | LIGHT2_12_BIT_MAX 0x0FFFu |
#define | LIGHT2_8_BIT_MAX 0x00FFu |
#define | LIGHT2_4_BIT_MAX 0x000Fu |
#define | LIGHT2_DEVICE_ADDRESS_0 0x44 |
Light 2 device address setting. More... | |
#define | LIGHT2_DEVICE_ADDRESS_1 0x45 |
#define | LIGHT2_MAP_MIKROBUS(cfg, mikrobus) |
MikroBUS pin mapping. More... | |
Enumerations | |
enum | light2_return_value_t { LIGHT2_OK = 0, LIGHT2_ERROR = -1 } |
Light 2 Click return value data. More... | |
Functions | |
void | light2_cfg_setup (light2_cfg_t *cfg) |
Light 2 configuration object setup function. More... | |
err_t | light2_init (light2_t *ctx, light2_cfg_t *cfg) |
Light 2 initialization function. More... | |
err_t | light2_default_cfg (light2_t *ctx) |
Light 2 default configuration function. More... | |
err_t | light2_generic_write (light2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Light 2 I2C writing function. More... | |
err_t | light2_generic_read (light2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Light 2 I2C reading function. More... | |
err_t | light2_write_config (light2_t *ctx, uint8_t data_in) |
Light 2 write config function. More... | |
err_t | light2_read_raw_data (light2_t *ctx, uint16_t *data_out) |
Light 2 raw data reading function. More... | |
err_t | light2_get_cal_const (light2_t *ctx) |
Light 2 get calculation constant function. More... | |
err_t | light2_get_light_data (light2_t *ctx, float *light_data) |
Light 2 get light data function. More... | |
This file contains API for Light 2 Click Driver.