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

Page 46
Image 46
Lantronix XPort manual Guidelines, Commands, Byte 0 Command Types

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.