Veethree D7 SDK
Loading...
Searching...
No Matches
vsdk::io::profile_builder Class Reference

Detailed Description

This is used to provide a valid profile for the analog class.

Note
This class will throw exceptions in the case of an invalid configuration

Sample code:

void fn()
{
using namespace vsdk::io;
profile_builder builder{};
builder.add_one_wire_resistive_sensor("rsns1", analog::pin_t::vrsns1);
builder.add_one_wire_resistive_sensor("rsns2", analog::pin_t::vrsns2);
builder.add_thermocouple("tc1", analog::thermocouple_t::type_r, analog::pin_t::vrsns3, analog::pin_t::vrsns4);
analog::analog_profile profile = builder.to_profile();
}
bool add_one_wire_resistive_sensor(std::string label, analog::pin_t positive_a)
Add a one wire resistive sensor.
bool add_thermocouple(std::string label, analog::thermocouple_t type, analog::pin_t positive_pin, analog::pin_t negative_pin)
Add a thermocouple.
analog::analog_profile to_profile()
Export the profile.
std::tuple< std::vector< sensor >, std::vector< function_channel > > analog_profile
Representation of an analog profile.
Definition analog.h:32
Any entities that belong to the IO library.
The profile builder interface.

#include <profile_builder.h>

Public Member Functions

analog::analog_profile to_profile ()
 Export the profile.
bool add_one_wire_resistive_sensor (std::string label, analog::pin_t positive_a)
 Add a one wire resistive sensor.
bool add_two_wire_resistive_sensor (std::string label, analog::pin_t positive_a)
 Add a two wire resistive sensor which uses RREF for a more accurate reading. The trade-off is that only half of the pins are available for this sensor.
bool add_voltage_sensor (std::string label, analog::pin_t positive_pin)
 Add a voltage sensor.
bool add_thermocouple (std::string label, analog::thermocouple_t type, analog::pin_t positive_pin, analog::pin_t negative_pin)
 Add a thermocouple.
bool add_two_wire_rtd (std::string label, analog::pin_t positive_a)
 Add a 2 wire Pt100 resistive thermal detector.
bool add_three_wire_rtd (std::string label, analog::pin_t positive_a, analog::pin_t negative_b)
 Add a 3 wire Pt100 resistive thermal detector.
bool add_four_wire_rtd (std::string label, analog::pin_t positive_a, analog::pin_t negative_b, analog::pin_t positive_b)
 Add a 4 wire Pt100 resistive thermal detector.
 ~profile_builder ()
 Destructor.
 profile_builder (const profile_builder &)=delete
 Deleted constructors.
 profile_builder (profile_builder &&)=delete
 Deleted constructors.
profile_builder & operator= (const profile_builder &)=delete
 Deleted constructors.
profile_builder & operator= (profile_builder &&)=delete
 Deleted constructors.

Detailed Description

This is used to provide a valid profile for the analog class.

Note
This class will throw exceptions in the case of an invalid configuration

Sample code:

void fn()
{
using namespace vsdk::io;
profile_builder builder{};
builder.add_one_wire_resistive_sensor("rsns1", analog::pin_t::vrsns1);
builder.add_one_wire_resistive_sensor("rsns2", analog::pin_t::vrsns2);
builder.add_thermocouple("tc1", analog::thermocouple_t::type_r, analog::pin_t::vrsns3, analog::pin_t::vrsns4);
analog::analog_profile profile = builder.to_profile();
}

Member Function Documentation

◆ add_four_wire_rtd()

bool vsdk::io::profile_builder::add_four_wire_rtd ( std::string label,
analog::pin_t positive_a,
analog::pin_t negative_b,
analog::pin_t positive_b )

Add a 4 wire Pt100 resistive thermal detector.

Note
The first white wire should be tied to the RREF pin
Parameters
labelUser chosen label - used to get a handle on the sensor
positive_aThe first positive wire (vrsns0, vrsns1, vrsns2, vrsns3, vrsns4, vrsns5)
negative_bThe second negative wire (vrsns0, vrsns2, vrsns4)
positive_bThe second positive wire (vrsns1, vrsns3, vrsns5)

◆ add_one_wire_resistive_sensor()

bool vsdk::io::profile_builder::add_one_wire_resistive_sensor ( std::string label,
analog::pin_t positive_a )

Add a one wire resistive sensor.

Note
The negative connection should be tied to the AGND pin. If using D7 board v5 and below, connect the negative end to BATT- (this may cause an offset error when reading resistance)
Parameters
labelUser chosen label - used to get a handle on the sensor
positive_aWhich pin should be used as the positive input (vrsns0, vrsns1, vrsns2, vrsns3, vrsns4, vrsns5)

◆ add_thermocouple()

bool vsdk::io::profile_builder::add_thermocouple ( std::string label,
analog::thermocouple_t type,
analog::pin_t positive_pin,
analog::pin_t negative_pin )

Add a thermocouple.

Parameters
labelUser chosen label - used to get a handle on the sensor
typeThe type of thermocouple
positive_pinThe positive pin connection (vrsns1, vrsns3, vrsns5)
negative_pinThe negative pin connection (vrsns0, vrsns2, vrsns4)

◆ add_three_wire_rtd()

bool vsdk::io::profile_builder::add_three_wire_rtd ( std::string label,
analog::pin_t positive_a,
analog::pin_t negative_b )

Add a 3 wire Pt100 resistive thermal detector.

Note
The first white wire should be tied to the RREF pin
Parameters
labelUser chosen label - used to get a handle on the sensor
positive_aThe first positive wire (vrsns1, vrsns3, vrsns5)
negative_bThe second negative wire (vrsns0, vrsns2, vrsns4)

◆ add_two_wire_resistive_sensor()

bool vsdk::io::profile_builder::add_two_wire_resistive_sensor ( std::string label,
analog::pin_t positive_a )

Add a two wire resistive sensor which uses RREF for a more accurate reading. The trade-off is that only half of the pins are available for this sensor.

Note
The negative connection should be tied to the RREF pin.
Parameters
labelUser chosen label - used to get a handle on the sensor
positive_aWhich pin should be used as the positive input (vrsns1, vrsns3, vrsns5)

◆ add_two_wire_rtd()

bool vsdk::io::profile_builder::add_two_wire_rtd ( std::string label,
analog::pin_t positive_a )

Add a 2 wire Pt100 resistive thermal detector.

Note
The first white wire should be tied to the RREF pin
Parameters
labelUser chosen label - used to get a handle on the sensor
positive_aThe first positive wire (vrsns1, vrsns3, vrsns5)

◆ add_voltage_sensor()

bool vsdk::io::profile_builder::add_voltage_sensor ( std::string label,
analog::pin_t positive_pin )

Add a voltage sensor.

Note
The negative connection should be tied to the AGND pin
Parameters
labelUser chosen label - used to get a handle on the sensor
positive_pinWhich pin should be used as the input (vrsns0, vrsns1, vrsns2, vrsns3, vrsns4, vrsns5)

◆ to_profile()

analog::analog_profile vsdk::io::profile_builder::to_profile ( )

Export the profile.

Note
The profile is moved out leaving the configuration empty

The documentation for this class was generated from the following file: