isend

Updated: April 19, 2023

Execute DCMD_I2C_SEND devctl()

Syntax:

isend [-a slave] [-b speed] [-n name] [-r] [-x] [data ...]

Runs on:

QNX Neutrino

Options:

-a slave
The address of the slave device; this address is either seven bits (default), or ten bits if the -x option is specified.
-b speed
The bus speed, in Hertz. Default is to use the most recently set bus speed (i.e., use the same bus speed as the most recent transaction); if this is the first transaction, use the I2C driver's default bus speed.
-n name
The path and name of the I2C device. Default is /dev/i2c0.
-r
Don't issue a stop condition on the bus when the transaction is complete. Default (-r not specified) is to issue a stop condition when the transaction is complete.
-x
If specified, use a ten-bit slave address. If not specified, use a seven-bit slave address (default).
data
Data bytes to send, written as space-separated values; for example: 0x12 0x34 0x56, not 0x123456.

Description:

The isend utility executes a master send transaction (see DCMD_I2C_SEND in Customizing a BSP).

Examples:

The following examples illustrate how to use isend. Note that behavior is device-specific: it's up to the device to interpret the data it receives. For some devices, the first byte might be an address, but this is not guaranteed. You may need to modify the examples for your device. Check your device manual to know how it will behave.

Write

Write three bytes of data (0x1, 0x2, and 0x3) to an I2C slave device on bus 0, at address 0x23 and with a bus speed of 100 KHz:

isend -a 0x23 -n /dev/i2c0 -b 100000 0x1 0x2 0x3

Write, don't issue stop condition

Write two bytes of data (0xab and 0xcd) to an I2C slave device on bus 1, at address 0x30, and don't issue a stop condition:

isend -a 0x30 -n /dev/i2c1 -r 0xab 0xcd

Exit status:

0
Successful completion.
<0
An error occurred.