modm API documentation for STM32F107VCT7
modm::tcs3472< I2cMaster > Class Template Reference

Settings to configure the ams digital color sensor family tcs34721, -13, -15, 17. More...

#include <modm/driver/color/tcs3472.hpp>

Inheritance diagram for modm::tcs3472< I2cMaster >:
modm::I2cDevice< I2cMaster, 2 > modm::NestedResumable< 10+1 >

Public Typedefs

typedef uint16_t UnderlyingType
 datatype of color values
 
typedef color::RgbT< UnderlyingTypeRgb
 

Public Types

enum  IntegrationTime : uint8_t {
  IntegrationTime::MSEC_2 = 0xFF, IntegrationTime::MSEC_24 = 0xF6, IntegrationTime::MSEC_101 = 0xD5, IntegrationTime::MSEC_154 = 0xC0,
  IntegrationTime::MSEC_700 = 0x00, IntegrationTime::DEFAULT = 0xFF
}
 Integration for a fixed time. More...
 
enum  RegisterAddress : uint8_t {
  RegisterAddress::ENABLE = 0x00, RegisterAddress::TIMING = 0x01, RegisterAddress::ID = 0x12, RegisterAddress::GAIN = 0x0F,
  RegisterAddress::LOW_THRESH_LOW_BYTE = 0x04, RegisterAddress::LOW_THRESH_HIGH_BYTE = 0x05, RegisterAddress::HIGH_THRESH_LOW_BYTE = 0x06, RegisterAddress::HIGH_THRESH_HIGH_BYTE = 0x07,
  RegisterAddress::CDATALOW = 0x14, RegisterAddress::CDATAHIGH = 0x15, RegisterAddress::RDATALOW = 0x16, RegisterAddress::RDATAHIGH = 0x17,
  RegisterAddress::GDATALOW = 0x18, RegisterAddress::GDATAHIGH = 0x19, RegisterAddress::BDATALOW = 0x1A, RegisterAddress::BDATAHIGH = 0x1B
}
 Register addresses. More...
 
Gain_Register
enum  Gain : uint8_t {
  Gain::X1 = 0b00, Gain::X4 = 0b01, Gain::X16 = 0b10, Gain::X64 = 0b11,
  Gain::DEFAULT = 0
}
 Analog rgbc gain control. More...
 

Public Member Functions

 Tcs3472 (uint8_t address=0x29)
 
bool initializeBlocking ()
 Power up sensor and start conversions.
 
modm::ResumableResult< bool > setGain (const Gain gain=Gain::DEFAULT)
 The gain can be used to adjust the sensitivity of all ADC output channels.
 
modm::ResumableResult< bool > refreshAllColors ()
 Read current samples of ADC conversions for all channels.
 
modm::ResumableResult< bool > initialize ()
 
modm::ResumableResult< bool > configure (const Gain gain=Gain::DEFAULT, const uint8_t int_time=IntegrationTime::DEFAULT)
 
- Public Member Functions inherited from modm::I2cDevice< I2cMaster, 2 >
 I2cDevice (uint8_t address)
 
void attachConfigurationHandler (I2c::ConfigurationHandler handler)
 
modm::ResumableResult< bool > ping ()
 
void setAddress (uint8_t address)
 

Static Public Member Functions

Return already sampled color
static Tcs3472::Rgb getOldColors ()
 
Sample and return fresh color values
static Tcs3472::Rgb getNewColors ()
 

Additional Inherited Members

- Protected Member Functions inherited from modm::I2cDevice< I2cMaster, 2 >
bool isTransactionRunning ()
 
modm::ResumableResult< bool > runTransaction ()
 Starts our own transaction and waits until finished.
 
bool startRead (uint8_t *buffer, std::size_t size)
 Configures the transaction with a read operation and starts it.
 
bool startTransaction ()
 Starts the transaction with our own transaction object.
 
bool startTransaction (modm::I2cTransaction *transaction)
 Starts the transaction with a seperate transaction object.
 
bool startWrite (const uint8_t *buffer, std::size_t size)
 Configures the transaction with a write operation and starts it.
 
bool startWriteRead (const uint8_t *writeBuffer, std::size_t writeSize, uint8_t *readBuffer, std::size_t readSize)
 Configures the transaction with a write/read operation and starts it.
 
bool wasTransactionSuccessful ()
 
- Protected Member Functions inherited from modm::NestedResumable< 10+1 >
 NestedResumable ()
 Construct a new class with nested resumable functions.
 
modm::ResumableResult< ReturnType > resumable function (...)
 
int8_t getResumableDepth () const
 
bool isResumableRunning () const
 
void stopResumable ()
 Force all resumable functions to stop running at the current nesting level.
 
- Protected Attributes inherited from modm::I2cDevice< I2cMaster, 2 >
I2cWriteReadTransaction transaction
 

Detailed Description

template<typename I2cMaster>
class modm::tcs3472< I2cMaster >

Settings to configure the ams digital color sensor family tcs34721, -13, -15, 17.

Tcs3472X Digital Color Sensors.

See also
tcs3472

Device Address tcs34721 0x39 (with IR filter) 3 0x39 (without IR filter) 5 0x29 (with IR filter) 7 0x29 (without IR filter)

Template Parameters
I2CMasterI2C interface which needs an initialized modm::i2c::Master
See also
tcs3472
Author
David Hebbeker, Arjun Sarin

Member Enumeration Documentation

template<typename I2cMaster >
enum modm::tcs3472::Gain : uint8_t
strong

Analog rgbc gain control.

Enum ValuesDocumentation
X1 

x1 gain

X4 

x4 gain

X16 

x16 gain

X64 

x60 gain

DEFAULT 

default value on chip reset

template<typename I2cMaster >
enum modm::tcs3472::IntegrationTime : uint8_t
strong

Integration for a fixed time.

Enum ValuesDocumentation
MSEC_2 

integrate over 2.4 ms

MSEC_24 

integrate over 100 ms

MSEC_101 

integrate over 101 ms

MSEC_154 

integrate over 154 ms

MSEC_700 

integrate over 700 ms

DEFAULT 

default value on chip reset

template<typename I2cMaster >
enum modm::tcs3472::RegisterAddress : uint8_t
strong

Register addresses.

Enum ValuesDocumentation
ENABLE 

Primarily to power up the device.

TIMING 

Integration time control.

See also
tcs3472::setIntegrationTime
ID 

Part number.

GAIN 

Sensitivity settings.

See also
Tcs3414::setGain
LOW_THRESH_LOW_BYTE 

Low byte of low interrupt threshold.

LOW_THRESH_HIGH_BYTE 

High byte of low interrupt threshold.

HIGH_THRESH_LOW_BYTE 

Low byte of high interrupt threshold.

HIGH_THRESH_HIGH_BYTE 

High byte of high interrupt threshold.

CDATALOW 

Low byte of ADC clear channel.

CDATAHIGH 

High byte of ADC clear channel.

RDATALOW 

Low byte of ADC red channel.

RDATAHIGH 

High byte of ADC red channel.

GDATALOW 

Low byte of ADC green channel.

GDATAHIGH 

High byte of ADC green channel.

BDATALOW 

Low byte of ADC blue channel.

BDATAHIGH 

High byte of ADC blue channel.


The documentation for this class was generated from the following file: