Device driver interface for the VEML6070 UV sensor. More...

Detailed Description

Device driver interface for the VEML6070 UV sensor.

This driver provides [S]ensor [A]ctuator [U]ber [L]ayer capabilities.

Files

file  veml6070.h
 Device driver interface for the VEML6070 UV sensor.
 
file  veml6070_params.h
 Default configuration for VEML6070.
 

Data Structures

struct  veml6070_params_t
 Device initialization parameters. More...
 
struct  veml6070_t
 Device descriptor for the VEML6070 sensor. More...
 

Typedefs

typedef enum veml6070_integrationtime veml6070_itime_t
 Integration times.
 

Enumerations

enum  veml6070_integrationtime { VEML6070_HALF_T = 0, VEML6070_1_T, VEML6070_2_T, VEML6070_4_T }
 Integration times. More...
 
enum  { VEML6070_OK = 0, VEML6070_ERR_I2C }
 Status and error return codes. More...
 

Functions

int veml6070_init (veml6070_t *dev, const veml6070_params_t *params)
 Initialize the given VEML6070 device. More...
 
uint16_t veml6070_read_uv (const veml6070_t *dev)
 Read UV index from the given VEML6070 device. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Status and error return codes.

Enumerator
VEML6070_OK 

Everything was fine.

VEML6070_ERR_I2C 

Error initializing the I2C bus.

Definition at line 47 of file veml6070.h.

◆ veml6070_integrationtime

Integration times.

Enumerator
VEML6070_HALF_T 

1/2 T integration time

VEML6070_1_T 

1 T integration time

VEML6070_2_T 

2 T integration time

VEML6070_4_T 

4 T integration time

Definition at line 37 of file veml6070.h.

Function Documentation

◆ veml6070_init()

int veml6070_init ( veml6070_t dev,
const veml6070_params_t params 
)

Initialize the given VEML6070 device.

Parameters
[out]devInitialized device descriptor of VEML6070 device
[in]paramsThe parameters for the VEML6070 device (integration time)
Returns
VEML6070_OK on success
VEML6070_ERR_I2C if given I2C is not enabled in board config

◆ veml6070_read_uv()

uint16_t veml6070_read_uv ( const veml6070_t dev)

Read UV index from the given VEML6070 device.

Parameters
[in]devDevice descriptor of VEML6070 device to read from
Returns
UV index