OS  v1.7.5
Documentation
Loading...
Searching...
No Matches
qOS::input::digitalChannel Class Reference

A digital input-channel object. More...

#include <input.hpp>

Inheritance diagram for qOS::input::digitalChannel:
[legend]
Collaboration diagram for qOS::input::digitalChannel:
[legend]

Public Member Functions

 digitalChannel (const uint8_t inputChannel, bool invert=false)
 Constructor for the digital input channel instance.
 
type getType (void) const noexcept override
 Get the channel type.
 
bool setTime (const event e, const qOS::duration_t t) noexcept override
 Set the timeout for the specified event.
 
bool setParameter (const event e, const analogValue_t p) noexcept override
 Set the parameter for the specified event.
 
uint8_t getCount (void) const noexcept override
 Get pulsation count for the digital input.
 
bool isShared (void) const noexcept override
 Check if the channel value is shared with other channel with the same (pin) number.
 
bool setReader (digitalReaderFcn_t r) noexcept override
 Assign the function that is in charge of reading the specific digital input.
 
- Public Member Functions inherited from qOS::input::channel
event getEvent (void) const noexcept
 Retrieves the last event for the given input channel.
 
bool setCallback (const eventCallback_t cb) noexcept
 Set the callback function when event are detected on the input input channel.
 
bool setChannel (const uint8_t inputChannel) noexcept
 Set/Change the channel(pin) number.
 
uint8_t getChannel (void) const noexcept
 Get the channel(pin) number.
 
void setUserData (void *pUserData) noexcept
 Set the channel user-data.
 
void * getUserData (void) noexcept
 Get the channel user-data.
 
virtual bool unShare (void) noexcept=0
 

Additional Inherited Members

- Protected Member Functions inherited from qOS::node
listgetContainer (void) noexcept
 Get a pointer to the list in which this node is contained.
 
 node ()
 

Detailed Description

A digital input-channel object.

Constructor & Destructor Documentation

◆ digitalChannel()

qOS::input::digitalChannel::digitalChannel ( const uint8_t inputChannel,
bool invert = false )
inline

Constructor for the digital input channel instance.

Parameters
[in]inputChannelThe specified channel(pin) number to read.
[in]invertTo invert/negate the raw-reading.

Member Function Documentation

◆ getCount()

uint8_t qOS::input::digitalChannel::getCount ( void ) const
inlineoverridevirtualnoexcept

Get pulsation count for the digital input.

Note
No valid on analog inputs
Returns
The current pulsation count.

Implements qOS::input::channel.

◆ getType()

type qOS::input::digitalChannel::getType ( void ) const
inlineoverridevirtualnoexcept

Get the channel type.

Returns
The channel type.

Implements qOS::input::channel.

◆ isShared()

bool qOS::input::digitalChannel::isShared ( void ) const
inlineoverridevirtualnoexcept

Check if the channel value is shared with other channel with the same (pin) number.

Returns
true if shared. Otherwise false.

Implements qOS::input::channel.

◆ setParameter()

bool qOS::input::digitalChannel::setParameter ( const event e,
const analogValue_t p )
overridevirtualnoexcept

Set the parameter for the specified event.

Parameters
[in]eThe event where the parameter will be set.
[in]pThe value of the parameter.
Returns
true on success. Otherwise false.

Implements qOS::input::channel.

◆ setReader()

bool qOS::input::digitalChannel::setReader ( digitalReaderFcn_t r)
inlineoverridenoexcept

Assign the function that is in charge of reading the specific digital input.

Parameters
[in]rThe channel reader function.
Returns
true on success. Otherwise false.

◆ setTime()

bool qOS::input::digitalChannel::setTime ( const event e,
const qOS::duration_t t )
overridevirtualnoexcept

Set the timeout for the specified event.

Parameters
[in]eThe event where the timeout will be set.
[in]tThe value of the timeout.
Returns
true on success. Otherwise false.

Implements qOS::input::channel.