uv2 2.0.0.0
uv2.h File Reference

This file contains API for UV 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  uv2_t
 Click ctx object definition. More...
 
struct  uv2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define UV2_MAP_MIKROBUS(cfg, mikrobus)
 
#define UV2_RETVAL   uint8_t
 
#define UV2_OK   0x00
 
#define UV2_INIT_ERROR   0xFF
 
#define UV2_I2C_ADDRESS   0x10
 
#define UV2_DEV_ID   0x26
 
#define UV2_REG_CONF   0x00
 
#define UV2_REG_UVA   0x07
 
#define UV2_REG_UVB   0x09
 
#define UV2_REG_UVCOMP1   0x0A
 
#define UV2_REG_UVCOMP2   0x0B
 
#define UV2_REG_DEVID   0x0C
 
#define UV2_CONF_IT_50MS   0x00
 
#define UV2_CONF_IT_100MS   0x10
 
#define UV2_CONF_IT_200MS   0x20
 
#define UV2_CONF_IT_400MS   0x30
 
#define UV2_CONF_IT_800MS   0x40
 
#define UV2_CONF_IT_MASK   0x8F
 
#define UV2_CONF_HD_NORM   0x00
 
#define UV2_CONF_HD_HIGH   0x08
 
#define UV2_CONF_MODE_TRIG   0x00
 
#define UV2_CONF_ONE_TRIG   0x04
 
#define UV2_CONF_AF_OFF   0x00
 
#define UV2_CONF_AF_ON   0x02
 
#define UV2_CONF_SD_PWR_ON   0x00
 
#define UV2_CONF_SD_PWR_OFF   0x01
 
#define UV2_UVI_UVA_VIS_COEFF   3.33
 
#define UV2_UVI_UVA_IR_COEFF   2.50
 
#define UV2_UVI_UVB_VIS_COEFF   3.66
 
#define UV2_UVI_UVB_IR_COEFF   2.75
 
#define UV2_UVI_UVA_RESPONSE   0.00110
 
#define UV2_UVI_UVB_RESPONSE   0.00125
 
#define UV2_WRITE_MSB_BITS   0x00
 

Functions

void uv2_cfg_setup (uv2_cfg_t *cfg)
 Config Object Initialization function.
 
UV2_RETVAL uv2_init (uv2_t *ctx, uv2_cfg_t *cfg)
 Initialization function.
 
void uv2_default_cfg (uv2_t *ctx)
 Click Default Configuration function.
 
void uv2_generic_write (uv2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void uv2_generic_read (uv2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void uv2_write_data (uv2_t *ctx, uint8_t reg_address, uint8_t write_data)
 Write 16-bit data function.
 
uint16_t uv2_read_data (uv2_t *ctx, uint8_t reg_address)
 Read 16-bit data from 8-bit address function.
 
void uv2_set_config (uv2_t *ctx, uint8_t config_value)
 Set configuration function.
 
void uv2_set_integration_time (uv2_t *ctx, uint16_t intg_time)
 Set integration time function.
 
void uv2_set_normal_dynamic (uv2_t *ctx)
 Set normal dynamic function.
 
void uv2_set_high_dynamic (uv2_t *ctx)
 Set high dynamic function.
 
void uv2_set_trigger_measurement (uv2_t *ctx)
 Set trigger one measurement function.
 
void uv2_set_active_force_mode (uv2_t *ctx, uint8_t force_mode)
 Set active force mode function.
 
void uv2_set_power_on (uv2_t *ctx)
 Set power ON function.
 
void uv2_set_power_off (uv2_t *ctx)
 Set power OFF function.
 
uint8_t uv2_check_id (uv2_t *ctx)
 Check sensor ID function.
 
uint16_t uv2_get_uva (uv2_t *ctx)
 Get UVA data function.
 
uint16_t uv2_get_uvb (uv2_t *ctx)
 Get UVB data function.
 
float uv2_get_uv_index (uv2_t *ctx)
 Get UV index function.
 

Detailed Description

This file contains API for UV 2 Click driver.