Hubo Library

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
Functions for initialization and uninitialization

## Functions
bool | HuboLib::Initialize ()
| Initializes the library. More...
void | HuboLib::Uninitialize ()
| Releases any resources bound to the library. More...
bool | HuboLib::Initialize_MCP23017 ()
| Low level initialization of the MCP23017 IO expander. More...
bool | HuboLib::Wait_For_MCP23017_Buffered_Values ()
| Waits until input and output buffers of the MCP23017 master are initialized from the hardware. More...
bool | HuboLib::Initialize_MCP23017_Slaves ()
| Low level initialization of the MCP23017 IO expander slaves. More...
bool | HuboLib::Wait_For_MCP23017_Slaves_Buffered_Values ()
| Waits until input and output buffers of the MCP23017 slaves are initialized from the hardware. More...
bool | HuboLib::Initialize_MCP3x08 ()
| Low level initialization of the MCP3x08 analog input chip. More...
bool | HuboLib::Wait_For_MCP3x08_Buffered_Values ()
| Waits until the input buffer of the MCP3x08 are initialized from the hardware. More...

## Detailed Description

## Function Documentation

bool HuboLib::Initialize | ( |  | ) |

Initializes the library.

Call this function once prior to work with most of the other functions. On failure it is not possible to call any other function that communicates to the board. Note that initalization regularly fails when the SPI/I2c kernel modules are not loaded or the user does not have sufficient right to use them. In such a case try running the application as sudo.

Returns
  Initialize returns true whenever at least one hardware component could be found. Hence there is no guarantee that all hardware components could be initialized.

See also
  For an example on how to use Initialize() refer to the demo DigitalInput3.cpp.
  Uninitialize()

Note
  Changes to the configuration (e.g. SPI chip select, I2C address selection) must be made prior to a call to Initialize().

bool HuboLib::Initialize_MCP23017 | ( |  | ) |

Low level initialization of the MCP23017 IO expander.

This function is used internally by Initialize() for initializing the digital IO expander. The function should not be called directly for any other purpose than trouble shooting!

See also
  Initialize()

Deprecated:
  This function might get dropped in future versions of the library.

bool HuboLib::Initialize_MCP23017_Slaves | ( |  | ) |

Low level initialization of the MCP23017 IO expander slaves.

This function is used internally by Initialize() for initializing the digital IO expander slaves. The function should not be called directly for any other purpose than trouble shooting!

See also
  Initialize()

Deprecated:
  This function might get dropped in future versions of the library.

bool HuboLib::Initialize_MCP3x08 | ( |  | ) |

Low level initialization of the MCP3x08 analog input chip.

This function is used internally by Initialize() for initializing the analog input chip. The function should not be called directly for any other purpose than trouble shooting!

See also
  Initialize()

Deprecated:
  This function might get dropped in future versions of the library.

void HuboLib::Uninitialize | ( |  | ) |

Releases any resources bound to the library.

Call this function to free up any ressources allocated by a previous call to Initialize().

See also
  For an example on how to use Uninitialize() refer to the demo DigitalInput3.cpp.
  Initialize()

bool HuboLib::Wait_For_MCP23017_Buffered_Values | ( |  | ) |

Waits until input and output buffers of the MCP23017 master are initialized from the hardware.

Call this function once after a call to Initialize() in order to ensure that further read operations are not accessing the buffers prior to their first initialization by the libraries background thread.

Returns
  The function returns true once the buffers are filled. It returns false if the initialization failed or the background thread is not running.

See also
  For an example on how to use Wait_For_MCP23017_Buffered_Values() refer to the demo DigitalInput6.cpp.
  Wait_For_MCP23017_Slaves_Buffered_Values(), Wait_For_MCP3x08_Buffered_Values

Note
  You should not call this function prior to a successfull call of Initialize().

bool HuboLib::Wait_For_MCP23017_Slaves_Buffered_Values | ( |  | ) |

Waits until input and output buffers of the MCP23017 slaves are initialized from the hardware.

Call this function once after a call to Initialize() in order to ensure that further read operations are not accessing the buffers prior to their first initialization by the libraries background thread.

Returns
  The function returns true once the buffers are filled. It returns false if the initialization failed or the background thread is not running.

See also
  For an example on how to use Wait_For_MCP23017_Slaves_Buffered_Values() refer to the demo DigitalSlaveOutput3.cpp.
  Wait_For_MCP23017_Buffered_Values(), Wait_For_MCP3x08_Buffered_Values

Note
  You should not call this function prior to a successfull call of Initialize().

bool HuboLib::Wait_For_MCP3x08_Buffered_Values | ( |  | ) |

Waits until the input buffer of the MCP3x08 are initialized from the hardware.

Call this function once after a call to Initialize() in order to ensure that further read operations are not accessing the buffers prior to their first initialization by the libraries background thread.

Returns
  The function returns true once the buffers are filled. It returns false if the initialization failed or the background thread is not running.

See also
  For an example on how to use Wait_For_MCP3x08_Buffered_Values() refer to the demo AnalogInput5.cpp.
  Wait_For_MCP23017_Buffered_Values(), Wait_For_MCP23017_Slaves_Buffered_Values()

Note
  You should not call this function prior to a successfull call of Initialize().