Lantronix 900-618 manual Control Protocol, Guidelines, Commands, Byte 0 Command Types

Page 63

9: GPIO Interface

Control Protocol

The GPIO control protocol is a simple, proprietary protocol.

Guidelines

The GPIO control protocol is described from the PC side. Send means from PC to xPico. Response comes from xPico to PC.

The protocol allows for control of up to 32 GPIOs. How many are actually available depends on the product. xPico has only eight.

The parameters are four bytes long and represent GPIOs 0-31, with GPIO0 in bit 0 of the first byte (Little Endian). Parameter bits for configurable pins not configured as GPIOs are undefined for Get commands and ignored on Set commands.

Every command consists of nine bytes: one command type of one byte and two parameters of four bytes each.

Command

 

Parameter 1

 

 

Parameter 2

 

0

1

2

3

4

5

6

7

8

On some commands, one or all parameters are ignored.

For UDP, command type and parameters need to be in the same datagram.

Responses to valid commands are always five bytes long, consisting of the returned command byte and as parameters in the current or updated values. In case of an invalid command, only one byte with value 0FFh is returned.

Command

 

Parameter 1

 

0

1

2

3

4

When sending a command (TCP and UDP), wait for the response before sending the next command.

Commands

Byte 0 Command Types

10h

Get functions

11h

Get directions (input or output)

 

 

12h

Get active levels (high active or low active)

 

 

13h

Get current states (active or not active)

 

 

19h

Set directions

 

 

1Ah

Set active levels

 

 

1Bh

Set current states

There is no Set functions command. Since the pin’s function depends on the hardware in which the xPico is embedded, that configuration is only allowed using 77FE. Settings changed by any of the Set commands are not stored and are lost when the unit is powered down or rebooted.

xPico User Guide

63

Image 63
Contents User Guide Technical Support Sales Offices Lantronix Corporate HeadquartersDisclaimer Table of Contents Configuration via Telnet or Serial Port Setup Mode Setup Mode Advanced Settings Gpio Interface List of Figures List of TablesUsing This Guide Purpose and AudienceChapter Summary XPico Integration Guide Additional DocumentationIntroduction CapabilitiesApplications Hardware Address Configuration MethodsProtocol Support Addresses and Port NumbersProduct Information Label IP AddressPort Numbers Assigning an IP Address Using DeviceInstallerInstalling DeviceInstaller To install DeviceInstallerName Accessing the xPico Using DeviceInstallerTo view the units current settings Select Assign a specific IP address and click NextDevice Family Dhcp Device NameGroup CommentsSupports Http Setup Firmware UpgradeableSupports Configurable PinsAccessing Web-Manager Using DeviceInstaller Configuration Using Web ManagerWeb-Manager Login Window Network ConfigurationNetwork Mode To assign an IP address automaticallySelect Obtain IP address automatically To assign an IP address manually Static IP Address ConfigurationEthernet Configuration Select Use the following IP configurationAuto Negotiate To configure the xPico’s device server settingsHost List Configuration Server ConfigurationAdvanced Host Information Channel 1 and 2 ConfigurationRetry Settings To configure the xPico’s host listChannel Serial SettingsPort Settings To configure the channel’s serial settingsFlush Input Buffer Serial to Network Pack ControlAt Time of Disconnect Connection Settings TCPTo configure a channel’s TCP settings Flush Output Buffer Network to SerialTCP Connection Settings Connect Protocol Connect Mode Passive ConnectionConnect Mode Active Connection Endpoint ConfigurationConnection Settings UDP Disconnect ModeTo configure a channel’s UDP settings Device Address Table Datagram ModeDatagram Type Use BroadcastConfigurable Pin Settings Configurable Pin FunctionsTo configure the xPico’s Configurable Pins Serial Channel 2 Status LED Apply SettingsApply Defaults Serial Channel 1 Status LEDConfiguration via Telnet or Serial Port Setup Mode Accessing Setup ModeTelnet Connection To establish a Telnet connection Serial Port ConnectionTo exit setup mode Exiting Setup ModeIP Address Setup Mode Server ConfigurationServer Configuration Option BootP/DHCP/AutoIP OptionsSet DNS Server IP Address Change Telnet/Web-Manager PasswordSet Gateway IP Address Netmask Number of Bits for Host PartDhcp Name Setup Mode Channel Configuration Channel 1 Option 1 or Channel 2 OptionBaudrate Flow Interface ModeInterface Mode Options RS232 Interface Mode SettingsReserved Port Numbers Connect ModePort Number Flow Control OptionsResponse Connect Mode OptionsIncoming Connection Incoming ConnectionActive Startup ResponseManual Connection Address Example Manual ConnectionHostlist Option To enable the hostlistModem Mode Datagram TypeDirected UDP Numeric Response Modem Mode CommandsSend the Escape Sequence +++ in Modem Mode Show IP addr after RingAuto Increment Source Port Remote IP Address Disconnect Mode OptionsPack Control Flush Mode Buffer FlushingPacking Interval Trailing CharactersSend Characters Telnet Terminal Type DisConnTime Inactivity TimeoutChannel Port Password Send CharactersSetup Mode Advanced Settings Expert Settings OptionTCP Keepalive time in seconds Http Port Number ARP Cache timeout in secondsDisable Monitor Mode at bootup CPU PerformanceEthernet Connection Type Security Settings OptionTCP Re-Transmission Timeout Enable alternate MACDisable Snmp Disable Telnet SetupSnmp Community Name Disable Web Setup Disable Tftp Firmware UpgradeDisable Port 77FE Hex Disable Web ServerTo configure AES encryption on the xPico Enable EncryptionChannel 1 and Channel 2 Configuration Defaults Default Settings OptionEnable Enhanced Password Disable Port 77F0 HexStart character for serial channel Expert Settings DefaultsSecurity Settings Defaults Hostlist retry timeoutConfigurable Pins FeaturesGpio Interface Guidelines CommandsByte 0 Command Types Control ProtocolCommand 13h, Get Current States Command 10h, Get FunctionsCommand 11h, Get Directions Command 12h, Get Active LevelsCommand details Command 19h, Set DirectionsCommand 1Ah, Set Active Levels Command 1Bh, Set StatesResponse details To download new firmware from a computer Firmware UpgradesUsing Tftp Graphical User Interface Obtaining Firmware Reloading FirmwareTftp Window Using Tftp Command Line InterfaceTo recover firmware Monitor Mode Commands Monitor ModeEntering Monitor Mode Using the Serial Port Entering Monitor Mode Using the Network PortExample Monitor Mode CommandsG0, G1, ....,Ge, Gf S0, S1,...,Se, SfResponse Meaning Command Response CodesProblems and Error Messages TroubleshootingLock on Caps Lock is not onTroubleshooting Technical Support Technical Support USTechnical Support Europe, Middle East, and Africa Scientific Calculator Binary to Hexadecimal ConversionsConverting Binary to Hexadecimal Conversion TableBinary to Hexadecimal Conversions RoHS Notice Compliance