SBL2e Dual Serial-to-Ethernet User's Manual
Page 17
7.3
Machine Command Mode
The “Machine Command Mode” is so named because the data sent and received is in hex or binary,
as opposed to the AT Command Mode which is more of a human readable text syntax and format.
All non-programmable pins such as power, ground and /RSTI, will read back as 0 and programming
commands will have no effect on them.
Syntax:
All commands are terminated with a linefeed, which is a hexadecimal value of 0x10, also
represented by a „\n‟ character in C. A carriage return value of 0x13 (or „\r‟) is ignored, so
commands may be terminated with „\n‟ or “\r\n”.
Command parameters are in hexadecimal format, with the most significant bit (MSB) first.
Return Values
Commands to set parameters will return a status value 0 on success, or 1 for a syntax error.
Commands that return values will be in format: “<status>,<result>”, where status is 0 (success)
or 1 (syntax error) and the return value is one or more hexadecimal values, depending on the
command. Hexadecimal values have the MSB first.
Return values are terminated by “\r\n”.
Command Summary:
MGxxxx
GPIO Enable: Set pin configuration, primary function (0) or GPIO mode (1).
MG
GPIO Enable Query: Return primary/GPIO pin configuration.
MRxxxx
GPIO Direction: Set the GPIO pin direction, input (0) or output (1).
MR
GPIO Direction Query: Return GPIO pin direction.
MOxxxx
GPIO Output Set: Set individual GPIO output pins, low (0) or high (1).
MO
GPIO Output Query: Return programmed state of all GPIO output pins.
MH
Set all GPIO output pins high (1)
ML
Set all GPIO output pins low (0)
MP
Save current settings as the power-on state
MQ
Query all A/D and GPIO values
MT
Terminate the GPIO command TCP connection
M?
Return all GPIO input and output pin values, low (0) or high (1).
electronic components distributor