isend
QNX SDP8.0Utilities ReferenceUtilities
Execute DCMD_I2C_SEND devctl()
Syntax:
isend [-a worker] [-b speed] [-n name] [-r] [-x] [data ...]
Runs on:
QNX OS
Options:
- -a worker
- The address of the worker 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 worker address. If not specified, use a seven-bit worker address (default).
- data
- Data bytes to send, written as space-separated values; for example:
0x12 0x34 0x56
, not0x123456
.
Description:
The isend utility executes a controller 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 worker 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 worker 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.
Page updated: