CircuitsSim.Device.VCNL4040 (circuits_sim v0.1.2)
View SourceVCNL4040 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
@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
@spec child_spec(keyword()) :: Supervisor.child_spec()
@spec set_ambient_light(String.t(), Circuits.I2C.address(), number()) :: :ok
@spec set_proximity(String.t(), Circuits.I2C.address(), number()) :: :ok
@spec set_white_light(String.t(), Circuits.I2C.address(), number()) :: :ok