ads1115 v0.2.0 ADS1115.Config

A struct representing the configuration of an ADS1115 chip.

This module handles decoding the 2-byte binary representation of the register into a struct and also encoding a struct back into the 2-byte binary representation. For details about what the various configuration options mean, please see the datasheet.

Link to this section Summary

Link to this section Types

Link to this type

comp_mode()
comp_mode() :: :traditional | :window

Link to this type

comp_polarity()
comp_polarity() :: :active_low | :active_high

Link to this type

comp_queue()
comp_queue() :: 1 | 2 | 3 | :disabled

Link to this type

comparison()
comparison() ::
  {:ain0, :ain1 | :ain3 | :gnd}
  | {:ain1, :ain3 | :gnd}
  | {:ain2, :ain3 | :gnd}
  | {:ain3, :gnd}

Link to this type

data_rate()
data_rate() :: 8 | 16 | 32 | 64 | 128 | 250 | 475 | 860

Link to this type

gain()
gain() :: 256 | 512 | 1024 | 2048 | 4096 | 6144

Link to this type

mode()
mode() :: :continuous | :single_shot

Link to this type

t()
t() :: %ADS1115.Config{
  comp_latch: true | false,
  comp_mode: comp_mode(),
  comp_polarity: comp_polarity(),
  comp_queue: comp_queue(),
  data_rate: data_rate(),
  gain: gain(),
  mode: mode(),
  mux: comparison(),
  performing_conversion: true | false
}

Link to this section Functions

Link to this function

decode(bytes)
decode(<<_::16>>) :: t()

Link to this function

encode(config)
encode(t()) :: <<_::16>>