Veethree D7 SDK
Loading...
Searching...
No Matches
vsdk::io::digital_context_interface Class Referenceabstract

Detailed Description

Interface for classes that provide data to digital and PWM channels.

By default, digital_in_channel, digital_out_channel, pwm_in_channel and pwm_out_channel can use digital_context_instance function for a shared default instance to provide data.

If there is a need to customise the behaviour of a context object, inherit from digital_context_interface and use the digital and PWM constructors that take an instance.

#include <digital_context_interface.h>

Public Member Functions

virtual void set_pwm_in (const pwm_in_descriptor &desc)=0
 set_pwm_in Set the PWM input channel as described by the descriptor.
virtual void set_pwm_out (const pwm_out_channel *channel, bool state)=0
 set_pwm_out Set the PWM out channel to the desiried state.
virtual pwm_result read_pwm_in (const pwm_in_channel *channel) const =0
 read_pwm_in Read the state of a PWM input channel.
virtual void set_digital_out (const digital_out_channel *channel, bool state)=0
 set_digital_out Set the digital output channel to the desired state.
virtual void set_digital_in (const digital_in_channel *channel, bool state)=0
 set_digital_in Set the digital input channel to the desired state.
virtual digital_result read_digital_in (const digital_in_channel *channel) const =0
 read_digital_in Read the state of the digital input channel.

Detailed Description

Interface for classes that provide data to digital and PWM channels.

By default, digital_in_channel, digital_out_channel, pwm_in_channel and pwm_out_channel can use digital_context_instance function for a shared default instance to provide data.

If there is a need to customise the behaviour of a context object, inherit from digital_context_interface and use the digital and PWM constructors that take an instance.

Member Function Documentation

◆ read_digital_in()

virtual digital_result vsdk::io::digital_context_interface::read_digital_in ( const digital_in_channel * channel) const
pure virtual

read_digital_in Read the state of the digital input channel.

Read will return a bool value indicating high or low

Parameters
channelThe channel to be read from.
Returns
A io_result containing the status and value for the channel.

Implemented in vsdk::io::digital_context.

◆ read_pwm_in()

virtual pwm_result vsdk::io::digital_context_interface::read_pwm_in ( const pwm_in_channel * channel) const
pure virtual

read_pwm_in Read the state of a PWM input channel.

Parameters
channelThe channel to read from.
Returns
A io_result containing the status and value for the channel in Hz.

Implemented in vsdk::io::digital_context.

◆ set_digital_in()

virtual void vsdk::io::digital_context_interface::set_digital_in ( const digital_in_channel * channel,
bool state )
pure virtual

set_digital_in Set the digital input channel to the desired state.

Parameters
channelThe channel to be modified.
stateTrue enables readings for the channel, false disables the channel.

Implemented in vsdk::io::digital_context.

◆ set_digital_out()

virtual void vsdk::io::digital_context_interface::set_digital_out ( const digital_out_channel * channel,
bool state )
pure virtual

set_digital_out Set the digital output channel to the desired state.

Parameters
channelThe channel to be modified.
stateThe desired state for the channel, true enables the output, false disables the output.

Implemented in vsdk::io::digital_context.

◆ set_pwm_in()

virtual void vsdk::io::digital_context_interface::set_pwm_in ( const pwm_in_descriptor & desc)
pure virtual

set_pwm_in Set the PWM input channel as described by the descriptor.

Parameters
descA PWM input descriptor.

Implemented in vsdk::io::digital_context.

◆ set_pwm_out()

virtual void vsdk::io::digital_context_interface::set_pwm_out ( const pwm_out_channel * channel,
bool state )
pure virtual

set_pwm_out Set the PWM out channel to the desiried state.

Parameters
channelThe channel to be modified
stateThe desired state for the channel, true enables the output, false disables the output.

Implemented in vsdk::io::digital_context.


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