Thales' cellular IoT products business is now part of Telit Cinterion, find out more.

You are here

EHS6T USB GPIO level shifters with Java | Telit Cinterion IoT Developer Community

May 22, 2017 - 10:13am, 2369 views


Do you have a Java code example of how to change the GPIO directions and the level shifter directions of the EHS6T USB terminals ?

I have a scenario where the same GPIO signals will be used for both input and output.

In order to change the GPIO level shifter input (default) to output, the level shifter has to be configured first and the physical EHS6 I/O pin thereafter.

In case of changing the GPIO level shifter output back to input, the physical EHS6 I/O pin has to be configured first and the level shifter thereafter.

For tests, I have used  AT^SSPI= command, for example:

AT^SSPI=             - commands to open I2C
<aD41001>          - I2C commands to set GPIO6 (register address is 10) as output (value 01)
<bD50001>         - I2C command to check status of last operation
<aD41500>          - I2C commands to set GPIO13 (register address is 15) as input (value 00)
<bD50001>         - I2C command to check status of last operation
#                             - command to close I2C

at^spio=1                 enable GPIO driver
at^scpin=0,5            GPIO6 released
at^scpin=1,5,1         open GPIO6 as output
at^ssio=5,1              GPIO6 LED on
at^ssio=5,0              GPIO6 LED off
at^scpin=0,12         GPIO13 released
at^scpin=1,12,0      GPIO13 defined as input
at^scpol=1,12         GPIO13 polling read configuration

The Java InPort and OutPort classes can be used but what would be the easiest way to configure the level shifters?

The I2cBusConnection + inStream + OutStream probably can handle the level shifters.

Best Regards.

Antero Markkula

Antero Markkula
Communication and Mechatronics

Enkom Active Oy –
Upseerinkatu 3 A, 02600 Espoo, Finland
Mobile: +358 400 411368
Office: +358 10 204 0000
Fax: +358 10 204 0010