CircuitsSim.Device.SGP30 (circuits_sim v0.1.2)

View Source

Sensirion SGP30 gas sensor

Typically found at 0x58 See the datasheet Many features aren't implemented.

Call the following functions to change the state of the sensor.

Summary

Types

options()

@type options() :: [{:serial, integer()}]

t()

@type t() :: %CircuitsSim.Device.SGP30{
  co2_eq_ppm: integer(),
  current: atom(),
  ethanol_raw: integer(),
  h2_raw: integer(),
  serial: integer(),
  tvoc_ppb: integer()
}

Functions

child_spec(args)

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

new(options \\ [])

@spec new(options()) :: %CircuitsSim.Device.SGP30{
  co2_eq_ppm: 0,
  current: nil,
  ethanol_raw: 0,
  h2_raw: 0,
  serial: 0,
  tvoc_ppb: 0
}

set_co2_eq_ppm(bus_name, address, value)

@spec set_co2_eq_ppm(String.t(), Circuits.I2C.address(), integer()) :: :ok

set_ethanol_raw(bus_name, address, value)

@spec set_ethanol_raw(String.t(), Circuits.I2C.address(), integer()) :: :ok

set_h2_raw(bus_name, address, value)

@spec set_h2_raw(String.t(), Circuits.I2C.address(), integer()) :: :ok

set_tvoc_ppb(bus_name, address, value)

@spec set_tvoc_ppb(String.t(), Circuits.I2C.address(), integer()) :: :ok