Device Commands
+ECHO
Toggles the status of the host adapter's echoing back of received characters. This is useful for manual control when the serial console application does not provide local echo functionality. Echo is turned off by default on device power-on.
Parameters:
This function takes no parameters.
Response:
This function returns an ACK Response after toggling the status of the echo setting.
Example Usage:
+PING
Returns an ACK response, useful in testing the status of the serial connection.
Parameters:
This function takes no parameters.
Response:
This function returns an ACK Response.
Example Usage:
+BASE
Gets/Sets the display base. The host adapter is able to use binary, decimal, or hex numeric bases for displaying values. The default value is HEX
(Base-16).
Set display base value: +BASE [base]
Get display base value: +BASE ?
Parameters:
For Binary (Base-2) display, set base to
BIN
or2
For Decimal (Base-10) display, set base to
DEC
or10
For Hexadecimal (Base-16) display, set base to
HEX
or16
To query the current setting value, set base to
?
Response:
Set: This function returns an ACK Response if the command succeeds. If an invalid value is provided, the function will return a NAK Response.
Get: This function returns -BASE
followed by either BIN
, DEC
, or HEX
Example Usage:
+LED
Gets/Sets the color of the status LED. The RGB Status LED is user-programmable and can be especially helpful for indicating status during testing or identifying host adapters when multiple devices are being used simultaneously.
Set the LED color to preset color: +LED [color]
Set the LED color to RGB values: +LED [red] [green] [blue]
Parameters:
The following are valid values for color:
OFF
WHITE
RED
GREEN
orLIME
BLUE
YELLOW
CYAN
orAQUA
MAGENTA
orFUCHSIA
orPURPLE
The values for red, green, and blue parameters are unsigned 8-bit integers from 0 to 256. Values outside of this range will be truncated to 8-bits.
Response:
This function returns an ACK Response if the command succeeds. If an invalid value is provided, the function will return a NAK Response.
Example Usage:
+MODE
Gets/Sets the mode of operation (protocol) for a given "core" of the Binho Multi-Protocol USB Host Adapter. The default value is IO
.
Set display base value: +MODE [coreIndex] [opMode]
Get display base value: +MODE [coreIndex] ?
Parameters:
The Binho Multi-Protocol USB Host Adapter only has one "core". The [coreIndex
] parameter is implemented to ensure the command set can be easily expanded. As such, coreIndex
= 0 for all usage of this command.
For IO operating mode, set opMode to
IO
For SPI operating mode, set opMode to
SPI
For I2C operating mode, set opMode to
I2C
orIIC
For 1-WIRE operating mode, set opMode to
1WIRE
or1-WIRE
orONEWIRE
For SWI operating mode, set opMode to
SWI
orSINGLEWIRE
For UART operating mode, set opMode to
UART
orUSART
orSERIAL
To query the current operating mode, set opMode to
?
Response:
Set: This function returns an ACK Response if the command succeeds. If an invalid value is provided, the function will return a NAK Response.
Get: This function returns -MODE
followed by [coreIndex]
followed by either IO
, SPI
, I2C
, UART
, 1WIRE
, or SWI
.
Example Usage:
+ID
Gets the globally-unique identifier of the host adapter. This identifier is very useful when working with multiple host adapters.
Parameters:
This function takes no parameters.
Response:
This function returns -ID
followed by the 256-bit globally-unique device identifier. Note that the response is always displayed in base-16 (hexadecimal) regardless of the base setting.
Example Usage:
+FWVER
Gets the version of the firmware running on the host adapter. This can be used to determine if the latest firmware version is installed or if the host adapter should be updated.
Parameters:
This function takes no parameters.
Response:
This function returns -FWVER
followed by the [major].[minor].[build]
number of the firmware . Note that the response is always displayed in base-10 (decimal) regardless of the base setting.
Example Usage:
+HWVER
Gets the version of the host adapter hardware. This is useful to programmatically determine which host adapter product hardware is connected.
Parameters:
This function takes no parameters.
Response:
This function returns -HWVER
followed by the [major].[minor]
identifier of the hardware . Note that the response is always displayed in base-10 (decimal) regardless of the base setting.
Example Usage:
+RESET
Resets the host adapter, all settings return to defaults.
Parameters:
This function takes no parameters.
Response:
This function returns -OK
. Note that immediately following the transmission of the response, the host adapter will reset, which will cause the serial connection with the computer to be lost.
Depending on the implementation of the serial console application, an Error may be raised due to the lost connection before the response to this command has been received/displayed.
Example Usage:
+BTLDR
Resets the host adapter and restart in bootloader mode. The host adapter must be in bootloader mode in order to update the device firmware. While in the bootloader, the device is not available over the serial / Virtual COM port. Instead, it will enumerate as a USB Mass Storage Device. More details about firmware update can be found in the Updating Firmware section of this guide.
Parameters:
This function takes no parameters.
Response:
This function returns -OK
. Note that immediately following the transmission of the response, the host adapter will reset, which will cause the serial connection with the computer to be lost. The device will then enumerate as a mass storage device.
Depending on the implementation of the serial console application, an Error may be raised due to the lost connection before the response to this command has been received/displayed.
Example Usage:
Last updated