Lantronix XPort manual Guidelines, Commands, Byte 0 Command Types

Page 46

5: GPIO Interface

Guidelines

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

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

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 XPort is embedded, that configuration is only allowed via 77FE. Settings changed by any of the Set commands are not stored and are lost when the unit is powered down or rebooted.

XPort™ User Guide

46

Image 46
Contents XPort User Guide Copyright and Trademark Disclaimer and Revisions Date Rev CommentsContents Mail Settings Gpio Interface Purpose and Audience Using This GuideChapter Summary Additional Documentation XPort Integration GuideCapabilities IntroductionApplications Hardware Address Protocol SupportAddresses and Port Numbers IP AddressAssigning an IP Address Getting Started Using DeviceInstaller to Assign an IP AddressInstalling DeviceInstaller Required InformationAssigning an IP Address Select Assign a specific IP address and click NextUsing Web-Manager to Configure the Unit Lantronix Web-ManagerUnit Configuration Settings Server Properties Port Properties Edit the following fields as necessaryFlush Mode Input Buffer Connect Mode SettingsDedicated Connection Additional Settings Packing AlgorithmFactory Settings Update SettingsAccessing Setup Mode Using Setup Mode for ConfigurationUsing a Telnet Connection Using the Serial Port Setup Menu OptionsSetup Mode Configuration Parameters Set Gateway IP Address Server Configuration Network ConfigurationChange Telnet Configuration Password Netmask Number of Bits for Host PartDhcp Name Channel 1 Configuration Serial Port ParametersBaudrate Mode Option Interface ModeMode XPort-485 only Common I/F Mode Setting Binary HexFlow Control Option Hex FlowPort Number Port Numbers Reserved forConnect Mode Option Connect ModeIncoming Connection Response Autostart Automatic Connection HostlistDatagram Type Modem ModeWithout Echo Message Meaning 11. Modem Mode MessagesFull Verbose Remote IP Address Modem Mode Function Command12. Modem Mode Commands Remote Port13. Disconnect Mode Options Flush Mode Buffer FlushingDisconnect Mode Option 14. Flush Mode OptionsPack Control OptionSend Characters DisConnTime Inactivity TimeoutChannel Port Password Telnet Terminal TypeMail Settings Mail SetupExpert Settings Trigger SetupMonitor Mode at Bootup ARP Cache timeout in secondsHigh CPU Performance mode RS-485 TX Enable Active LevelDisable Telnet Setup Security SettingsDisable Snmp Snmp Community NameDisable Web Server Disable Tftp Firmware UpgradeDisable Port 77FE Hex Disable Echo PortsCommand syntax telnet Encryption Tutorial Disable Port 77F0 Hex Factory Defaults Enable Enhanced Password Channel 1 Configuration DefaultsSecurity Settings Defaults Exit Configuration ModeExpert Settings Defaults Mail SettingsGpio Interface Configurable PinsFeatures Control ProtocolByte 0 Command Types CommandsGuidelines Command 12h, Get Active Levels Command 10h, Get FunctionsCommand 11h, Get Directions Command 13h, Get Current StatesCommand 1Bh, Set States Command 1Ah, Set Active LevelsExamples Command details Obtaining Firmware Reloading Firmware Using TftpUpdating Firmware ROM FileUser Guide Monitor Mode Commands Entering Monitor Mode via the Serial PortEntering Monitor Mode via the Network Port Monitoring the NetworkCommand Command Name Function Response MeaningProblems and Error Messages TroubleshootingProblem/Message Reason Solution Address and Network Class Please try again Caps Lock is not onServer, the No Connection With Technical Support Email eutechsupp@lantronix.com