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

Detailed Description

Any entities that belong to the IO library.

Namespaces

namespace  analog
 Anything related to configuring or reading analog sensors.
namespace  digin
 Any types used for digital and PWM input.
namespace  digout
 Any types used for digital and PWM output.

Classes

class  digital_context
 The digital class. More...
class  digital_context_interface
 Interface for classes that provide data to digital and PWM channels. More...
class  digital_in_channel
 The digital_in_channel class. More...
struct  digital_in_descriptor
 The digital_in_descriptor class. More...
class  digital_out_channel
 The digital_out_channel class. More...
struct  digital_out_descriptor
 The digital_out_descriptor class. More...
class  event
 The event class interface. More...
class  event_data
 The event_data class. More...
class  event_notification
 The event_notification class. More...
struct  event_notification_descriptor
 The event_notification_descriptor class. More...
struct  event_notification_schedule
 The event_notification_schedule class. More...
class  event_queue
 The event_queue class. More...
class  event_source
 Describes the source of an event. More...
class  i420
 The i420 class. More...
class  i420_context
 The i420 context class provides lower level access to the 4-20 mA inputs. More...
class  i420_context_interface
 Common interface for classes providing lower level access to vsdk::io::i420. More...
class  io_category
 The io_category class. More...
struct  io_result
 IO result template. More...
class  libio_error
 The libio_error class. More...
class  module_value
 The module_value class. More...
class  profile_builder
 This is used to provide a valid profile for the analog class. More...
class  pwm_in_channel
 The pwm_in_channel class. More...
struct  pwm_in_descriptor
 The pwm_in_descriptor class. More...
class  pwm_out_channel
 The pwm_out_channel class. More...
struct  pwm_out_descriptor
 The pwm_out_descriptor classHolds the configuration for a pwm_out_channel. More...
class  range_event
 The range_event class. More...
class  range_event_data
 The range_event_data class. More...
struct  range_value
 A range value start-end pair. More...
class  source_location
 The source_location class. More...
class  state_event
 The state_event class. More...
class  state_event_data
 The state_event_data class. More...
class  threshold_event
 The threshold_event class. More...
class  threshold_event_data
 The threshold_event_data class. More...

Typedefs

using analog_result = io_result<double>
 Analog result type.
using pwm_result = io_result<float>
 PWM result type.
using digital_result = io_result<bool>
 Digital result type.
using event_notification_id = uint32_t
 Identifies a specific notification entry.
using event_handler = std::function<void(std::shared_ptr<event>)>
 Event handler function definition.
using event_handler_id = uint32_t
 Event handler Id.

Enumerations

enum class  i420_input : uint8_t {
  i420_input::sns0 , i420_input::sns1 , i420_input::sns2 , i420_input::sns3 ,
  i420_input::sns4 , i420_input::sns5 , i420_input::cal_1v65 , i420_input::cal_0v15 ,
  i420_input::vsns_main , i420_input::isns_main
}
 The sense input names. More...
enum class  io_status : uint8_t {
  ok , unknown , error , open_circuit ,
  out_of_range , nafe_sys_alarm , nafe_sys_clock_alarm_error , nafe_sys_die_temp_over_threshold ,
  nafe_sys_pga_overloaded , nafe_ch_viex_alarm , nafe_ch_adc_loaded , invalid_sensor
}
 Status codes for all IO operations. More...
enum class  io_unit : uint8_t {
  none , volts , milli_volts , ohms ,
  celsius , hertz , kilohertz , milli_amps ,
  percent
}
 Unified unit types for IO measurements. More...
enum class  io_module : uint8_t {
  none , digital , digout , digin ,
  pwm_out , pwm_in , analog , i420 ,
  event
}
 The io_module enum. More...
enum class  io_error : uint8_t {
  none , error , parameter , enable ,
  disable , read , write , ioctl ,
  open , close , start , stop ,
  get , set
}
 The io_error enum. More...
enum class  event_type : uint8_t {
  event_type::none , event_type::threshold_above , event_type::threshold_below , event_type::out_of_range ,
  event_type::in_range , event_type::state_change , event_type::target_state
}
 Describes the event type. More...
enum class  event_notification_frequency : uint8_t { event_notification_frequency::continuous , event_notification_frequency::single_shot }
 Specifies the type of notifications. More...

Functions

template<typename T>
int channel_cast (T)
 Channel enumeration cast to integer.
template<>
int channel_cast (digin::channel ch)
 Channel enumeration cast to integer.
template<>
int channel_cast (digout::channel ch)
 Channel enumeration cast to integer.
template<>
int channel_cast (digout::pwm ch)
 Channel enumeration cast to integer.
template<>
int channel_cast (digin::pwm ch)
 Channel enumeration cast to integer.
std::shared_ptr< digital_context_interface > digital_context_instance ()
 Returns a single instance for the digital context object.
std::error_code make_io_error (io_error ec)
 Convenience function to be used when throwing std::system_error exceptions.
constexpr const char * to_string (io_status status)
constexpr const char * to_string (io_unit unit)

Detailed Description

Any entities that belong to the IO library.

Enumeration Type Documentation

◆ io_error

enum class vsdk::io::io_error : uint8_t
strong

The io_error enum.

This enum class describes all possible errors that can happen in libio.

Enumerator
none 

no error, default value when type is initialised

error 

generic error

parameter 

invalid parameter

enable 

enable operation failed

disable 

disable operation failed

read 

read operation failed

write 

write operation failed

ioctl 

ioctl operation failed

open 

open operation failed

close 

close operation failed

start 

start operation failed

stop 

stop operation failed

get 

get operation failed

set 

set operation failed

◆ io_module

enum class vsdk::io::io_module : uint8_t
strong

The io_module enum.

This enum class describes all submodules in libio.

Enumerator
none 

None means the value was not set.

digital 

Digital I/O shared context.

digout 

Digital Output.

digin 

Digital Input.

pwm_out 

PWM Output.

pwm_in 

PWM Input.

analog 

Analog.

i420 

4-20 mA

event 

Events subsystem.

◆ io_status

enum class vsdk::io::io_status : uint8_t
strong

Status codes for all IO operations.

Enumerator
ok 

Operation successful.

unknown 

Unknown.

error 

Generic error.

open_circuit 

Input is open/disconnected.

out_of_range 

Value is out of valid range.

nafe_sys_alarm 

NAFE system alarm.

nafe_sys_clock_alarm_error 

NAFE clock period drift.

nafe_sys_die_temp_over_threshold 

NAFE temperature warning.

nafe_sys_pga_overloaded 

NAFE PGA overload.

nafe_ch_viex_alarm 

NAFE VIEX over voltage/current.

nafe_ch_adc_loaded 

Channel ADC over/underloaded.

invalid_sensor 

Invalid sensor state.

◆ io_unit

enum class vsdk::io::io_unit : uint8_t
strong

Unified unit types for IO measurements.

Enumerator
none 

No unit.

volts 

Voltage.

milli_volts 

milli_volts

ohms 

Resistance.

celsius 

Temperature.

hertz 

Frequency.

kilohertz 

Kilohertz.

milli_amps 

milli_amps

percent 

Percentage.

Function Documentation

◆ channel_cast() [1/5]

template<>
int vsdk::io::channel_cast ( digin::channel ch)
inline

Channel enumeration cast to integer.

Convenience template for type-casting digin::channel to integers.

Note
You must not assume that enum value name maps to the corresponding integer.
  • Example: actual enum values ch0 is 1, none is 0, etc.
  • 'none' values must be -1.

◆ channel_cast() [2/5]

template<>
int vsdk::io::channel_cast ( digin::pwm ch)
inline

Channel enumeration cast to integer.

Convenience template for type-casting digin::pwm to integers.

Note
You must not assume that enum value name maps to the corresponding integer.
  • Example: actual enum values ch0 is 1, none is 0, etc.
  • 'none' values must be -1.

◆ channel_cast() [3/5]

template<>
int vsdk::io::channel_cast ( digout::channel ch)
inline

Channel enumeration cast to integer.

Convenience template for type-casting digout::channel to integers.

Note
You must not assume that enum value name maps to the corresponding integer.
  • Example: actual enum values ch0 is 1, none is 0, etc.
  • 'none' values must be -1.

◆ channel_cast() [4/5]

template<>
int vsdk::io::channel_cast ( digout::pwm ch)
inline

Channel enumeration cast to integer.

Convenience template for type-casting digout::pwm to integers.

Note
You must not assume that enum value name maps to the corresponding integer.
  • Example: actual enum values ch0 is 1, none is 0, etc.
  • 'none' values must be -1.

◆ channel_cast() [5/5]

template<typename T>
int vsdk::io::channel_cast ( T )

Channel enumeration cast to integer.

Convenience templates for type-casting digin or digout channels to integers. They are necessary as the enum classes do not map the enum value to an integer.

Note
You must not assume that enum value name maps to the corresponding integer.
  • Example: actual enum values ch0 is 1, none is 0, etc.
  • 'none' values must be -1.

◆ digital_context_instance()

std::shared_ptr< digital_context_interface > vsdk::io::digital_context_instance ( )

Returns a single instance for the digital context object.

The digital context object must implement the digital_context_interface.

Returns
A unique instance for the default context.

◆ make_io_error()

std::error_code vsdk::io::make_io_error ( io_error ec)

Convenience function to be used when throwing std::system_error exceptions.

This function returns a std::error_code object based on an io_error value and the io_category instance.

Parameters
ecThe error code, vsdk::io::io_error.
Returns
A std::error_code object based on an io_error code.

◆ to_string() [1/2]

const char * vsdk::io::to_string ( io_status status)
constexpr
Returns
A string representation for io_status

◆ to_string() [2/2]

const char * vsdk::io::to_string ( io_unit unit)
constexpr
Returns
A string representation for io_unit