欢迎访问ic37.com |
会员登录 免费注册
发布采购

MCP2200T-ISS 参数 Datasheet PDF下载

MCP2200T-ISS图片预览
型号: MCP2200T-ISS
PDF下载: 下载PDF文件 查看货源
内容描述: USB 2.0 UART协议转换器,具有GPIO [USB 2.0 to UART Protocol Converter with GPIO]
分类和应用: 转换器
文件页数/大小: 44 页 / 503 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号MCP2200T-ISS的Datasheet PDF文件第17页浏览型号MCP2200T-ISS的Datasheet PDF文件第18页浏览型号MCP2200T-ISS的Datasheet PDF文件第19页浏览型号MCP2200T-ISS的Datasheet PDF文件第20页浏览型号MCP2200T-ISS的Datasheet PDF文件第22页浏览型号MCP2200T-ISS的Datasheet PDF文件第23页浏览型号MCP2200T-ISS的Datasheet PDF文件第24页浏览型号MCP2200T-ISS的Datasheet PDF文件第25页  
MCP2200  
2.3.1.21  
Function:  
ReadPortValue  
int SimpleIOClass::ReadPortValue()  
Summary:  
Reads the GPIO port as digital input.  
Reads the GPIO port and returns the value of the port. This provides a method to read all pins  
simultaneously, instead of one-by-one. In case of an error, the returned value will be 0x8000.  
Description:  
Precondition: Must be previously configured as an input via a ConfigureIOcall.  
VID and PID must be previously set via a call to InitMCP2200(VID, PID).  
Parameters:  
Returns:  
None.  
This function returns True if the transmission is successful and returns False if the transmission fails.  
Pins configured for output return the current state of the port. Pins configured as input read as zero.  
Remarks:  
EXAMPLE 2-21:  
int rv;  
rv = SimpleIOClass::ReadPortValue()  
if (rv != 0x8000)  
{
lblStatusBar->Text = “Success”;  
}
else  
lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError;  
2.3.1.22  
Function:  
SelectDevice  
int SimpleIOClass::SelectDevice(unsigned int uiDeviceNo)  
Summary:  
Selects one of the active devices in the system.  
Description:  
The function is used to select one of the detected devices in the system as the “active device”.  
Precondition: At least one call to the InitMCP2200()is required in order to initiate a DLL search for the compatible  
devices. Also, in order to know the actual number of devices in the system, call the  
SimpleIOClass::IsConnected()function. VID and PID must be previously set via a call to  
InitMCP2200(VID, PID).  
Parameters:  
uiDeviceNo- the ID of the device to be selected (can have a value between 0 and the number of  
devices minus 1).  
Returns:  
This function returns ‘0’ in case of selection success, otherwise it will return:  
E_WRONG_DEVICE_ID (-1)for a device ID that is out of range  
E_INACTIVE_DEVICE (-2)for an inactive device.  
Remarks:  
Call the SimpleIOClass::IsConnected()prior to the call of this function in order to have the most  
recent number of devices that are present in the system.  
EXAMPLE 2-22:  
int iResult;  
iResult = SimpleIOClass::SelectDevice(1)  
if (iResult == 0)  
{
lblStatusBar->Text = “Success”;  
}
else  
lblStatusBar->Text = “Error selecting device”;  
2011 Microchip Technology Inc.  
DS22228B-page 21