MCP2200
EXAMPLE 2-13:
lblStatusBar->Text = SimpleIOClass::GetSelectedDevice();
2.3.1.14
Function:
GetSelectedDeviceInfo
String^ SimpleIOClass::GetSelectedDeviceInfo(void)
Summary:
Returns the selected device path name.
Description:
The function returns a string containing the unique path name of the selected device.
Precondition: At least one call to the InitMCP2200()is required in order to initiate a DLL search for the compatible
devices. VID and PID must be previously set via a call to InitMCP2200(VID, PID).
Parameters:
Returns:
None.
This function returns a string containing the unique path name of the selected device.
Remarks:
The default selected device is the first one that the DLL finds. If the user wants to retrieve other
devices path names (assuming more than one device is present in the system), a call to
SimpleIOClass::SelectDevice(deviceNo)is required.
EXAMPLE 2-14:
lblStatusBar->Text = SimpleIOClass::GetSelectedDeviceInfo(void)
2.3.1.15
Function:
InitMCP2200
void SimpleIOClass::InitMCP2200 (unsigned int VendorID, unsigned int ProductID)
Summary:
Configures the Simple IO class for a specific Vendor and product ID.
Sets the Vendor and Product ID used for the project.
Description:
Precondition: None.
Parameters:
1. Vendor ID- assigned by USB IF (www.usb.org)
2. Product ID- assigned by the Vendor ID Holder
None.
Returns:
Remarks:
Call this function before any other calls, to set the Vendor and Product IDs.
EXAMPLE 2-15:
InitMCP2200 (0x4D8, 0x00DF);
2.3.1.16
Function:
IsConnected
bool SimpleIOClass::IsConnected()
Summary:
Checks with the OS if the current VID/PID device is connected.
Description:
Checks if a MCP2200 is connected to the computer. If so, it returns True, otherwise the result will be
False.
Precondition: VID and PID must be previously set via a call to InitMCP2200(VID, PID).
Parameters:
Returns:
None.
True - if at least one device is connected to the host.
False - if there are no devices connected to the host.
Remarks:
No actual communication with the end device is occurring. The function inquires the OS if the
specified VID/PID was enumerated.
DS22228B-page 18
2011 Microchip Technology Inc.