Max31865.Server (max31865 v0.1.0)

Server to interact with Max31865 connected via SPI.

config-options

Config options

  • rtd_nominal: The expected resistance of the RTD at 0 degrees C. Typically 100.
  • ref_resistor: The resistance of the reference resistor. Defaults to 430.0 for use with the PT100. Set to 4300.0 for the PT1000.
  • spi_device: The SPI device being used. Defaults to 0.
  • spi_device_cs_pin: The CS pin for the SPI device being used. Defaults to 0.
  • rtd_wires: Whether 3 wire mode should be enabled. Defaults to false for use in 2/4 wire mode. Set to true for use in 3 wire mode.
  • auto_convert: Whether auto-conversion mode should be used - if true, the module will constantly measure resistance. This introduces self heating as it requires the VBias to be enabled constantly, so unless you have a particular need for it, using one shot measurements is recommended.
  • filter_select_mode: Determines whether to filter for 50hz or 60hz noise from the mains. If you live in North America, the default (60) will work.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Clears any faults set in the Fault Register.

Returns a Config Register struct with the current contents of the register.

Returns the reference to the SPI connection that was opened for this Server.

Returns the resistance calculated from the RTD.

Returns the temperature in degrees celcius. The result is calculated mathematically using the formula found in the datasheet: https://datasheets.maximintegrated.com/en/ds/MAX31865.pdf

Link to this section Types

@type t() :: %Max31865.Server{
  auto_convert: boolean(),
  filter_select_mode: integer(),
  max_ref: any() | nil,
  name: atom(),
  ref_resistor: float(),
  rtd_nominal: integer(),
  rtd_wires: integer(),
  spi_device: integer(),
  spi_device_cs_pin: integer()
}

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

clear_faults(name \\ __MODULE__)

Clears any faults set in the Fault Register.

Link to this function

get_config(name \\ __MODULE__)

Returns a Config Register struct with the current contents of the register.

Link to this function

get_max_ref(name \\ __MODULE__)

Returns the reference to the SPI connection that was opened for this Server.

Link to this function

get_resistance(name \\ __MODULE__)

Returns the resistance calculated from the RTD.

Link to this function

get_temp(name \\ __MODULE__)

Returns the temperature in degrees celcius. The result is calculated mathematically using the formula found in the datasheet: https://datasheets.maximintegrated.com/en/ds/MAX31865.pdf

Link to this function

start_link(config)