CircuitsSim.Device.VCNL4040 (circuits_sim v0.1.2)

View Source

VCNL4040 ambient light and proximity sensor

Typically found at 0x60 See the datasheet Many configuration options aren't implemented.

Call set_proximity/3, set_ambient_light/3, and set_white_light/3 to change the state of the sensor.

Summary

Types

t()

@type t() :: %CircuitsSim.Device.VCNL4040{
  als_config: 0..65535,
  als_high_threshold: 0..65535,
  als_low_threshold: 0..65535,
  ambient_light_raw: 0..65535,
  proximity_raw: 0..65535,
  ps_cancellation_level: 0..65535,
  ps_config_1: 0..65535,
  ps_config_2: 0..65535,
  ps_high_threshold: 0..65535,
  ps_low_threshold: 0..65535,
  white_light_raw: 0..65535
}

Functions

child_spec(args)

@spec child_spec(keyword()) :: Supervisor.child_spec()

new(options \\ [])

@spec new(keyword()) :: t()

set_ambient_light(bus_name, address, value)

@spec set_ambient_light(String.t(), Circuits.I2C.address(), number()) :: :ok

set_proximity(bus_name, address, value)

@spec set_proximity(String.t(), Circuits.I2C.address(), number()) :: :ok

set_white_light(bus_name, address, value)

@spec set_white_light(String.t(), Circuits.I2C.address(), number()) :: :ok