EZR32 Leopard Gecko Software Documentation  ezr32lg-doc-4.2.1
si114x_uv_index.c File Reference

Si114x UV Index measurement. More...

#include "si114x_functions.h"

Go to the source code of this file.

Macros

#define UV_TASKLIST   0x80
 
#define UV_IRQ_EN   IE_ALS_EVRYSAMPLE
 
#define SI1146_DEVICE_ID   0x46
 

Functions

int Si114x_MeasureUVIndex (u16 *uvIndex)
 Reads the UV index measurement data from the Si114x. More...
 
int Si114x_EnableVisRange (int vis_range_bit)
 Set the VIS_RANGE bit of the optical sensor Si114x. More...
 
int Si114x_ConfigureUV (int fullInit, HANDLE *handle)
 Initializes and configures the Si1146 sensor for UV index measurements. More...
 

Variables

static void * si114x_handle
 Si114x PGM toolkit functions uses a void* to pass hardware parameters through to the lower level i2c functions. This struct is passed down to the low level i2c functions using that pointer.
 

Detailed Description

Version
4.2.1

License

(C) Copyright 2014 Silicon Labs, http://www.silabs.com

This file is licensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file si114x_uv_index.c.

Macro Definition Documentation

#define UV_TASKLIST   0x80

Si114x register settings. UV task in CHLIST

Definition at line 19 of file si114x_uv_index.c.

Referenced by Si1147_ConfigureDetection(), and Si114x_ConfigureUV().

#define UV_IRQ_EN   IE_ALS_EVRYSAMPLE

UV interrupt enable

Definition at line 20 of file si114x_uv_index.c.

#define SI1146_DEVICE_ID   0x46

Si1146 device ID

Definition at line 21 of file si114x_uv_index.c.

Function Documentation

int Si114x_MeasureUVIndex ( u16 *  uvIndex)
Parameters
[out]uvIndexThe UV index read from the sensor
Returns
Returns 0.

Definition at line 40 of file si114x_uv_index.c.

References si114x_handle, Si114xPsAlsForce(), Si114xReadFromRegister(), and Si114xWriteToRegister().

int Si114x_EnableVisRange ( int  vis_range_bit)
Parameters
[in]vis_range_bitthe boolean value to set the bit to
Returns
Returns 0.

Definition at line 88 of file si114x_uv_index.c.

References si114x_handle, and Si114xParamSet().

int Si114x_ConfigureUV ( int  fullInit,
HANDLE *  handle 
)
Parameters
[in]fullInitThe I2C peripheral to use (not used).
[in]handleThe si114x handle for programmer's toolkit
Returns
Returns 0 on success.

Definition at line 110 of file si114x_uv_index.c.

References si114x_get_calibration(), si114x_handle, si114x_set_ucoef(), Si114xParamSet(), Si114xReset(), Si114xWriteToRegister(), and UV_TASKLIST.