| Updated: October 28, 2024 | 
The setcfg function changes the configuration of specific devices on the SPI bus. The prototype for this function is:
int setcfg( void *hdl,
            uint16_t device,
            spi_cfg_t *cfg );
The arguments are:
typedef struct {
    uint32_t    mode;
    uint32_t    clock_rate;
} spi_cfg_t;
  
This function must return EOK, or EINVAL if either the device ID or the configuration is invalid.