setcfg()

QNX SDP8.0SPI Framework TechnotesAPIConfiguration

Set the SPI device configuration

Synopsis:

int (*setcfg)( const void *const hdl,
               spi_dev_t *spi_dev,
               const spi_cfg_t *const cfg );

Arguments:

hdl
The handle of the low-level module that spi_init() returns.
spi_dev
A pointer to the SPI device structure, spi_dev_t.
cfg
A pointer to the configuration structure, spi_cfg_t, which stores the configuration information.
The definition of spi_cfg_t is:
typedef struct {
    uint32_t    mode;        /* SPI mode */
    uint32_t    clock_rate;  /* bus speed */
} spi_cfg_t;

Description:

The setcfg() function sets the configuration of specific devices on the SPI bus.

Errors:

The setcfg() function must return EOK, or EINVAL if either the device ID or the configuration is invalid.

Page updated: