MCP2200
2.3.1.25
Function:
WritePort
bool SimpleIOClass::WritePort(unsigned int portValue)
Summary:
Writes a value to the GPIO port.
Description:
Writes the GPIO port. This provides a means to write all pins at simultaneously, instead of one-by-
one.
Precondition: Must be previously configured as an output via a ConfigureIOcall. VID and PID must be previously
set via a call to InitMCP2200(VID, PID).
Parameters:
Returns:
portValue- byte value to set on the port.
This function returns True if the transmission is successful and returns False if the transmission fails.
None.
Remarks:
EXAMPLE 2-25:
if (SimpleIOClass::WritePort (0x5A))
{
lblStatusBar->Text = “Success”;
}
else
lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError;
2011 Microchip Technology Inc.
DS22228B-page 23