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

An analog input-channel object. More...

#include <input.hpp>

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

Public Member Functions

 analogChannel (const uint8_t inputChannel, const analogValue_t lowerThreshold, const analogValue_t upperThreshold, const analogValue_t h=20)
 Constructor for the analog 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 (analogReaderFcn_t r) noexcept override
 Assign the function that is in charge of reading the specific analog input.
 
bool unShare (void) noexcept override
 Unshares the specified input channel if was marked as shared.
 
- 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.
 

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

An analog input-channel object.

Constructor & Destructor Documentation

◆ analogChannel()

qOS::input::analogChannel::analogChannel ( const uint8_t inputChannel,
const analogValue_t lowerThreshold,
const analogValue_t upperThreshold,
const analogValue_t h = 20 )
inline

Constructor for the analog input channel instance.

Note
Both lower and upper define the band
Parameters
[in]inputChannelThe specified channel(pin) number to read.
[in]lowerThresholdThe lower threshold value.
[in]upperThresholdThe upper threshold value.
[in]hHysteresis for the in-band transition.

Member Function Documentation

◆ getCount()

uint8_t qOS::input::analogChannel::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::analogChannel::getType ( void ) const
inlineoverridevirtualnoexcept

Get the channel type.

Returns
The channel type.

Implements qOS::input::channel.

◆ isShared()

bool qOS::input::analogChannel::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::analogChannel::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::analogChannel::setReader ( analogReaderFcn_t r)
inlineoverridenoexcept

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

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

◆ setTime()

bool qOS::input::analogChannel::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.

◆ unShare()

bool qOS::input::analogChannel::unShare ( void )
inlineoverridevirtualnoexcept

Unshares the specified input channel if was marked as shared.

Returns
true on success. Otherwise false.

Implements qOS::input::channel.