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

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

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.