Crate bh1730fvc

Crate bh1730fvc 

Source
Expand description

This crate provides a platform agnostic no_std driver for the BH1730FVC ambient light sensor. The driver is compatible with the embedded-hal traits.

The datasheet of the sensor can be found here.

§Supported features

  • Both blocking and async support
  • Single-shot and continuous measurement mode
  • Configurable integration time and gain
  • Reading the part number and revision id of the sensor
  • Converting the read raw values into the ambient light intensity in lux

§Unsupported features

  • Interrupt functionality
  • Threshold functionality

§Usage

By default, the driver is in blocking mode. To use the driver in async mode, enable the async feature.

The documentation and examples of both modes can be found in the respective modules blocking and async.

§Unit tests

The unit tests are only working with a specific feature flag enabled. To run the tests, use the following command:

cargo test --features unittesting

The reason for the feature flag is that the mock hal implementation is not no_std and thus cannot be part of a build for a no_std target.

Modules§

async
Async API
blocking
Blocking API

Enums§

BH1730FVCError
Represents any error that may happen during communication.
DataRegister
Gain
The gain of the BH1730FVC sensor.
Mode
The mode of the BH1730FVC sensor.

Constants§

BH1730FVC_ADDR
I2C address for the BH1730FVC sensor.