197 #include <ti/drivers/I2C.h> 198 #include <ti/drivers/GPIO.h> 201 #define OPT3001_RESULT 0x0000 202 #define OPT3001_CONFIG 0x0001 203 #define OPT3001_LOLIMIT 0x0002 204 #define OPT3001_HILIMIT 0x0003 205 #define OPT3001_MFTID 0x007E 206 #define OPT3001_DEVICEID 0x007F 209 #define OPT3001_FL 0x0020 210 #define OPT3001_FH 0x0040 211 #define OPT3001_CRF 0x0080 212 #define OPT3001_OVF 0x0100 227 #define OPT3001_IGNORE 0xFFFF 494 float *high,
float *low);
568 uint16_t *data, uint8_t registerAddress);
652 uint8_t registerAddress);
Definition: opt3001.h:239
Hardware specific settings for a OPT3001 sensor.
Definition: opt3001.h:387
Definition: opt3001.h:360
Members should not be accessed by the application.
Definition: opt3001.h:395
Definition: opt3001.h:310
unsigned int gpioIndex
Definition: opt3001.h:389
Definition: opt3001.h:320
Definition: opt3001.h:341
Definition: opt3001.h:241
struct OPT3001_Params OPT3001_Params
OPT3001 Parameters.
struct OPT3001_Config OPT3001_Config
OPT3001 configuration.
Definition: opt3001.h:322
Definition: opt3001.h:340
OPT3001_ConversionMode conversionMode
Definition: opt3001.h:414
Definition: opt3001.h:314
Definition: opt3001.h:286
OPT3001_ConversionTime
OPT3001 Conversion Time.
Definition: opt3001.h:269
bool OPT3001_getLuxLimits(OPT3001_Handle handle, float *high, float *low)
Function to get the sensor's lux limits.
Definition: opt3001.c:181
Definition: opt3001.h:240
Definition: opt3001.h:287
struct OPT3001_HWAttrs OPT3001_HWAttrs
Hardware specific settings for a OPT3001 sensor.
void OPT3001_init()
Function to initialize OPT3001 driver.
Definition: opt3001.c:201
OPT3001_FaultCount faultCount
Definition: opt3001.h:417
void OPT3001_Params_init(OPT3001_Params *params)
Function to initialize a OPT3001_Params struct to its defaults.
Definition: opt3001.c:269
OPT3001_FaultCount
OPT3001 Fault Count.
Definition: opt3001.h:283
Definition: opt3001.h:311
Definition: opt3001.h:285
Definition: opt3001.h:317
void const * hwAttrs
Definition: opt3001.h:374
Definition: opt3001.h:313
Definition: opt3001.h:321
OPT3001_FullRange
OPT3001 Result Register Range.
Definition: opt3001.h:309
bool OPT3001_setConversionMode(OPT3001_Handle handle, OPT3001_ConversionMode mode)
Function to change the conversion mode.
Definition: opt3001.c:384
OPT3001_InterruptMode
OPT3001 Interrupt Mode.
Definition: opt3001.h:339
OPT3001_ConversionReady
OPT3001 Conversion Ready Interrupt Mode.
Definition: opt3001.h:254
struct OPT3001_Config * OPT3001_Handle
A handle that is returned from a OPT3001_open() call.
Definition: opt3001.h:348
Definition: opt3001.h:256
void * object
Definition: opt3001.h:377
Definition: opt3001.h:284
OPT3001_InterruptMode interruptMode
Definition: opt3001.h:419
bool OPT3001_setRange(OPT3001_Handle handle, OPT3001_FullRange range)
Set the lux measurement result range.
Definition: opt3001.c:360
bool OPT3001_readRegister(OPT3001_Handle handle, uint16_t *data, uint8_t registerAddress)
Read the specified register from a OPT3001 sensor.
Definition: opt3001.c:278
OPT3001_FullRange range
Definition: opt3001.h:398
OPT3001 Parameters.
Definition: opt3001.h:413
Definition: opt3001.h:318
GPIO_CallbackFxn callback
Definition: opt3001.h:397
OPT3001 configuration.
Definition: opt3001.h:372
Definition: opt3001.h:315
OPT3001_ConversionReady conversionReady
Definition: opt3001.h:415
Definition: opt3001.h:358
bool OPT3001_setLuxLimits(OPT3001_Handle handle, float high, float low)
Function to get the sensor's lux limits.
Definition: opt3001.c:305
OPT3001_SlaveAddress
OPT3001 I2C slave addresses.
Definition: opt3001.h:357
Definition: opt3001.h:271
Definition: opt3001.h:319
OPT3001_SlaveAddress slaveAddress
Definition: opt3001.h:388
Definition: opt3001.h:359
GPIO_CallbackFxn callback
Definition: opt3001.h:420
Definition: opt3001.h:361
bool OPT3001_enableInterrupt(OPT3001_Handle handle)
Enable interrupts from the specified OPT3001.
Definition: opt3001.c:144
OPT3001_ConversionTime conversionTime
Definition: opt3001.h:416
I2C_Handle i2cHandle
Definition: opt3001.h:396
OPT3001_ConversionMode
OPT3001 ADC conversion mode.
Definition: opt3001.h:238
OPT3001_FullRange range
Definition: opt3001.h:418
Definition: opt3001.h:255
bool OPT3001_writeRegister(OPT3001_Handle handle, uint16_t data, uint8_t registerAddress)
Write the specified data to a OPT3001 sensor.
Definition: opt3001.c:409
Definition: opt3001.h:316
Definition: opt3001.h:312
bool OPT3001_disableInterrupt(OPT3001_Handle handle)
Function to disable the GPIO interrupt.
Definition: opt3001.c:128
Definition: opt3001.h:270
bool OPT3001_getLux(OPT3001_Handle handle, float *data)
Function to get the sensor's lux reading.
Definition: opt3001.c:165
bool OPT3001_close(OPT3001_Handle handle)
Function to close a OPT3001 sensor specified by the OPT3001 handle.
Definition: opt3001.c:105
struct OPT3001_Object OPT3001_Object
Members should not be accessed by the application.
OPT3001_Handle OPT3001_open(unsigned int index, I2C_Handle i2cHandle, OPT3001_Params *params)
Function to open a given OPT3001 sensor.
Definition: opt3001.c:218