Functions
SensorOpt3001.h File Reference

Detailed Description

Driver for the Texas Instruments OPT3001 Optical Sensor.

Driver include

This header file should be included in an application as follows:

#include "stdint.h"
#include "stdbool.h"

Go to the source code of this file.

Functions

bool SensorOpt3001_init (void)
 Initialize the temperature sensor driver. More...
 
void SensorOpt3001_enable (bool enable)
 Enable/disable measurement cycle. More...
 
bool SensorOpt3001_test (void)
 Run a sensor self-test. More...
 
bool SensorOpt3001_read (uint16_t *rawData)
 Read the result register. More...
 
float SensorOpt3001_convert (uint16_t rawData)
 Convert raw data to LUX. More...
 

Function Documentation

§ SensorOpt3001_init()

bool SensorOpt3001_init ( void  )

Initialize the temperature sensor driver.

Returns
true if initialization succeeds

§ SensorOpt3001_enable()

void SensorOpt3001_enable ( bool  enable)

Enable/disable measurement cycle.

Parameters
enable- flag to turn the sensor on/off

§ SensorOpt3001_test()

bool SensorOpt3001_test ( void  )

Run a sensor self-test.

Returns
true if passed

§ SensorOpt3001_read()

bool SensorOpt3001_read ( uint16_t *  rawData)

Read the result register.

Parameters
rawData- data buffer
Returns
true if valid data

§ SensorOpt3001_convert()

float SensorOpt3001_convert ( uint16_t  rawData)

Convert raw data to LUX.

Parameters
rawData- raw data from sensor
Returns
converted value (lux)
Copyright 2018, Texas Instruments Incorporated