typedef struct {
  CTL_MUTEX_t *mutex;
  CTL_SPI_SET_PROTOCOL_FN_t __set_protocol;
  CTL_SPI_EXCHANGE_FN_t __exchange;
  CTL_SPI_DEVICE_t *__head;
  CTL_SPI_DEVICE_t *__dev;
  CTL_SPI_PROTOCOL_t __protocol;

CTL_SPI_BUS_t contains the bus state and methods that implement an SPI bus. Clients that use the SPI bus should consider all data in this structure private.

If this mutex is non-zero, the SPI functions will acquire the mutex proceeding to use the SPI bus. For systems that do not share the SPI bus between tasks, the mutex can be zero and it's the user's responsibility to ensure mutual exclusion on the SPI bus.
Private method to set the SPI bus protocol for a selected device. Client code must not call this method directly. See CTL_SPI_SET_PROTOCOL_FN_t.
Private method to exchange data over the SPI bus. Client code must not call this method directly. See CTL_SPI_EXCHANGE_FN_t.
Private member which is the head of the chain of devices attached to this SPI bus.
Private member that stores the currently-selected device on the SPI bus; if null, no device is selected.
Private member that stores the protocol that the SPI bus is currently configured for.