5 #include "../hubolib.h"
6 #include "../hubocfg.h"
26 void CycleTickCallback (
unsigned long* pADChannelValues,
unsigned char* pDigitalInputValues,
unsigned char* pDigitalOutputValues);
38 printf (
"Error: Initialize\n");
49 for (
int i=0; i<10; i++)
51 printf (
"Main thread waiting...\n");
64 void CycleTickCallback (
unsigned long* pADChannelValues,
unsigned char* pDigitalInputValues,
unsigned char* pDigitalOutputValues)
69 printf (
"CycleTickCallback called.\n");
71 unsigned char value = 0;
75 for (
int i=0; i<1000; i++)
82 printf (
"Reading digital inputs 1000 times lasts %lfms.\n", (stopTime-startTime)/1000.0);
const char * m_sI2CDevice
bool Initialize()
Initializes the library.
bool Set_Cycle_Time(long cycleTime)
Sets the backgrounds threads polling interval in ms.
bool Unregister_CycleTickCallback(T_pfn_CycleTickCallback pFnCycleTickCallback)
Unregister a callback previouly registered by a call to Register_CycleTickCallback().
void Uninitialize()
Releases any resources bound to the library.
unsigned long long GetTime_MicroSeconds()
Returns the number of micro seconds.
bool Register_CycleTickCallback(T_pfn_CycleTickCallback pFnCycleTickCallback)
Registers a callback function called on every cycle tick.