欢迎访问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文件第16页浏览型号MCP2200T-ISS的Datasheet PDF文件第17页浏览型号MCP2200T-ISS的Datasheet PDF文件第18页浏览型号MCP2200T-ISS的Datasheet PDF文件第19页浏览型号MCP2200T-ISS的Datasheet PDF文件第21页浏览型号MCP2200T-ISS的Datasheet PDF文件第22页浏览型号MCP2200T-ISS的Datasheet PDF文件第23页浏览型号MCP2200T-ISS的Datasheet PDF文件第24页  
MCP2200  
2.3.1.19  
ReadPinValue  
Function:  
int SimpleIOClass::ReadPinValue(unsigned int pin)  
Summary:  
Reads the specified pin.  
Description:  
Reads the specified pin and returns the value as the return value. If the pin has been configured as a  
digital input, the return value will be either ‘0’ or ‘1’. If an error occurs, the function will return a value  
of 0x8000.  
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:  
pin- the pin number to set (0-7)  
This function returns the read value of the pin, or returns a value of 0x8000, if an error occurs.  
None.  
Remarks:  
EXAMPLE 2-19:  
unsigned int rv;  
if (SimpleIOClass::ReadPinValue(0) != 0x8000)  
{
lblStatusBar->Text = “Success”;  
}
else  
lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError;  
2.3.1.20  
Function:  
ReadPort  
bool SimpleIOClass::ReadPort(unsigned int *returnvalue)  
Summary:  
Reads the GPIO port as digital input.  
Description:  
Reads the GPIO port and returns the value in returnvalue. This provides a means to read all pins  
simultaneously, instead of one-by-one.  
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:  
pin- the pin number to set (0-7)  
returnvalue- the value read on the pin (‘0’ or ‘1’)  
Returns:  
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-20:  
unsigned int rv;  
if (SimpleIOClass::ReadGPIOPort (0, &rv))  
{
lblStatusBar->Text = “Success”;  
}
else  
lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError;  
DS22228B-page 20  
2011 Microchip Technology Inc.