Appiko
Data Structures | Enumerations | Functions

Hardware abstraction layer of the SPI in Master mode. This driver is completely event driven and non-blocking, suitable for low power applications. More...

Data Structures

struct  hal_spim_init_t
 

Enumerations

enum  hal_spim_freq_t
 
enum  hal_spim_spi_mode_t { HAL_SPIM_SPI_MODE0, HAL_SPIM_SPI_MODE1, HAL_SPIM_SPI_MODE2, HAL_SPIM_SPI_MODE3 }
 
enum  hal_spim_byte_order_t { HAL_SPIM_MSB_FIRST, HAL_SPIM_LSB_FIRST }
 
enum  hal_spim_intr_t { HAL_SPIM_TX_DONE = SPIM_INTENSET_ENDTX_Msk, HAL_SPIM_RX_DONE = SPIM_INTENSET_ENDRX_Msk }
 

Functions

void hal_spim_init (hal_spim_init_t *spim_init)
 Function to Initiate the SPIM module. More...
 
void hal_spim_tx_rx (void *p_tx_data, uint32_t tx_len, void *p_rx_data, uint32_t rx_len)
 Function to start communication. More...
 
uint32_t hal_spim_is_busy ()
 Function to check if SIPM module is available or not. More...
 
void hal_spim_deinit ()
 Function to de-initialize the SPIM module.
 

Detailed Description

Enumeration Type Documentation

◆ hal_spim_byte_order_t

Enum containing options for Byte order

Enumerator
HAL_SPIM_MSB_FIRST 

Byte Order : MSB First

HAL_SPIM_LSB_FIRST 

Byte Order : LSB First

Definition at line 75 of file hal_spim.h.

◆ hal_spim_freq_t

Enum containing list of all the possible transmission frequencies

Definition at line 49 of file hal_spim.h.

◆ hal_spim_intr_t

Enum to contain list of interrupts which can be enabled from application

Enumerator
HAL_SPIM_TX_DONE 

To enable Tx Done event

HAL_SPIM_RX_DONE 

To enable Rx Done event

Definition at line 84 of file hal_spim.h.

◆ hal_spim_spi_mode_t

Enum containing list of all SPI Modes

Enumerator
HAL_SPIM_SPI_MODE0 

CPol : Active High, CPha : Leading

HAL_SPIM_SPI_MODE1 

CPol : Active High, CPha : Trailing

HAL_SPIM_SPI_MODE2 

CPol : Active Low, CPha : Leading

HAL_SPIM_SPI_MODE3 

CPol : Active Low, CPha : Trailing

Definition at line 62 of file hal_spim.h.

Function Documentation

◆ hal_spim_init()

void hal_spim_init ( hal_spim_init_t spim_init)
Parameters
spim_initSettings which is to be used to initiate the SPIM module.

Definition at line 60 of file hal_spim.c.

◆ hal_spim_is_busy()

uint32_t hal_spim_is_busy ( )
Returns
Status of hal_spim module
Return values
truehal_spim module is not available
falsehal_spim module is available

Definition at line 135 of file hal_spim.c.

Referenced by SdkEvalSpiCommandStrobes(), SdkEvalSpiReadFifo(), SdkEvalSpiReadRegisters(), SdkEvalSpiWriteFifo(), and SdkEvalSpiWriteRegisters().

◆ hal_spim_tx_rx()

void hal_spim_tx_rx ( void *  p_tx_data,
uint32_t  tx_len,
void *  p_rx_data,
uint32_t  rx_len 
)
Parameters
p_tx_dataPointer to the data which is to be sent
tx_lenNumber of bytes which are to be sent
p_rx_dataPointer to the location where received data is to be stored.
rx_lenNumber of received bytes which are to be stored

Definition at line 108 of file hal_spim.c.

References ASSERT.

Referenced by SdkEvalSpiCommandStrobes(), SdkEvalSpiReadFifo(), SdkEvalSpiReadRegisters(), SdkEvalSpiWriteFifo(), and SdkEvalSpiWriteRegisters().