MCP2200
2.3.1.6
fnRxLED
Function:
bool SimpleIOClass::fnRxLED (unsigned int mode)
Summary:
Configures the Rx LED mode. Rx LED configuration will be stored in NVRAM.
Sets the Rx LED mode to one of the possible values.
Description:
Precondition: VID and PID must be previously set via a call to InitMCP2200(VID, PID).
Parameters:
Returns:
mode (constant): OFF, TOGGLE, BLINKSLOW, BLINKFAST
This function returns True if the transmission is successful and returns False if the transmission fails.
Remarks:
Error code is returned in LastError.
EXAMPLE 2-6:
if (SimpleIOClass::fnRxLED (BLINKFAST) == SUCCESS)
lblStatusBar->Text = “Success”;
else
lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError;
2.3.1.7
fnSetBaudRate
Function:
bool SimpleIOClass::fnSetBaudRate (unsigned long BaudRateParam)
Summary:
Configures the device’s default baud rate. The baud rate value will be stored in NVRAM
Sets the desired baud rate and it will store it into device’s NVRAM.
Description:
Precondition: VID and PID must be previously set via a call to InitMCP2200(VID, PID).
Parameters:
Returns:
BaudRateParam- the desired baud rate value
This function returns True if the transmission is successful and returns False if the transmission fails.
Remarks:
Error code is returned in LastError. This function is used only to set the default power-up baud rate
value. When used with a terminal program, there is no need to call this function to change the baud
rate. Changing the baud rate from the terminal program, will send the appropriate CDC packet that
will change the communication’s baud rate without the need to call this function.
EXAMPLE 2-7:
if (SimpleIOClass::fnSetBaudRate(9600) == SUCCESS)
lblStatusBar->Text = “Success”;
else
lblStatusBar->Text = “Invalid command ” + SimpleIOClass::LastError;
2.3.1.8
Function:
fnSuspend
bool SimpleIOClass::fnSuspend (unsigned int onOff)
Summary:
Configures the GP0 pin of the MCP2200 to show the status of Suspend/Resume USB states.
Description:
When the GP0 is designated to show the USB Suspend/Resume states, the pin will go low when the
Suspend state is issued, or will go high when the Resume state is on.
Precondition: VID and PID must be previously set via a call to InitMCP2200(VID, PID).
Parameters:
onOff:
• ‘1’ GP0 will reflect the USB Suspend/Resume states
• ‘0’ GP0 will not reflect the USB Suspend/Resume states (can be used as GPIO)
This function returns True if the transmission is successful and returns False if the transmission fails.
Error code is returned in LastError.
Returns:
Remarks:
2011 Microchip Technology Inc.
DS22228B-page 15