Elton User Manual Rev 1.04
Page 59
The following Read and Write commands enable the user to access and control data that is stored in
registers. In order to transact write byte/read byte, the register must be specified.
The GPIOs for PTN3460 can be programmed through i2c communication bus connected to the Xavier Series
Module as described in the parameters below. The
to program PTN3460 chip are included in the
BSP (Board Support Package).
Write Command Parameters
The
i2cse command
is a method to set register visibility through the i2c bus.
To write to a register, enter the
i2cset
command line as follows:
#sudo i2cset -y -f <bus no> <device address> <register address> <data>
For example, to write
0x01
to
0x80
, the syntax would be as follows:
#sudo i2cset -y -f 2 0x20 0x80 0x01
The following table describes the command parameters.
Command
Description
i2cset
Write data to an i2c device.
[-f] [-y]
Options
-f
forces access to the device if the device is in a busy
mode. May return an invalid value.
-y
disables interactive mode and bypasses prompts for
confirmation from the i2cget command. By default, it will wait
for user input before interacting with the i2c device.
<bus no>
Value of the i2c bus. Indicates the number of the i2c bus to
be scanned.
<device address>
Specifies the address of the chip on the specific bus.
<register address>
Specifies the address on the chip to write to.
<data>
Parameters to be written for the device.
Read Command Parameters
The
i2cget
command is a method to read a byte from a specified register on the i2c device. To read from
a register, enter the i2cset command line as follows:
#sudo i2cget -y -f <bus no> <device address> <register address>
For example, to retrieve and read
0x01 to 0x80
, the syntax will be as follows:
#sudo i2cget -y -f 2 0x20 0x80
To retrieve and read complete data from the register, the syntax will be as follows:
#sudo i2cdump -y -f 2 0x20