|
modm API documentation
|
#include <modm/driver/color/tcs3414.hpp>
Classes | |
| struct | Data |
Public Typedefs | |
| using | Rgb = color::RgbT< uint16_t > |
Public Types | |
| enum | Gain : uint8_t |
| Analog gain control. | |
| enum | Prescaler : uint8_t |
| Prescaler mode. | |
| enum | IntegrationMode : uint8_t |
| Select mode how to choose the integration time. | |
| enum | NominalIntegrationTime : uint8_t |
| Integration for a fixed time. | |
| enum | SyncPulseCount : uint8_t |
| The number of pulses on sync pin to integrate over. | |
| enum | RegisterAddress : uint8_t |
| Register addresses. | |
Public Member Functions | |
| Tcs3414 (Data &data, uint8_t address=addr ()) | |
| bool | initialize () |
| bool | configure (Gain gain=Gain::X1, Prescaler prescaler=Prescaler::D1) |
| bool | setGain (Gain gain=Gain::X1, Prescaler prescaler=Prescaler::D1) |
| The gain can be used to adjust the sensitivity of all ADC output channels. | |
| bool | setIntegrationTime (IntegrationMode mode, NominalIntegrationTime time) |
| Sets the integration time for the ADCs. | |
| bool | setIntegrationTime (IntegrationMode mode, SyncPulseCount time) |
| Sets the integration time for the ADCs. | |
| bool | readColor () |
| Read current samples of ADC conversions for all channels. | |
| bool | readRegisters (RegisterAddress address, uint8_t *values, uint8_t count=1) |
| bool | writeRegister (RegisterAddress address, uint8_t value) |
| void | attachConfigurationHandler (I2c::ConfigurationHandler handler) |
| bool | ping () |
| bool | read (uint8_t *buffer, std::size_t size) |
| Starts a write transaction and waits until finished. | |
| void | setAddress (uint8_t address) |
| bool | write (const uint8_t *buffer, std::size_t size) |
| Starts a write transaction and waits until finished. | |
| bool | writeRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize) |
| Starts a write-read transaction and waits until finished. | |
Static Public Member Functions | |
| static constexpr uint8_t | addr (uint8_t version=4) |
Protected Member Functions | |
| bool | isTransactionRunning () |
| bool | runTransaction () |
| Starts our own transaction and waits until finished. | |
| bool | startTransaction () |
| Starts the transaction with our own transaction object. | |
| bool | startTransaction (modm::I2cTransaction *transaction) |
| Starts the transaction with a separate transaction object. | |
| bool | wasTransactionSuccessful () |
Protected Attributes | |
| Data & | data |
| uint8_t | buffer [3] |
| I2cWriteReadTransaction | transaction |
TCS3414 Digital Color Sensors
|
inlinestaticconstexpr |
Device Address depends on version TCS341x
|
inheritedinline |
Attaches a configuration handler, which is called before a transaction, whenever the configuration has to be changed.
|
inheritedinlineprotected |
true when transaction is busy.
|
inheritedinline |
| true | device responds to address |
| false | no device with address found |
|
inheritedinline |
Sets a new address of the slave device.
| address | the slave address not yet shifted left (address < 128). |
|
inheritedinlineprotected |
true when transaction did not return an error.