uv3 2.0.0.0
Public function

Functions

void uv3_cfg_setup (uv3_cfg_t *cfg)
 Config Object Initialization function.
 
UV3_RETVAL uv3_init (uv3_t *ctx, uv3_cfg_t *cfg)
 Initialization function.
 
void uv3_default_cfg (uv3_t *ctx)
 Click Default Configuration function.
 
void uv3_write_command (uv3_t *ctx, uint8_t slave_addr, uint8_t command)
 Write function.
 
uint8_t uv3_read_byte (uv3_t *ctx, uint8_t slave_addr)
 Read function.
 
void uv3_clear_ack (uv3_t *ctx)
 Read ARA to clear interrupt function.
 
void uv3_enable_sensor (uv3_t *ctx)
 Enable sensor function.
 
void uv3_disable_mode (uv3_t *ctx)
 Disable sensor function.
 
void uv3_set_integration_time (uv3_t *ctx, uint8_t int_data)
 Set integration time function.
 
uint16_t uv3_read_measurements (uv3_t *ctx)
 Get UV data measurements function.
 
uint8_t uv3_risk_level (uint16_t uv_data)
 Calculate UV risk level function.
 
uint8_t uv3_get_interrupt (uv3_t *ctx)
 Get state of interrupt pin function.
 

Detailed Description

Function Documentation

◆ uv3_cfg_setup()

void uv3_cfg_setup ( uv3_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ uv3_clear_ack()

void uv3_clear_ack ( uv3_t * ctx)

Read ARA to clear interrupt function.

Parameters
ctxClick object.

@description Function read ARA clear interrupt from the target 8-bit ARA slave address of VEML6070 sensor on UV 3 Click.

◆ uv3_default_cfg()

void uv3_default_cfg ( uv3_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Uv3 click.

◆ uv3_disable_mode()

void uv3_disable_mode ( uv3_t * ctx)

Disable sensor function.

Parameters
ctxClick object.

@description Function disable sensor by sets shutdown mode bits as HIGH to the target 8-bit CMD slave address of VEML6070 sensor on UV 3 Click.

◆ uv3_enable_sensor()

void uv3_enable_sensor ( uv3_t * ctx)

Enable sensor function.

Parameters
ctxClick object.

@description Function enable sensor by sets shutdown mode bits as LOW to the target 8-bit CMD slave address of VEML6070 sensor on UV 3 Click.

◆ uv3_get_interrupt()

uint8_t uv3_get_interrupt ( uv3_t * ctx)

Get state of interrupt pin function.

Parameters
ctxClick object.
Returns
state of ACK pin : 0 (not active) or 1 (active).

@description Function get state of interrupt ( ACK ) pin.

◆ uv3_init()

UV3_RETVAL uv3_init ( uv3_t * ctx,
uv3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ uv3_read_byte()

uint8_t uv3_read_byte ( uv3_t * ctx,
uint8_t slave_addr )

Read function.

Parameters
ctxClick object.
slave_addrSlave address.
Returns
One byte read data.

@description Function read the 8-bit of data from the target 8-bit reed slave address of VEML6070 sensor on UV 3 Click.

◆ uv3_read_measurements()

uint16_t uv3_read_measurements ( uv3_t * ctx)

Get UV data measurements function.

Parameters
ctxClick object.

@description Function read UV data measurements from to the two target 8-bit slave address: DATA LSB and DATA HSB of VEML6070 sensor on UV 3 Click.

◆ uv3_risk_level()

uint8_t uv3_risk_level ( uint16_t uv_data)

Calculate UV risk level function.

Parameters
uv_data16-bit uv data for calculate.
Returns
risk level.
Note
Risk level
- 1: Low UV radiation;
- 2: Moderate UV radiation;
- 3: High UV radiation;
- 4: Very High UV radiation;
- 5: Extreme UV radiation;

@description Function calculate UV risk level of VEML6070 sensor on UV 3 Click.

◆ uv3_set_integration_time()

void uv3_set_integration_time ( uv3_t * ctx,
uint8_t int_data )

Set integration time function.

Parameters
ctxClick object.
it_data
Note
Integration time data:
- 0x00 : 1/2 T ( 62.5 ms or 125  ms );
- 0x04 :  1  T ( 125  ms or 250  ms );
- 0x08 :  2  T ( 250  ms or 500  ms );
- 0x0C :  4  T ( 500  ms or 1000 ms );

@description Function set integration time function by write it data to the target 8-bit write slave address of VEML6070 sensor on UV 3 Click.

◆ uv3_write_command()

void uv3_write_command ( uv3_t * ctx,
uint8_t slave_addr,
uint8_t command )

Write function.

Parameters
ctxClick object.
slave_addrSlave address.
commandCommand to be written.

@description Function write the 8-bit of data to the target 8-bit write slave address of VEML6070 sensor on UV 3 Click.