[][src]Struct tinkerforge::ptc_bricklet::PtcBricklet

pub struct PtcBricklet { /* fields omitted */ }

Reads temperatures from Pt100 und Pt1000 sensors

Methods

impl PtcBricklet[src]

pub const DEVICE_IDENTIFIER: u16[src]

pub const DEVICE_DISPLAY_NAME: &'static str[src]

pub fn new<T: GetRequestSender>(uid: &str, req_sender: T) -> PtcBricklet[src]

Creates an object with the unique device ID uid. This object can then be used after the IP Connection ip_connection is connected.

pub fn get_response_expected(
    &mut self,
    fun: PtcBrickletFunction
) -> Result<bool, GetResponseExpectedError>
[src]

Returns the response expected flag for the function specified by the function ID parameter. It is true if the function is expected to send a response, false otherwise.

For getter functions this is enabled by default and cannot be disabled, because those functions will always send a response. For callback configuration functions it is enabled by default too, but can be disabled by set_response_expected. For setter functions it is disabled by default and can be enabled.

Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is send and errors are silently ignored, because they cannot be detected.

See set_response_expected for the list of function ID constants available for this function.

pub fn set_response_expected(
    &mut self,
    fun: PtcBrickletFunction,
    response_expected: bool
) -> Result<(), SetResponseExpectedError>
[src]

Changes the response expected flag of the function specified by the function ID parameter. This flag can only be changed for setter (default value: false) and callback configuration functions (default value: true). For getter functions it is always enabled.

Enabling the response expected flag for a setter function allows to detect timeouts and other error conditions calls of this setter as well. The device will then send a response for this purpose. If this flag is disabled for a setter function then no response is send and errors are silently ignored, because they cannot be detected.

pub fn set_response_expected_all(&mut self, response_expected: bool)[src]

Changes the response expected flag for all setter and callback configuration functions of this device at once.

pub fn get_api_version(&self) -> [u8; 3][src]

Returns the version of the API definition (major, minor, revision) implemented by this API bindings. This is neither the release version of this API bindings nor does it tell you anything about the represented Brick or Bricklet.

pub fn get_temperature_callback_receiver(
    &self
) -> ConvertingCallbackReceiver<i32>
[src]

This receiver is triggered periodically with the period that is set by set_temperature_callback_period. The parameter is the temperature of the connected sensor.

The get_temperature_callback_receiver receiver is only triggered if the temperature has changed since the last triggering.

pub fn get_temperature_reached_callback_receiver(
    &self
) -> ConvertingCallbackReceiver<i32>
[src]

This receiver is triggered when the threshold as set by set_temperature_callback_threshold is reached. The parameter is the temperature of the connected sensor.

If the threshold keeps being reached, the receiver is triggered periodically with the period as set by set_debounce_period.

pub fn get_resistance_callback_receiver(
    &self
) -> ConvertingCallbackReceiver<i32>
[src]

This receiver is triggered periodically with the period that is set by set_resistance_callback_period. The parameter is the resistance of the connected sensor.

The get_resistance_callback_receiver receiver is only triggered if the resistance has changed since the last triggering.

pub fn get_resistance_reached_callback_receiver(
    &self
) -> ConvertingCallbackReceiver<i32>
[src]

This receiver is triggered when the threshold as set by set_resistance_callback_threshold is reached. The parameter is the resistance of the connected sensor.

If the threshold keeps being reached, the receiver is triggered periodically with the period as set by set_debounce_period.

pub fn get_sensor_connected_callback_receiver(
    &self
) -> ConvertingCallbackReceiver<bool>
[src]

This receiver is triggered periodically according to the configuration set by set_sensor_connected_callback_configuration.

The parameter is the same as is_sensor_connected.

.. versionadded:: 2.0.2$nbsp;(Plugin)

pub fn get_temperature(&self) -> ConvertingReceiver<i32>[src]

Returns the temperature of connected sensor. The value has a range of -246 to 849 °C and is given in °C/100, e.g. a value of 4223 means that a temperature of 42.23 °C is measured.

If you want to get the temperature periodically, it is recommended to use the get_temperature_callback_receiver receiver and set the period with set_temperature_callback_period.

pub fn get_resistance(&self) -> ConvertingReceiver<i32>[src]

Returns the value as measured by the MAX31865 precision delta-sigma ADC.

The value can be converted with the following formulas:

  • Pt100: resistance = (value * 390) / 32768
  • Pt1000: resistance = (value * 3900) / 32768

If you want to get the resistance periodically, it is recommended to use the get_resistance_callback_receiver receiver and set the period with set_resistance_callback_period.

pub fn set_temperature_callback_period(
    &self,
    period: u32
) -> ConvertingReceiver<()>
[src]

Sets the period with which the get_temperature_callback_receiver receiver is triggered periodically. A value of 0 turns the receiver off.

The get_temperature_callback_receiver receiver is only triggered if the temperature has changed since the last triggering.

pub fn get_temperature_callback_period(&self) -> ConvertingReceiver<u32>[src]

Returns the period as set by set_temperature_callback_period.

pub fn set_resistance_callback_period(
    &self,
    period: u32
) -> ConvertingReceiver<()>
[src]

Sets the period with which the get_resistance_callback_receiver receiver is triggered periodically. A value of 0 turns the receiver off.

The get_resistance_callback_receiver receiver is only triggered if the resistance has changed since the last triggering.

pub fn get_resistance_callback_period(&self) -> ConvertingReceiver<u32>[src]

Returns the period as set by set_resistance_callback_period.

pub fn set_temperature_callback_threshold(
    &self,
    option: char,
    min: i32,
    max: i32
) -> ConvertingReceiver<()>
[src]

Sets the thresholds for the get_temperature_reached_callback_receiver receiver.

The following options are possible:

OptionDescription
'x'Receiver is turned off
'o'Receiver is triggered when the temperature is outside the min and max values
'i'Receiver is triggered when the temperature is inside the min and max values
'<'Receiver is triggered when the temperature is smaller than the min value (max is ignored)
'>'Receiver is triggered when the temperature is greater than the min value (max is ignored)

The default value is ('x', 0, 0).

Associated constants:

  • PTC_BRICKLET_THRESHOLD_OPTION_OFF
  • PTC_BRICKLET_THRESHOLD_OPTION_OUTSIDE
  • PTC_BRICKLET_THRESHOLD_OPTION_INSIDE
  • PTC_BRICKLET_THRESHOLD_OPTION_SMALLER
  • PTC_BRICKLET_THRESHOLD_OPTION_GREATER

pub fn get_temperature_callback_threshold(
    &self
) -> ConvertingReceiver<TemperatureCallbackThreshold>
[src]

Returns the threshold as set by set_temperature_callback_threshold.

Associated constants:

  • PTC_BRICKLET_THRESHOLD_OPTION_OFF
  • PTC_BRICKLET_THRESHOLD_OPTION_OUTSIDE
  • PTC_BRICKLET_THRESHOLD_OPTION_INSIDE
  • PTC_BRICKLET_THRESHOLD_OPTION_SMALLER
  • PTC_BRICKLET_THRESHOLD_OPTION_GREATER

pub fn set_resistance_callback_threshold(
    &self,
    option: char,
    min: i32,
    max: i32
) -> ConvertingReceiver<()>
[src]

Sets the thresholds for the get_resistance_reached_callback_receiver receiver.

The following options are possible:

OptionDescription
'x'Receiver is turned off
'o'Receiver is triggered when the temperature is outside the min and max values
'i'Receiver is triggered when the temperature is inside the min and max values
'<'Receiver is triggered when the temperature is smaller than the min value (max is ignored)
'>'Receiver is triggered when the temperature is greater than the min value (max is ignored)

The default value is ('x', 0, 0).

Associated constants:

  • PTC_BRICKLET_THRESHOLD_OPTION_OFF
  • PTC_BRICKLET_THRESHOLD_OPTION_OUTSIDE
  • PTC_BRICKLET_THRESHOLD_OPTION_INSIDE
  • PTC_BRICKLET_THRESHOLD_OPTION_SMALLER
  • PTC_BRICKLET_THRESHOLD_OPTION_GREATER

pub fn get_resistance_callback_threshold(
    &self
) -> ConvertingReceiver<ResistanceCallbackThreshold>
[src]

Returns the threshold as set by set_resistance_callback_threshold.

Associated constants:

  • PTC_BRICKLET_THRESHOLD_OPTION_OFF
  • PTC_BRICKLET_THRESHOLD_OPTION_OUTSIDE
  • PTC_BRICKLET_THRESHOLD_OPTION_INSIDE
  • PTC_BRICKLET_THRESHOLD_OPTION_SMALLER
  • PTC_BRICKLET_THRESHOLD_OPTION_GREATER

pub fn set_debounce_period(&self, debounce: u32) -> ConvertingReceiver<()>[src]

Sets the period with which the threshold receiver

is triggered, if the threshold

keeps being reached.

pub fn get_debounce_period(&self) -> ConvertingReceiver<u32>[src]

Returns the debounce period as set by set_debounce_period.

pub fn set_noise_rejection_filter(&self, filter: u8) -> ConvertingReceiver<()>[src]

Sets the noise rejection filter to either 50Hz (0) or 60Hz (1). Noise from 50Hz or 60Hz power sources (including harmonics of the AC power's fundamental frequency) is attenuated by 82dB.

Default value is 0 = 50Hz.

Associated constants:

  • PTC_BRICKLET_FILTER_OPTION_50HZ
  • PTC_BRICKLET_FILTER_OPTION_60HZ

pub fn get_noise_rejection_filter(&self) -> ConvertingReceiver<u8>[src]

Returns the noise rejection filter option as set by set_noise_rejection_filter

Associated constants:

  • PTC_BRICKLET_FILTER_OPTION_50HZ
  • PTC_BRICKLET_FILTER_OPTION_60HZ

pub fn is_sensor_connected(&self) -> ConvertingReceiver<bool>[src]

Returns true if the sensor is connected correctly.

If this function returns false, there is either no Pt100 or Pt1000 sensor connected, the sensor is connected incorrectly or the sensor itself is faulty.

pub fn set_wire_mode(&self, mode: u8) -> ConvertingReceiver<()>[src]

Sets the wire mode of the sensor. Possible values are 2, 3 and 4 which correspond to 2-, 3- and 4-wire sensors. The value has to match the jumper configuration on the Bricklet.

The default value is 2 = 2-wire.

Associated constants:

  • PTC_BRICKLET_WIRE_MODE_2
  • PTC_BRICKLET_WIRE_MODE_3
  • PTC_BRICKLET_WIRE_MODE_4

pub fn get_wire_mode(&self) -> ConvertingReceiver<u8>[src]

Returns the wire mode as set by set_wire_mode

Associated constants:

  • PTC_BRICKLET_WIRE_MODE_2
  • PTC_BRICKLET_WIRE_MODE_3
  • PTC_BRICKLET_WIRE_MODE_4

pub fn set_sensor_connected_callback_configuration(
    &self,
    enabled: bool
) -> ConvertingReceiver<()>
[src]

If you enable this receiver, the get_sensor_connected_callback_receiver receiver is triggered every time a Pt sensor is connected/disconnected.

By default this receiver is disabled.

.. versionadded:: 2.0.2$nbsp;(Plugin)

pub fn get_sensor_connected_callback_configuration(
    &self
) -> ConvertingReceiver<bool>
[src]

Returns the configuration as set by set_sensor_connected_callback_configuration.

.. versionadded:: 2.0.2$nbsp;(Plugin)

pub fn get_identity(&self) -> ConvertingReceiver<Identity>[src]

Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be 'a', 'b', 'c' or 'd'.

The device identifier numbers can be found here. |device_identifier_constant|

Trait Implementations

impl Clone for PtcBricklet[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self