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

Detailed Description

The pwm_in_channel class.

This class holds the configuration and value for a single PWM input channel.

#include <pwm_in_channel.h>

Public Member Functions

 pwm_in_channel (const pwm_in_descriptor &desc)
 The class constructor.
 pwm_in_channel (std::shared_ptr< digital_context_interface > instance, const pwm_in_descriptor &desc)
 The class constructor.
 ~pwm_in_channel () noexcept override
 The class destructor.
pwm_result read () const
 Read the current value of the channel.
pwm_in_descriptor descriptor () const
 Return a descriptor with the channel configuration used when the class was instantiated.
 pwm_in_channel (const pwm_in_channel &other)=delete
 pwm_in_channel (pwm_in_channel &&other) noexcept
pwm_in_channel & operator= (const pwm_in_channel &other)=delete
pwm_in_channel & operator= (pwm_in_channel &&other) noexcept
Public Member Functions inherited from vsdk::io::event_notification
virtual event_notification_id add_notification (const event_notification_descriptor &desc)
 Add a definition when an event must be notified.
virtual bool remove_notification (event_notification_id id)
 Remove a notification identified by 'id'.
virtual void remove_all_notifications ()
 Remove all notifications.
virtual void start_notifications ()
 Start the event notifications.
virtual void stop_notifications ()
 Stop the event notifications.
 event_notification ()
 Class constructors.
 event_notification (const event_notification &other)=delete
 Class constructors.
 event_notification (event_notification &&other) noexcept
 Class constructors.
event_notification & operator= (const event_notification &other)=delete
 Assignment operators.
event_notification & operator= (event_notification &&other) noexcept
 Assignment operators.

Protected Member Functions

bool process_notification (const event_notification_descriptor &desc) const noexcept override
 Process event notifications for PWM input channels.

Detailed Description

The pwm_in_channel class.

This class holds the configuration and value for a single PWM input channel.

Constructor & Destructor Documentation

◆ pwm_in_channel() [1/4]

vsdk::io::pwm_in_channel::pwm_in_channel ( const pwm_in_descriptor & desc)
explicit

The class constructor.

Parameters
descThe channel configuration.
See also
pwm_in_descriptor

◆ pwm_in_channel() [2/4]

vsdk::io::pwm_in_channel::pwm_in_channel ( std::shared_ptr< digital_context_interface > instance,
const pwm_in_descriptor & desc )
explicit

The class constructor.

Parameters
instanceAn instance for a class that implements digital_context_interface.
descThe channel configuration.
See also
pwm_in_descriptor

◆ pwm_in_channel() [3/4]

vsdk::io::pwm_in_channel::pwm_in_channel ( const pwm_in_channel & other)
delete

Standard constructors

◆ pwm_in_channel() [4/4]

vsdk::io::pwm_in_channel::pwm_in_channel ( pwm_in_channel && other)
noexcept

Standard constructors

Member Function Documentation

◆ descriptor()

pwm_in_descriptor vsdk::io::pwm_in_channel::descriptor ( ) const

Return a descriptor with the channel configuration used when the class was instantiated.

Returns
A pwm_in_descriptor object.

◆ operator=() [1/2]

pwm_in_channel & vsdk::io::pwm_in_channel::operator= ( const pwm_in_channel & other)
delete

Standard assignment operators

◆ operator=() [2/2]

pwm_in_channel & vsdk::io::pwm_in_channel::operator= ( pwm_in_channel && other)
noexcept

Standard assignment operators

◆ process_notification()

bool vsdk::io::pwm_in_channel::process_notification ( const event_notification_descriptor & desc) const
overrideprotectedvirtualnoexcept

Process event notifications for PWM input channels.

This method handles the following event types:

  • Threshold events (above/below)
  • Range events (in/out of range)

Events are generated only when the conditions are met, and are pushed to the notification queue specified in the descriptor.

Parameters
descThe event notification descriptor containing:
  • source: The PWM input source (pwm_in0 or pwm_in1)
  • type: The event type (threshold or range)
  • value: The trigger value (double for threshold, range_value for range)
  • queue: The event queue to receive notifications, for more see vsdk::io::event_notification_descriptor.
Returns
True if the notification was processed, false otherwise

Implements vsdk::io::event_notification.

◆ read()

pwm_result vsdk::io::pwm_in_channel::read ( ) const

Read the current value of the channel.

Returns
A pwm_result containing the status and value for the channel in Hz.

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