Hubo Library
|
Functions | |
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_DO_Channels | ( | unsigned char & | value | ) |
Retrieves the requested digital output value from the output buffer.
This function retrieves the value of the current output buffer. The output buffer gets modified by calls to Set_DO_Channel() and Set_DO_Channels().
Both functions - Get_DO_Channels() and Readback_DO_Channels() - can be used to verify whether an output request via Set_DO_Channel() or Set_DO_Channels() has already been performed by the IO expander. As long as the output has not been written, the values returned by Get_DO_Channels() and Readback_DO_Channels() differ.
value | The bit mask representing the state of the digital output buffer. |
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.
This function behaves like Get_DO_Channels() but works on a slave as specified.
slaveNo | The slave index in the list of slave addresses as specified by g_I2CConfig.m_MCP23017SlaveDeviceAddressList. |
value | The bit mask representing the state of the digital output buffer. |
bool HuboLib::Readback_DO_Channels | ( | unsigned char & | value | ) |
Reads back the digital output latchs of the IO expander.
The output latches of the IO expander chip are frequently read back during each cycle time tick of the background thread. This function retrieves these buffered output latch values of the IO expander.
Both functions - Get_DO_Channels() and Readback_DO_Channels() - can be used to verify whether an output request via Set_DO_Channel() or Set_DO_Channels() has already been performed by the IO expander. As long as the output has not been written, the values returned by Get_DO_Channels() and Readback_DO_Channels() differ.
value | The bit mask representing the buffered state of the IO expanders digital output latchs. |
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.
This function behaves like Readback_DO_Channels() but works on a slave as specified.
slaveNo | The slave index in the list of slave addresses as specified by g_I2CConfig.m_MCP23017SlaveDeviceAddressList. |
value | The bit mask representing the buffered state of the IO expanders digital output latchs. |
bool HuboLib::Set_DO_Channel | ( | int | channel, |
bool | bValue | ||
) |
Requests the background thread to set one of the digital outputs to the value specified.
This function tells the background thread to set a dedicated digital output to the value specified during its next cycle time.
channel | The digital output channel to be set. Valid ranges are 0 through 7. |
bValue | If true then the output is set, otherwise it is reset. |
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.
This function tells the background thread to transfer the values as specified to the IO expander during its next cycle time.
value | The bit mask representing the state of the digital outputs as to be set. |
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.
This function behaves like Set_DO_Channel() but works on a slave as specified.
slaveNo | The slave index in the list of slave addresses as specified by g_I2CConfig.m_MCP23017SlaveDeviceAddressList. |
channel | The digital output channel to be set. Valid ranges are 0 through 7. |
bValue | If true then the output is set, otherwise it is reset. |
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.
This function behaves like Set_DO_Channels() but works on a slave as specified.
slaveNo | The slave index in the list of slave addresses as specified by g_I2CConfig.m_MCP23017SlaveDeviceAddressList. |
value | The bit mask representing the state of the digital outputs as to be set. |