Class upisnd::Encoder#
Detailed Description#
The Encoder element class.
#include <encoder.h>
Inherits the following classes: upisnd::Element
Public Functions#
| Type | Name | 
|---|---|
| int | get () const This is for quick access to the value, otherwise, it's recommended to keep the.  | 
| int | getOpts (upisnd_encoder_opts_t & opts) const Retrieves the Encoder options.  | 
| int | setOpts (const upisnd_encoder_opts_t & opts)  Sets the Encoder options.  | 
| upisnd_pin_t | getPinB () const Retrieves the 2nd pin of the Encoder .  | 
| upisnd_pin_pull_e | getPinPull () const Retrieves the pull-up/pull-down configuration of the 1st pin of the Encoder .  | 
| upisnd_pin_pull_e | getPinBPull () const Retrieves the pull-up/pull-down configuration of the 2nd pin of the Encoder .  | 
| Element ()  | 
|
| Element (upisnd_element_ref_t el)  Implicitly increments the refcount. If you got the element from C API, don't forget to unref it afterwards.  | 
|
| Element (const Element & rhs)  | 
|
| Element (Element && rhs)  | 
|
| Element (upisnd_element_ref_t el, bool)  | 
Public Functions inherited from upisnd::Element#
See upisnd::Element
| Type | Name | 
|---|---|
| Element ()  | 
|
| Element (upisnd_element_ref_t el)  Implicitly increments the refcount. If you got the element from C API, don't forget to unref it afterwards.  | 
|
| Element (const Element & rhs)  | 
|
| Element & | operator= (const Element & rhs)  | 
| Element (Element && rhs)  | 
|
| Element & | operator= (Element && rhs)  | 
| ~Element ()  Unreferences the element.  | 
|
| bool | isValid () const Checks if the element is valid.  | 
| void | release ()  Unreferences the underlying C upisnd_element_ref_t handle and resets the object.  | 
| const char * | getName () const Gets the name of the element.  | 
| upisnd_element_type_e | getType () const Gets the type of the element.  | 
| upisnd_pin_t | getPin () const Gets the pin of the element.  | 
| ValueFd | openValueFd (int flags) const Opens the Element 's value attribute as a file descriptor. | 
| T | as () const Safely casts the element to the requested class. Returns an invalid object if the cast is not possible.  | 
Public Static Functions#
| Type | Name | 
|---|---|
| Encoder | setup (ElementName name, upisnd_pin_t pin_a, upisnd_pin_pull_e pull_a, upisnd_pin_t pin_b, upisnd_pin_pull_e pull_b)  Set up an encoder element.  | 
Public Static Functions inherited from upisnd::Element#
See upisnd::Element
| Type | Name | 
|---|---|
| Element | get (ElementName name)  Gets an Element following upisnd_element_get semantics.  | 
| Element | setup (ElementName name, upisnd_setup_t setup)  Sets up a new Element from a upisnd_setup_t setup option container.  | 
Protected Functions inherited from upisnd::Element#
See upisnd::Element
| Type | Name | 
|---|---|
| upisnd_element_ref_t | ref () const | 
| Element (upisnd_element_ref_t el, bool)  | 
get#
This is for quick access to the value, otherwise, it's recommended to keep the.
int upisnd::Encoder::get () const
ValueFd returned by Element::openValueFd, to avoid file open and close overhead. Inspect the errno to check for errors. 
getOpts#
Retrieves the Encoder options.
int upisnd::Encoder::getOpts (
    upisnd_encoder_opts_t & opts
) const
See also: upisnd_element_encoder_get_opts
setOpts#
Sets the Encoder options.
int upisnd::Encoder::setOpts (
    const upisnd_encoder_opts_t & opts
) 
See also: upisnd_element_encoder_set_opts
getPinB#
Retrieves the 2nd pin of the Encoder .
upisnd_pin_t upisnd::Encoder::getPinB () const
See also: upisnd_element_encoder_get_pin_b
getPinPull#
Retrieves the pull-up/pull-down configuration of the 1st pin of the Encoder .
upisnd_pin_pull_e upisnd::Encoder::getPinPull () const
See also: upisnd_element_gpio_get_pull
getPinBPull#
Retrieves the pull-up/pull-down configuration of the 2nd pin of the Encoder .
upisnd_pin_pull_e upisnd::Encoder::getPinBPull () const
See also: upisnd_element_encoder_get_pin_b_pull
Element [1/5]#
upisnd::Encoder::Element () 
Element [2/5]#
Implicitly increments the refcount. If you got the element from C API, don't forget to unref it afterwards.
explicit upisnd::Encoder::Element (
    upisnd_element_ref_t el
) 
Element [3/5]#
upisnd::Encoder::Element (
    const Element & rhs
) 
Element [4/5]#
upisnd::Encoder::Element (
    Element && rhs
) 
Element [5/5]#
upisnd::Encoder::Element (
    upisnd_element_ref_t el,
    bool
) 
setup#
Set up an encoder element.
static Encoder upisnd::Encoder::setup (
    ElementName name,
    upisnd_pin_t pin_a,
    upisnd_pin_pull_e pull_a,
    upisnd_pin_t pin_b,
    upisnd_pin_pull_e pull_b
) 
See also: upisnd_setup_encoder