View Source APDS9960.Proximity (apds9960 v0.4.0)

The proximity detection.

Link to this section Summary

Link to this section Functions

Specs

clear_interrupt(APDS9960.Sensor.t()) :: :ok
Link to this function

enable(sensor, value \\ 1)

View Source

Specs

enable(APDS9960.Sensor.t(), 0 | 1) :: :ok
Link to this function

enable_interrupt(sensor, value \\ 1)

View Source

Specs

enable_interrupt(APDS9960.Sensor.t(), 0 | 1) :: :ok
Link to this function

enable_saturation_interrupt(sensor, value \\ 1)

View Source

Specs

enable_saturation_interrupt(APDS9960.Sensor.t(), 0 | 1) :: :ok

Specs

enabled?(APDS9960.Sensor.t()) :: boolean()

Specs

get_gain(APDS9960.Sensor.t()) :: 0..3
Link to this function

get_gain_compensation(sensor)

View Source

Specs

get_gain_compensation(APDS9960.Sensor.t()) :: %{
  enabled: boolean(),
  mask: byte()
}
Link to this function

get_interrupt_persistence(sensor)

View Source

Specs

get_interrupt_persistence(APDS9960.Sensor.t()) :: 0..15

Specs

get_led_boost(APDS9960.Sensor.t()) :: 0..3

Specs

get_led_drive(APDS9960.Sensor.t()) :: 0..3

Specs

get_offset(APDS9960.Sensor.t()) :: %{down_left: -127..127, up_right: -127..127}

Specs

get_pulse(APDS9960.Sensor.t()) :: %{count: byte(), length: 0..3}

Specs

get_threshold(APDS9960.Sensor.t()) :: %{high: byte(), low: byte()}
Link to this function

interrupt_enabled?(sensor)

View Source

Specs

interrupt_enabled?(APDS9960.Sensor.t()) :: boolean()
Link to this function

read_proximity(sensor, opts \\ [])

View Source

Specs

read_proximity(APDS9960.Sensor.t(), Enum.t()) :: byte()
Link to this function

saturation_interrupt_enabled?(sensor)

View Source

Specs

saturation_interrupt_enabled?(APDS9960.Sensor.t()) :: boolean()

Specs

set_gain(APDS9960.Sensor.t(), 0..3) :: :ok
Link to this function

set_gain_compensation(sensor, mask)

View Source

Specs

set_gain_compensation(APDS9960.Sensor.t(), 0..14) :: :ok
Link to this function

set_interrupt_persistence(sensor, value)

View Source

Specs

set_interrupt_persistence(APDS9960.Sensor.t(), 0..15) :: :ok
Link to this function

set_led_boost(sensor, value \\ 1)

View Source

Specs

set_led_boost(APDS9960.Sensor.t(), 0..3) :: :ok
Link to this function

set_led_drive(sensor, value)

View Source

Specs

set_led_drive(APDS9960.Sensor.t(), 0..3) :: :ok
Link to this function

set_offset(sensor, opts)

View Source

Specs

set_offset(APDS9960.Sensor.t(), Enum.t()) :: :ok

Specs

set_pulse(APDS9960.Sensor.t(), Enum.t()) :: :ok
Link to this function

set_threshold(sensor, opts)

View Source

Specs

set_threshold(APDS9960.Sensor.t(), Enum.t()) :: :ok

Specs

settings(APDS9960.Sensor.t()) :: %{
  enabled: boolean(),
  gain: 0..3,
  gain_compensation: %{enabled: boolean(), mask: byte()},
  interrupt_enabled: boolean(),
  interrupt_persistence: byte(),
  led_boost: 0..3,
  led_drive: 0..3,
  offset: %{down_left: integer(), up_right: integer()},
  pulse: %{count: byte(), length: 0..3},
  saturation_interrupt_enabled: boolean(),
  threshold: %{high: byte(), low: byte()}
}

Returns all the current proximity settings.

Specs

status(APDS9960.Sensor.t()) :: %{
  interrupt: boolean(),
  saturation: boolean(),
  valid: boolean()
}