code/WPILib/DigitalModule.cpp
/**
 * Read a digital I/O bit from the FPGA.
 * Get a single value from a digital I/O channel.
 */
Read a digital I/O bit from the FPGA.
Get a single value from a digital I/O channel.
Read a digital I / O bit from the FPGA . Get a single value from a digital I / O channel .
bool DigitalModule::GetDIO(UINT32 channel)
{
	status = 0;
	UINT32 currentDIO = m_fpgaDIO->readDI(&status);
	wpi_assertCleanStatus(status);
	return ((currentDIO >> RemapDigitalChannel(channel - 1)) & 1) != 0;
}
bool DigitalModule :: GetDIO ( UINT32 channel ) { status = 0 ; UINT32 currentDIO = m_fpgaDIO -> readDI ( & status ) ; wpi_assertCleanStatus ( status ) ; return ( ( currentDIO >> RemapDigitalChannel ( channel - 1 ) ) & 1 ) != 0 ; }
Read a digital I/O bit from the FPGA.
Read a digital I / O bit from the FPGA .
//Shift 00000001 over channel-1 places. //AND it against the currentDIO //if it == 0, then return false //else return true