Library for ISL29125 - I2C RGB ambient light sensor
Dependents: ISL29125_demo FinalProject Final_NSR 4180FinalProject_copy ... more
Device documentation
Detailed information is available at Intersil
Calling the constructor
The constructor can be instantiaded in 3 ways:
Information
The first two pins (SDA and SCL) always need to be declared.
ISR mode
void RGBsensor_irq(void) // User ISR { .... } ISL29125 RGBsensor(PTE0, PTE1, PTD7, &RGBsensor_irq); // sda, scl, irq, user isr
The user ISR is called whenever the upper/lower threshold is reached and/or when a conversion cycle is finished. The threshold (Threshold
function) and end of conversion (IRQonCnvDone
function) interrupts can be enabled separately.
In this mode, PTD7 is an interrupt input.
Limitation!
Calling the Read
function at a high rate will result in a I2C failure.
Use a Ticker to call the Read
function at regular intervals. Example : ISL29125_demo
SYNC mode
ISL29125 RGBsensor(PTE0, PTE1, PTD7); // sda, scl, sync input
In this mode, PTD7 is a digital output. Initially, the sensor is idle (no conversions) and can be started by calling the Run
function.
Polling mode
ISL29125 RGBsensor(PTE0, PTE1); // sda, scl
In this mode, user defined functions are needed to poll the sensor status, read the sensor data, ....
History
Update doxygen
2014-05-28, by frankvnk [Wed, 28 May 2014 20:15:39 +0000] rev 4
Update doxygen
doxygen update
2014-05-28, by frankvnk [Wed, 28 May 2014 19:36:31 +0000] rev 3
doxygen update
Doxygen update
2014-05-28, by frankvnk [Wed, 28 May 2014 19:19:06 +0000] rev 2
Doxygen update
update doxygen
2014-05-28, by frankvnk [Wed, 28 May 2014 18:44:54 +0000] rev 1
update doxygen
Initial release
2014-05-28, by frankvnk [Wed, 28 May 2014 18:18:25 +0000] rev 0
Initial release