DCMD_SPI_DATA_XCHNG

QNX SDP8.0Devctl and Ioctl CommandsDeveloper

Performs a symmetrical data exchange between a specific device and the client application

Synopsis:

#include <hw/io-spi.h>

#define DCMD_SPI_DATA_XCHNG     (__DIOT (_DCMD_SPI, 0x14, spi_xchng_t))

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device.
dcmd DCMD_SPI_DATA_XCHNG
dev_data_ptr A pointer to a spi_xchng_t structure (see below)
n_bytes sizeof(spi_xchng_t) + max size of the data sent or received by the driver
dev_info_ptr NULL

Description:

The DCMD_SPI_DATA_XCHNG command performs a symmetrical data exchange between a specific device and the client application.

Input:

Fill in the nbytes and data members of struct spi_xchng_t:
typedef struct {
    uint32_t    nbytes;      /* Exchange data length */
    uint8_t     data[0];     /* Exchange data */
} spi_xchng_t;
Before calling devctl(), initialize the data field to point to a buffer containing the nbytes of data that you would like to send to the device.

Output:

If the operation is successful, the device's response fills the data buffer. Since the operation is symmetrical, the response data buffer always contains the nbytes of data read from the bus. It's the responsibility of the client application to identify which response bytes are relevant or valid.

Related documents:

For more information, refer to the following documents:
Page updated: