Class upisnd::AnalogInput#
#include <analog_input.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_analog_input_opts_t & opts) const Retrieves the Analog Input options. |
| int | setOpts (const upisnd_analog_input_opts_t & opts) Sets the Analog Input options. |
| 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 |
|---|---|
| AnalogInput | setup (ElementName name, upisnd_pin_t pin) Set up an analog input 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::AnalogInput::get () const
ValueFd returned by Element::openValueFd, to avoid file open and close overhead. Inspect the errno to check for errors.
getOpts#
Retrieves the Analog Input options.
int upisnd::AnalogInput::getOpts (
upisnd_analog_input_opts_t & opts
) const
See also: upisnd_element_analog_input_get_opts
setOpts#
Sets the Analog Input options.
int upisnd::AnalogInput::setOpts (
const upisnd_analog_input_opts_t & opts
)
See also: upisnd_element_analog_input_set_opts
Element [1/5]#
upisnd::AnalogInput::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::AnalogInput::Element (
upisnd_element_ref_t el
)
Element [3/5]#
upisnd::AnalogInput::Element (
const Element & rhs
)
Element [4/5]#
upisnd::AnalogInput::Element (
Element && rhs
)
Element [5/5]#
upisnd::AnalogInput::Element (
upisnd_element_ref_t el,
bool
)
setup#
Set up an analog input element.
static AnalogInput upisnd::AnalogInput::setup (
ElementName name,
upisnd_pin_t pin
)