Updated: October 28, 2024 |
Execute DCMD_I2C_SEND devctl()
isend [-a slave] [-b speed] [-n name] [-r] [-x] [data ...]
QNX Neutrino
The isend utility executes a master send transaction (see DCMD_I2C_SEND in Customizing a BSP).
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 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 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