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

MCP2200_13 参数 Datasheet PDF下载

MCP2200_13图片预览
型号: MCP2200_13
PDF下载: 下载PDF文件 查看货源
内容描述: USB 2.0 UART协议转换器,具有GPIO [USB 2.0 to UART Protocol Converter with GPIO]
分类和应用: 转换器
文件页数/大小: 44 页 / 503 K
品牌: MICROCHIP [ MICROCHIP TECHNOLOGY ]
 浏览型号MCP2200_13的Datasheet PDF文件第9页浏览型号MCP2200_13的Datasheet PDF文件第10页浏览型号MCP2200_13的Datasheet PDF文件第11页浏览型号MCP2200_13的Datasheet PDF文件第12页浏览型号MCP2200_13的Datasheet PDF文件第14页浏览型号MCP2200_13的Datasheet PDF文件第15页浏览型号MCP2200_13的Datasheet PDF文件第16页浏览型号MCP2200_13的Datasheet PDF文件第17页  
MCP2200
2.3.1.2
Function:
bool SimpleIOClass::ConfigureIO (unsigned char IOMap)
ConfigureIO
Summary:
Description:
Precondition:
Parameters:
Configures the GPIO pins for Digital Input, Digital Output.
GPIO Pins can be configured as Digital Input, Digital Output.
VID and PID must be previously set via a call to
InitMCP2200(VID, PID)
.
IOMap
- a byte that represents a bitmap of the GPIO configuration:
• a bit set to ‘
1
’ will be a digital input
• a bit set to ‘
0
’ will be a digital output
• MSB –
LSB
GP7 GP6 GP5 GP4 GP3 GP2 GP1 GP0
Returns:
Remarks:
This function returns True if the transmission is successful and returns False if the transmission fails.
Error code is returned in
LastError
.
EXAMPLE 2-2:
if (SimpleIOClass::ConfigureIO(0xA5) == SUCCESS)
lblStatusBar->Text = “Success”;
else
lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError;
2.3.1.3
Function:
ConfigureIoDefaultOutput
bool SimpleIOClass::ConfigureIoDefaultOutput (unsigned char ucIoMap, unsigned char ucDefValue)
Summary:
Description:
Precondition:
Parameters:
1.
Configures the IO pins for Digital Input, Digital Output and also the default output latch value.
IO Pins can be configured as Digital Input, Digital Output. The default output latch value is received
as a parameter.
VID and PID must be previously set via a call to
InitMCP2200(VID, PID)
.
ucIoMap
- a byte that represents a bitmap used to set the GPIOs as either input or output.
2.
• ‘
1
’ configures GPIO as input
• ‘
0
’ configures GPIO as output
• MSB –
LSB
GP7 GP6 GP5 GP4 GP3 GP2 GP1 GP0
ucDefValue
- the default value that will be loaded to the output latch (affects only the pins configured as
outputs).
This function returns True if the transmission is successful and returns False if the transmission fails.
Error code is returned in
LastError
.
Returns:
Remarks:
EXAMPLE 2-3:
if (SimpleIOClass::ConfigureIoDefaultOutput(IoMap, DefValue) == SUCCESS)
lblStatusBar->Text = “Success”;
else
lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError;
2011 Microchip Technology Inc.
DS22228B-page 13