Hubo Library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Namespaces | Macros | Typedefs | Enumerations | Functions
hubolib.h File Reference
#include <vector>
#include <string>

Go to the source code of this file.

Namespaces

 HuboLib
 
 BCM2835
 

Macros

#define MAX_MCP3x08_CHANNELS   (8)
 
#define MAX_MCP23017_SLAVES   (7)
 
#define __int64   long long
 

Typedefs

typedef void(* HuboLib::T_pfn_CycleTickCallback) (unsigned long *pADChannelValues, unsigned char *pDigitalInputValues, unsigned char *pDigitalOutputValues)
 Prototype definition of the callback function beeing called an every cycle time tick. More...
 
typedef void(* HuboLib::T_pfn_ChannelDelayCallback) (__int64 cycleCount, __int64 t_Overrun_ms)
 Prototype definition of the callback function beeing called when the cycle time slice has been violated. More...
 
typedef void(* HuboLib::T_pfn_DIChangedCallback) (unsigned char changedDigitalInputValues, unsigned char digitalInputValues)
 Prototype definition of the callback function beeing called whenever a change of any of the digital inputs is detected. More...
 

Enumerations

enum  BCM2835::FunctionSelectType {
  BCM2835::Input = 0x00, BCM2835::Output = 0x01, BCM2835::Alternate0 = 0x04, BCM2835::Alternate1 = 0x05,
  BCM2835::Alternate2 = 0x06, BCM2835::Alternate3 = 0x07, BCM2835::Alternate4 = 0x03, BCM2835::Alternate5 = 0x02,
  BCM2835::FSEL_MASK = 0x07
}
 Prior to using a GPIO pin it requires to get defined for its use as input, output or one of the alternative functions. More...
 
enum  BCM2835::PullUpDownType { BCM2835::PUD_OFF = 0x00, BCM2835::PUD_DOWN = 0x01, BCM2835::PUD_UP = 0x02 }
 Pins configured as input can make use of internal pull up or down resistors. More...
 

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...
 
bool HuboLib::Set_Cycle_Time (long cycleTime)
 Sets the backgrounds threads polling interval in ms. More...
 
bool HuboLib::Register_CycleTickCallback (T_pfn_CycleTickCallback pFnCycleTickCallback)
 Registers a callback function called on every cycle tick. More...
 
bool HuboLib::Unregister_CycleTickCallback (T_pfn_CycleTickCallback pFnCycleTickCallback)
 Unregister a callback previouly registered by a call to Register_CycleTickCallback(). More...
 
bool HuboLib::Register_ChannelDelayCallback (T_pfn_ChannelDelayCallback pFnChannelDelayCallback)
 Register a callback to be called whenever the cycle time has been violated by more than one cycle time. More...
 
bool HuboLib::Unregister_ChannelDelayCallback (T_pfn_ChannelDelayCallback pFnChannelDelayCallback)
 Unregister a callback previouly registered by a call to Register_ChannelDelayCallback(). More...
 
bool HuboLib::Set_DO_Channels (unsigned char value)
 Requests the background thread to update all 8 bits of the digital output to the value specified. More...
 
bool HuboLib::Set_Slave_DO_Channels (int slaveNo, unsigned char value)
 Requests the background thread to update all 8 bits of the digital output to the value specified for a given slave. More...
 
bool HuboLib::Set_DO_Channel (int channel, bool bValue)
 Requests the background thread to set one of the digital outputs to the value specified. More...
 
bool HuboLib::Set_Slave_DO_Channel (int slaveNo, int channel, bool bValue)
 Requests the background thread to set one of the digital outputs to the value specified for a given slave. More...
 
bool HuboLib::Get_DO_Channels (unsigned char &value)
 Retrieves the requested digital output value from the output buffer. More...
 
bool HuboLib::Get_Slave_DO_Channels (int slaveNo, unsigned char &value)
 Retrieves the requested digital output value from the output buffer for a given slave. More...
 
bool HuboLib::Readback_DO_Channels (unsigned char &value)
 Reads back the digital output latchs of the IO expander. More...
 
bool HuboLib::Readback_Slave_DO_Channels (int slaveNo, unsigned char &value)
 Reads back the digital output latchs of the IO expander for a given slave. More...
 
bool HuboLib::Get_DI_Channels (unsigned char &value)
 Retrieves the value of all digital inputs. More...
 
bool HuboLib::Get_DI_Channels_Raw (unsigned char &values)
 Retrieves the unbuffered values of all digital inputs (of the Hubo master module). More...
 
bool HuboLib::Get_Slave_DI_Channels (int slaveNo, unsigned char &value)
 Retrieves the value of all digital inputs. More...
 
bool HuboLib::Get_DI_Channel (int channel, bool &bValue)
 Retrieves the value of one digital input. More...
 
bool HuboLib::Get_Slave_DI_Channel (int slaveNo, int channel, bool &bValue)
 Retrieves the value of one digital input for a given slave. More...
 
bool HuboLib::Register_DIChangedCallback (T_pfn_DIChangedCallback pFnDIChangedCallback)
 Register a callback to be called whenever one or more of the digital inputs have changed. More...
 
bool HuboLib::Unregister_DIChangedCallback (T_pfn_DIChangedCallback pFnDIChangedCallback)
 Unregister a callback previouly registered by a call to Register_DIChangedCallback(). More...
 
void HuboLib::Set_VRef (double volt)
 Set the reference voltage value for the ADC. More...
 
double HuboLib::Get_VRef ()
 Retrieves the reference voltage value used for ADC count convertion. More...
 
double HuboLib::Get_VRef_Raw ()
 Retrieves the reference voltage value used for ADC count convertion. More...
 
bool HuboLib::Set_MCP3x08_Oversampling (unsigned short overSampling[MAX_MCP3x08_CHANNELS])
 Specifies the ADC channels to be sampled as well as the number they get oversampled. More...
 
bool HuboLib::Get_AI_Channel (int channel, unsigned long &count, double &volt)
 Get the buffered and oversampled data from the MCP3x08. More...
 
bool HuboLib::Get_AI_Channel_Raw (int channel, unsigned short &value)
 Gets an unbuffered value from the MCP3x08. More...
 
void HuboLib::VersionInfo ()
 Prints version information and other stuff regarding to the library to the console. More...
 
double HuboLib::Get_MCP9701_Temperature (double volt)
 Converts a voltage value of an MCP9701 temperature sensor into the equivalent temperature. More...
 
double HuboLib::Get_MCP9700_Temperature (double volt)
 Converts a voltage value of an MCP9700 temperature sensor into the equivalent temperature. More...
 
bool HuboLib::GetSlaveDeviceList (std::vector< int > &slaveAddressList)
 Returns the list of I2C addresses of the MCP23017 slaves. More...
 
unsigned long long HuboLib::GetTime_MicroSeconds ()
 Returns the number of micro seconds. More...
 
void HuboLib::Delay_MicroSeconds (unsigned long delay_micros)
 delays the execution of the calling thread for the given number of micro seconds. More...
 
bool HuboLib::Get_1w_Devices (std::vector< std::string > &deviceList)
 Returns a list of 1wire devices found on the bus. More...
 
bool HuboLib::Is_DS18x20_Devices (const char *pSensorID)
 Check whether a 1wire device name refers to a DS18S20 or DS18B20 temperature sensor. More...
 
bool HuboLib::Get_DS18x20_Temperature (const char *pSensorID, double &temperature, bool &bCRC, long &t_duration_ms)
 Retrieve temperature, CRC value and the time that was required to read the temperature. More...
 
void HuboLib::Test_AD_Board ()
 
bool BCM2835::IsGPIOInitialized ()
 Returns the status of the initialisation of the GPIO part of the library. More...
 
void BCM2835::FunctionSelectPin (unsigned char pin, FunctionSelectType mode)
 Use FunctionSelect() to configure the mode of a BCM2835 pin. More...
 
void BCM2835::WritePin (unsigned char pin, unsigned char value)
 Sets or clears a pin configured to be an output. More...
 
void BCM2835::SetPin (unsigned char pin)
 Sets a pin configured as output to 1. More...
 
void BCM2835::ClearPin (unsigned char pin)
 Resets a pin configured as output to 0. More...
 
void BCM2835::SetPullUpDown (unsigned char pin, PullUpDownType pud)
 Enables or disables the BCM2835 internal pull -up or -down resistors for a pin configured as an input. More...
 
unsigned short BCM2835::ReadPin (unsigned short pin)
 Reads the value of an (input) pin. More...
 

Macro Definition Documentation

#define __int64   long long

Definition at line 47 of file hubolib.h.

#define MAX_MCP23017_SLAVES   (7)

Definition at line 43 of file hubolib.h.

#define MAX_MCP3x08_CHANNELS   (8)

Definition at line 39 of file hubolib.h.