Struct tcs3400::Tcs3400

source ·
pub struct Tcs3400<I2C> { /* private fields */ }
Expand description

TCS3400 device driver.

Implementations

Enable the device (Power ON).

The device goes to idle state.

Disable the device (sleep).

Enable the RGB converter.

Disable the RGB converter.

Enable the RGB converter interrupt generation.

Disable the RGB converter interrupt generation.

Enable the wait feature (wait timer).

Disable the wait feature (wait timer).

Set the number of wait time cycles (1-256).

The actual wait time depends on the “wait long” setting.

  • If wait long is disabled, then the wait time corresponds to: number_of_cycles * 2.78ms.
  • If wait long is enabled, then the wait time is increased by a factor of 12 and therefore corresponds to aproximately: number_of_cycles * 0.03s. See enable_wait_long() and disable_wait_long().

Enable the wait long setting.

The wait time configured with set_wait_cycles() is increased by a factor of 12. See set_wait_cycles().

Disable the wait long setting.

The wait time configured with set_wait_cycles() is used without multiplication factor. See set_wait_cycles().

Set the RGB converter gain.

Set the number of integration cycles (1-256).

The actual integration time corresponds to: number_of_cycles * 2.78ms.

Set the RGB converter interrupt clear channel low threshold.

Set the RGB converter interrupt clear channel high threshold.

Set the RGB converter interrupt persistence.

This controls the RGB converter interrupt generation rate.

Check whether the RGB converter status is valid.

Indicates that the RGBC channels have completed an integration cycle.

Read the clear (unfiltered) channel measurement data.

Read the red channel measurement data.

Read the green channel measurement data.

Read the blue channel measurement data.

Read the measurement data of all channels at once.

Read the device ID.

The value returned corresponds to the part number identification:

  • 0x90 => TCS34001 & TCS34005
  • 0x93 => TCS34003 & TCS34007

Create new instance of the TCS3400 device.

Destroy driver instance, return I²C bus instance.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.