Solaris Software
Loading...
Searching...
No Matches
SPP_HALSpi_t Struct Reference

SPI bus struct that contains all the pointers to the SPI functions. More...

#include <hal.h>

Data Fields

SPP_RetVal_t(*) spiBusInit (void)
 Initialise the SPI bus.
void *(*) spiGetHandle (spp_uint8_t deviceIdx)
 Obtain the handle for the next SPI device slot.
SPP_RetVal_t(*) spiDeviceInit (void *p_handle)
 Initialise a specific SPI device.
SPP_RetVal_t(*) spiTransmit (void *p_handle, spp_uint8_t *p_data, spp_uint8_t length)
 Perform a full-duplex SPI transaction.
SPP_RetVal_t(*) spiDeviceSetSpeed (void *p_handle, spp_uint32_t speedHz)
 Remove and re-add a SPI device with a new clock speed.

Detailed Description

SPI bus struct that contains all the pointers to the SPI functions.

Definition at line 21 of file hal.h.

Field Documentation

◆ spiBusInit

SPP_RetVal_t(*) SPP_HALSpi_t::spiBusInit(void)

Initialise the SPI bus.

May be called multiple times; subsequent calls must be no-ops.

Returns
K_SPP_OK on success.

Definition at line 30 of file hal.h.

Referenced by SPP_HAL_SPI_busInit().

◆ spiGetHandle

void *(*) SPP_HALSpi_t::spiGetHandle(spp_uint8_t deviceIdx)

Obtain the handle for the next SPI device slot.

Devices are numbered sequentially starting from 0. The port determines which physical device each index maps to.

Parameters
[in]deviceIdxZero-based device index.
Returns
Opaque device handle, or NULL if the index is out of range.

Definition at line 42 of file hal.h.

Referenced by SPP_HAL_SPI_getHandle().

◆ spiDeviceInit

SPP_RetVal_t(*) SPP_HALSpi_t::spiDeviceInit(void *p_handle)

Initialise a specific SPI device.

Parameters
[in]p_handleHandle returned by spiGetHandle.
Returns
K_SPP_OK on success, K_SPP_ERROR_NULL_POINTER if handle is NULL.

Definition at line 51 of file hal.h.

Referenced by SPP_HAL_SPI_deviceInit().

◆ spiTransmit

SPP_RetVal_t(*) SPP_HALSpi_t::spiTransmit(void *p_handle, spp_uint8_t *p_data, spp_uint8_t length)

Perform a full-duplex SPI transaction.

The buffer p_data is used for both TX and RX. The port inspects the MSB of the first byte to determine read (1) vs write (0).

Parameters
[in,out]p_handleSPI device handle.
[in,out]p_dataTX data in, RX data out.
[in]lengthNumber of bytes in the transaction.
Returns
K_SPP_OK on success, K_SPP_ERROR_ON_SPI_TRANSACTION on failure.

Definition at line 65 of file hal.h.

Referenced by SPP_HAL_SPI_transmit().

◆ spiDeviceSetSpeed

SPP_RetVal_t(*) SPP_HALSpi_t::spiDeviceSetSpeed(void *p_handle, spp_uint32_t speedHz)

Remove and re-add a SPI device with a new clock speed.

Intended for devices that require a lower speed during initialisation and a higher speed for normal operation (e.g. SD cards).

Parameters
[in]p_handleHandle returned by spiGetHandle.
[in]speedHzNew clock frequency in Hz.
Returns
K_SPP_OK on success, K_SPP_ERROR on failure.

Definition at line 78 of file hal.h.

Referenced by SPP_HAL_SPI_deviceSetSpeed().


The documentation for this struct was generated from the following file:
  • solaris-v2/spp/hal/hal.h