38 #ifndef MAX_MCP3x08_CHANNELS
39 #define MAX_MCP3x08_CHANNELS (8)
42 #ifndef MAX_MCP23017_SLAVES
43 #define MAX_MCP23017_SLAVES (7)
47 #define __int64 long long
73 typedef void (*
T_pfn_CycleTickCallback) (
unsigned long* pADChannelValues,
unsigned char* pDigitalInputValues,
unsigned char* pDigitalOutputValues);
705 bool Get_AI_Channel (
int channel,
unsigned long& count,
double& volt);
975 void WritePin (
unsigned char pin,
unsigned char value);
986 void SetPin (
unsigned char pin);
1021 unsigned short ReadPin (
unsigned short pin);
bool Initialize_MCP3x08()
Low level initialization of the MCP3x08 analog input chip.
bool Wait_For_MCP3x08_Buffered_Values()
Waits until the input buffer of the MCP3x08 are initialized from the hardware.
unsigned short ReadPin(unsigned short pin)
Reads the value of an (input) pin.
void Delay_MicroSeconds(unsigned long delay_micros)
delays the execution of the calling thread for the given number of micro seconds. ...
#define MAX_MCP3x08_CHANNELS
bool Unregister_ChannelDelayCallback(T_pfn_ChannelDelayCallback pFnChannelDelayCallback)
Unregister a callback previouly registered by a call to Register_ChannelDelayCallback().
double Get_MCP9700_Temperature(double volt)
Converts a voltage value of an MCP9700 temperature sensor into the equivalent temperature.
bool IsGPIOInitialized()
Returns the status of the initialisation of the GPIO part of the library.
bool Set_DO_Channel(int channel, bool bValue)
Requests the background thread to set one of the digital outputs to the value specified.
bool Get_Slave_DO_Channels(int slaveNo, unsigned char &value)
Retrieves the requested digital output value from the output buffer for a given slave.
bool Initialize()
Initializes the library.
void SetPin(unsigned char pin)
Sets a pin configured as output to 1.
bool 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 s...
bool Set_DO_Channels(unsigned char value)
Requests the background thread to update all 8 bits of the digital output to the value specified...
FunctionSelectType
Prior to using a GPIO pin it requires to get defined for its use as input, output or one of the alter...
bool Is_DS18x20_Devices(const char *pSensorID)
Check whether a 1wire device name refers to a DS18S20 or DS18B20 temperature sensor.
bool Get_DO_Channels(unsigned char &value)
Retrieves the requested digital output value from the output buffer.
bool Set_Cycle_Time(long cycleTime)
Sets the backgrounds threads polling interval in ms.
void FunctionSelectPin(unsigned char pin, FunctionSelectType mode)
Use FunctionSelect() to configure the mode of a BCM2835 pin.
PullUpDownType
Pins configured as input can make use of internal pull up or down resistors.
bool Wait_For_MCP23017_Slaves_Buffered_Values()
Waits until input and output buffers of the MCP23017 slaves are initialized from the hardware...
bool Unregister_CycleTickCallback(T_pfn_CycleTickCallback pFnCycleTickCallback)
Unregister a callback previouly registered by a call to Register_CycleTickCallback().
bool Initialize_MCP23017()
Low level initialization of the MCP23017 IO expander.
void(* 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.
void VersionInfo()
Prints version information and other stuff regarding to the library to the console.
void WritePin(unsigned char pin, unsigned char value)
Sets or clears a pin configured to be an output.
bool Readback_Slave_DO_Channels(int slaveNo, unsigned char &value)
Reads back the digital output latchs of the IO expander for a given slave.
void(* T_pfn_ChannelDelayCallback)(__int64 cycleCount, __int64 t_Overrun_ms)
Prototype definition of the callback function beeing called when the cycle time slice has been violat...
void Uninitialize()
Releases any resources bound to the library.
bool 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.
void ClearPin(unsigned char pin)
Resets a pin configured as output to 0.
bool Get_1w_Devices(std::vector< std::string > &deviceList)
Returns a list of 1wire devices found on the bus.
bool 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 ...
unsigned long long GetTime_MicroSeconds()
Returns the number of micro seconds.
bool Wait_For_MCP23017_Buffered_Values()
Waits until input and output buffers of the MCP23017 master are initialized from the hardware...
double Get_MCP9701_Temperature(double volt)
Converts a voltage value of an MCP9701 temperature sensor into the equivalent temperature.
bool GetSlaveDeviceList(std::vector< int > &slaveAddressList)
Returns the list of I2C addresses of the MCP23017 slaves.
bool Readback_DO_Channels(unsigned char &value)
Reads back the digital output latchs of the IO expander.
bool Register_ChannelDelayCallback(T_pfn_ChannelDelayCallback pFnChannelDelayCallback)
Register a callback to be called whenever the cycle time has been violated by more than one cycle tim...
bool Register_CycleTickCallback(T_pfn_CycleTickCallback pFnCycleTickCallback)
Registers a callback function called on every cycle tick.
bool Initialize_MCP23017_Slaves()
Low level initialization of the MCP23017 IO expander slaves.
void SetPullUpDown(unsigned char pin, PullUpDownType pud)
Enables or disables the BCM2835 internal pull -up or -down resistors for a pin configured as an input...