|
DUDS
|
Distributed Update of Data from Something
|
A quick try at supporting ISL29125 RGB sensor; will change significantly in the future. More...
#include <ISL29125.hpp>
Public Member Functions | |
| ISL29125 (std::unique_ptr< duds::hardware::interface::I2c > &c) | |
| Prepares to communicate with the device, but does not initalize the device. More... | |
| ~ISL29125 () | |
| Calls suspend(). More... | |
| std::uint16_t | blue () const |
| std::uint16_t | green () const |
| void | init (bool wide=true) |
| Configures for continuous 16-bit sampling of all colors. More... | |
| std::uint16_t | red () const |
| void | resume () |
| Resumes operation after a call to suspend(). More... | |
| void | sample () |
| The device takes about 101ms to produce a 16-bit sample per color. More... | |
| void | suspend () |
| Suspends operation by putting the device into a low-power mode. More... | |
Private Attributes | |
| std::uint16_t | b |
| Blue brightness. More... | |
| std::unique_ptr< duds::hardware::interface::I2c > | com |
| The I2C communication interface. More... | |
| std::uint16_t | g |
| Green brightness. More... | |
| duds::hardware::interface::Conversation | initialize |
| Output used to initialize the device. More... | |
| duds::hardware::interface::Conversation | input |
| Used to read in the sampled data. More... | |
| std::uint16_t | r |
| Red brightness. More... | |
A quick try at supporting ISL29125 RGB sensor; will change significantly in the future.
Uses I2C to read six bytes in one call rather than three calls with SMBus. Seems to work well.
Definition at line 24 of file ISL29125.hpp.
| duds::hardware::devices::instruments::ISL29125::ISL29125 | ( | std::unique_ptr< duds::hardware::interface::I2c > & | c | ) |
Prepares to communicate with the device, but does not initalize the device.
Default device address is 0x44.
Definition at line 16 of file ISL29125.cpp.
| duds::hardware::devices::instruments::ISL29125::~ISL29125 | ( | ) |
Calls suspend().
Definition at line 25 of file ISL29125.cpp.
|
inline |
Definition at line 93 of file ISL29125.hpp.
|
inline |
Definition at line 90 of file ISL29125.hpp.
| void duds::hardware::devices::instruments::ISL29125::init | ( | bool | wide = true | ) |
Configures for continuous 16-bit sampling of all colors.
All other options are left at default settings.
| wide | True for 10000 lux range, false for 375 lux range. |
Definition at line 29 of file ISL29125.cpp.
|
inline |
Definition at line 87 of file ISL29125.hpp.
| void duds::hardware::devices::instruments::ISL29125::resume | ( | ) |
Resumes operation after a call to suspend().
| DeviceUninitalized | init() hasn't been called. |
Definition at line 50 of file ISL29125.cpp.
| void duds::hardware::devices::instruments::ISL29125::sample | ( | ) |
The device takes about 101ms to produce a 16-bit sample per color.
Sampling faster than that will read old values, but not bad data.
Definition at line 57 of file ISL29125.cpp.
| void duds::hardware::devices::instruments::ISL29125::suspend | ( | ) |
Suspends operation by putting the device into a low-power mode.
Definition at line 40 of file ISL29125.cpp.
Referenced by ~ISL29125().
|
private |
|
private |
|
private |
|
private |
Output used to initialize the device.
Definition at line 32 of file ISL29125.hpp.
|
private |
Used to read in the sampled data.
Definition at line 36 of file ISL29125.hpp.
Referenced by ISL29125(), and sample().
|
private |