uvb 2.0.0.0
uvb.h File Reference

This file contains API for UVB 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  uvb_t
 UVB Click context object. More...
 
struct  uvb_cfg_t
 UVB Click configuration object. More...
 

Macros

#define UVB_REG_CHIP_ID   0x00
 UVB description register.
 
#define UVB_REG_MODE   0x01
 
#define UVB_REG_RES_UV   0x04
 
#define UVB_REG_RANGE_UVB   0x07
 
#define UVB_REG_MODE_CTRL   0x0A
 
#define UVB_REG_SOFT_RESET   0x0B
 
#define UVB_REG_UVB_LSB   0x17
 
#define UVB_REG_UVB_MSB   0x18
 
#define UVB_REG_NVM_READ_CTRL   0x30
 
#define UVB_REG_NVM_MSB   0x31
 
#define UVB_REG_NVM_LSB   0x32
 
#define UVB_MODE_NO_OPERATION   0x00
 UVB description setting.
 
#define UVB_MODE_UVB_OPERATION   0x20
 
#define UVB_MODE_NORMAL   0x00
 
#define UVB_MODE_LOW_POWER   0x01
 
#define UVB_MODE_AUTO_SHUTDOWN   0x02
 
#define UVB_MODE_SHUTDOWN   0x03
 
#define UVB_RESOLUTION_800ms   0x00
 UVB resolution setting.
 
#define UVB_RESOLUTION_400ms   0x01
 
#define UVB_RESOLUTION_200ms   0x02
 
#define UVB_RESOLUTION_100ms   0x03
 
#define UVB_RANGE_x1   0x00
 UVB range setting.
 
#define UVB_RANGE_x2   0x01
 
#define UVB_RANGE_x4   0x02
 
#define UVB_RANGE_x8   0x03
 
#define UVB_RANGE_x16   0x04
 
#define UVB_RANGE_x32   0x05
 
#define UVB_RANGE_x64   0x06
 
#define UVB_RANGE_x128   0x07
 
#define UVB_MCTRL_SLEEP_2_TIMES   0x00
 UVB sleep setting.
 
#define UVB_MCTRL_SLEEP_4_TIMES   0x01
 
#define UVB_MCTRL_SLEEP_8_TIMES   0x02
 
#define UVB_MCTRL_SLEEP_16_TIMES   0x03
 
#define UVB_MCTRL_SLEEP_32_TIMES   0x04
 
#define UVB_MCTRL_SLEEP_64_TIMES   0x05
 
#define UVB_MCTRL_SLEEP_128_TIMES   0x06
 
#define UVB_MCTRL_SLEEP_256_TIMES   0x07
 
#define UVB_DEF_CHIP_ID   0x62
 
#define UVB_SET_DEV_ADDR   0x39
 UVB device address setting.
 
#define UVB_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  uvb_return_value_t { UVB_OK = 0 , UVB_ERROR = -1 }
 UVB Click return value data. More...
 

Functions

void uvb_cfg_setup (uvb_cfg_t *cfg)
 UVB configuration object setup function.
 
err_t uvb_init (uvb_t *ctx, uvb_cfg_t *cfg)
 UVB initialization function.
 
err_t uvb_default_cfg (uvb_t *ctx)
 UVB default configuration function.
 
err_t uvb_generic_write (uvb_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 UVB I2C writing function.
 
err_t uvb_generic_read (uvb_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 UVB I2C reading function.
 
void uvb_configuration (uvb_t *ctx, uint8_t reg, uint8_t cfg)
 Configuration register.
 
uint8_t uvb_read_byte (uvb_t *ctx, uint8_t reg)
 Read one byte data from register.
 
err_t uvb_check_communication (uvb_t *ctx)
 Check communication.
 
uint16_t uvb_get_uv_data (uvb_t *ctx)
 Get UVB data.
 

Detailed Description

This file contains API for UVB Click Driver.

Enumeration Type Documentation

◆ uvb_return_value_t

UVB Click return value data.

Predefined enum values for driver return values.

Enumerator
UVB_OK 
UVB_ERROR