Lantronix XPort manual Examples, Command 1Ah, Set Active Levels, Command 1Bh, Set States

Page 48

5: GPIO Interface

Command 1Ah, Set Active Levels

Send:

2parameters Bytes 1-4: Mask

Bit X 1 means the direction for GPIO X will be updated with the value in the second parameter.

0 means the active type for that GPIO will not change. Bytes 5-8: New Active Levels

Bit X 1 means GPIO X will become active low.

0 means it will become active high.

Response:

1 parameter

Bytes 1-4: Updated active levels

Command 1Bh, Set States

Send:

2parameters Bytes 1-4: Mask

Bit X 1 means the state for GPIO X will be updated with the value in the second parameter.

0 means the state for that GPIO will not change. Bytes 5-8: New States

Bit X 1 means GPIO X will become active.

0 means it will become inactive.

Response:

1 parameter

Bytes 1-4: Updated states

Examples

Example 1: PC sends command 1 to find out which configurable pins are available as GPIO.

PC -> XPort: 10h, 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h

XPort -> PC: 10h, 03h, 00h, 00h, 00h

Command details:

10h = command 10h

00h, 00h, 00h, 00h = ignored 00h, 00h, 00h, 00h = ignored

Response details:

10h = response to command 10h 04h, 00h, 00h, 00h =

bits 0 and 1 are 0 CP1 and CP2 are configured as GPIOs.

bit 2 is 1 CP3 is configured as either serial control or diagnostics.

The other bits are ignored because there are only three configurable pins on the XPort.

Example 2: PC sends command 1Bh to change the current states of GPIO 0 and 1.

PC -> XPort: 1Bh, 01h, 00h, 00h, 00h, 00h, 00h, 00h, 00h

XPort -> PC: 1Bh, 05h, 00h, 00h, 00h

XPort™ User Guide

48

Image 48
Contents XPort User Guide Copyright and Trademark Disclaimer and Revisions Date Rev CommentsContents Mail Settings Gpio Interface Using This Guide Purpose and AudienceChapter Summary Additional Documentation XPort Integration GuideIntroduction CapabilitiesApplications Protocol Support Addresses and Port NumbersHardware Address IP AddressAssigning an IP Address Using DeviceInstaller to Assign an IP Address Installing DeviceInstallerGetting Started 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 necessaryConnect Mode Settings Flush Mode Input BufferDedicated Connection Additional Settings Packing AlgorithmFactory Settings Update SettingsUsing Setup Mode for Configuration Accessing Setup ModeUsing a Telnet Connection Using the Serial Port Setup Menu OptionsSetup Mode Configuration Parameters Server Configuration Network Configuration Change Telnet Configuration PasswordSet Gateway IP Address Netmask Number of Bits for Host PartChannel 1 Configuration Serial Port Parameters Dhcp NameBaudrate Interface Mode Mode XPort-485 onlyMode Option Common I/F Mode Setting Binary HexFlow Port NumberFlow Control Option Hex Port Numbers Reserved forConnect Mode Connect Mode OptionIncoming Connection Response Autostart Automatic Connection HostlistModem Mode Datagram TypeWithout Echo 11. Modem Mode Messages Message MeaningFull Verbose Modem Mode Function Command 12. Modem Mode CommandsRemote IP Address Remote PortFlush Mode Buffer Flushing Disconnect Mode Option13. Disconnect Mode Options 14. Flush Mode OptionsPack Control OptionDisConnTime Inactivity Timeout Channel Port PasswordSend Characters Telnet Terminal TypeMail Settings Mail SetupExpert Settings Trigger SetupARP Cache timeout in seconds High CPU Performance modeMonitor Mode at Bootup RS-485 TX Enable Active LevelSecurity Settings Disable SnmpDisable Telnet Setup Snmp Community NameDisable Tftp Firmware Upgrade Disable Port 77FE HexDisable Web Server Disable Echo PortsCommand syntax telnet Encryption TutorialFactory Defaults Enable Enhanced PasswordDisable Port 77F0 Hex Channel 1 Configuration DefaultsExit Configuration Mode Expert Settings DefaultsSecurity Settings Defaults Mail SettingsConfigurable Pins FeaturesGpio Interface Control ProtocolCommands Byte 0 Command TypesGuidelines Command 10h, Get Functions Command 11h, Get DirectionsCommand 12h, Get Active Levels Command 13h, Get Current StatesCommand 1Ah, Set Active Levels Command 1Bh, Set StatesExamples Command details Using Tftp Updating FirmwareObtaining Firmware Reloading Firmware ROM FileUser Guide Entering Monitor Mode via the Serial Port Entering Monitor Mode via the Network PortMonitor Mode Commands Monitoring the NetworkCommand Command Name Function Response MeaningTroubleshooting Problems and Error MessagesProblem/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

XPort specifications

The Lantronix XPort is a compact and powerful embedded networking module that enables devices to connect to the Internet and communicate over a network. Small in size yet packed with features, the XPort is ideal for applications that require network connectivity without the complexity and cost associated with traditional networking solutions.

One of the standout features of the XPort is its small form factor. Measuring just 1.6 inches by 1.9 inches, it is designed for seamless integration into a variety of devices, making it a popular choice for manufacturers looking to add networking capabilities to their products without occupying much physical space.

The XPort utilizes the robust and widely used TCP/IP protocol stack, allowing it to facilitate reliable data communication over the Internet and other IP networks. This provides developers with a familiar framework for implementing network functionality, while also ensuring compatibility with various networking standards.

Equipped with a built-in web server, the XPort allows for easy configuration and management through a standard web browser. This user-friendly feature enables developers and end users to interact with the device effortlessly, simplifying tasks such as firmware updates and network settings adjustments.

Another key technology employed in the XPort is its serial-to-Ethernet capabilities. This feature converts serial data from devices into network packets, enabling legacy devices that communicate through serial ports to be connected to modern networks. This is particularly beneficial for industries with a significant number of legacy devices still in operation.

The XPort also incorporates security features, including SSL and SSH, which help protect data transmitted over the network. These security measures are essential in today's digital landscape, where data breaches and unauthorized access are growing concerns.

With its low power consumption and versatile applications, the Lantronix XPort is suitable for a variety of IoT applications, including healthcare devices, industrial automation, and smart metering. Its ability to operate in harsh environments enhances its appeal to manufacturers looking to deploy reliable networking solutions.

In summary, the Lantronix XPort offers a blend of compact design, advanced networking capabilities, and essential security features, making it a valuable asset for any project requiring efficient network connectivity. Its compatibility with existing technologies and ease of integration make it an ideal choice for modern IoT applications.