Synergy Software Package User's Manual

Interface for SPI communications. More...

Data Structures

struct  spi_callback_args_t
 
struct  spi_cfg_t
 
struct  spi_api_t
 
struct  spi_instance_t
 

Typedefs

typedef void spi_ctrl_t
 

Enumerations

enum  spi_bit_width_t { SPI_BIT_WIDTH_8_BITS = (1), SPI_BIT_WIDTH_16_BITS = (2), SPI_BIT_WIDTH_32_BITS = (4) }
 
enum  spi_mode_t { SPI_MODE_MASTER, SPI_MODE_SLAVE }
 
enum  spi_clk_phase_t { SPI_CLK_PHASE_EDGE_ODD, SPI_CLK_PHASE_EDGE_EVEN }
 
enum  spi_clk_polarity_t { SPI_CLK_POLARITY_LOW, SPI_CLK_POLARITY_HIGH }
 
enum  spi_mode_fault_t { SPI_MODE_FAULT_ERROR_ENABLE, SPI_MODE_FAULT_ERROR_DISABLE }
 
enum  spi_bit_order_t { SPI_BIT_ORDER_MSB_FIRST, SPI_BIT_ORDER_LSB_FIRST }
 
enum  spi_event_t {
  SPI_EVENT_TRANSFER_COMPLETE = 1, SPI_EVENT_TRANSFER_ABORTED, SPI_EVENT_ERR_MODE_FAULT, SPI_EVENT_ERR_READ_OVERFLOW,
  SPI_EVENT_ERR_PARITY, SPI_EVENT_ERR_OVERRUN, SPI_EVENT_ERR_FRAMING, SPI_EVENT_ERR_MODE_UNDERRUN
}
 
enum  spi_operation_t { SPI_OPERATION_DO_TX = 0x1, SPI_OPERATION_DO_RX = 0x2, SPI_OPERATION_DO_TX_RX = 0x3 }
 

Detailed Description

Interface for SPI communications.

Summary

The SPI Interface provides access to the SPI bus API. The Interface implements the Simple SPI on SCI HAL layer driver module.

Implemented by:

Related SSP architecture topics:

SPI Interface description: SPI Driver

Typedef Documentation

◆ spi_ctrl_t

typedef void spi_ctrl_t

SPI control block. Allocate an instance specific control block to pass into the SPI API calls.

Implemented as

Enumeration Type Documentation

◆ spi_bit_order_t

Bit-order

Enumerator
SPI_BIT_ORDER_MSB_FIRST 

Send MSB first in transmission.

SPI_BIT_ORDER_LSB_FIRST 

Send LSB first in transmission.

◆ spi_bit_width_t

Data bit width

Enumerator
SPI_BIT_WIDTH_8_BITS 

Data bit width is 8 bits byte.

SPI_BIT_WIDTH_16_BITS 

Data bit width is 16 bits word.

SPI_BIT_WIDTH_32_BITS 

Data bit width is 32 bits long word.

◆ spi_clk_phase_t

Clock phase

Enumerator
SPI_CLK_PHASE_EDGE_ODD 

0: Data sampling on odd edge, data variation on even edge

SPI_CLK_PHASE_EDGE_EVEN 

1: Data variation on odd edge, data sampling on even edge

◆ spi_clk_polarity_t

Clock polarity

Enumerator
SPI_CLK_POLARITY_LOW 

0: Clock polarity is low when idle

SPI_CLK_POLARITY_HIGH 

1: Clock polarity is high when idle

◆ spi_event_t

SPI events

Enumerator
SPI_EVENT_TRANSFER_COMPLETE 

The data transfer was completed.

SPI_EVENT_TRANSFER_ABORTED 

The data transfer was aborted.

SPI_EVENT_ERR_MODE_FAULT 

Mode fault error.

SPI_EVENT_ERR_READ_OVERFLOW 

Read overflow error.

SPI_EVENT_ERR_PARITY 

Parity error.

SPI_EVENT_ERR_OVERRUN 

Overrun error.

SPI_EVENT_ERR_FRAMING 

Framing error.

SPI_EVENT_ERR_MODE_UNDERRUN 

Underrun error.

◆ spi_mode_fault_t

Mode fault error flag. This error occurs when the device is setup as a master, but the SSLA line does not seem to be controlled by the master. This usually happens when the connecting device is also acting as master. A similar situation can also happen when configured as a slave.

Enumerator
SPI_MODE_FAULT_ERROR_ENABLE 

Mode fault error flag on.

SPI_MODE_FAULT_ERROR_DISABLE 

Mode fault error flag off.

◆ spi_mode_t

enum spi_mode_t

Master or slave operating mode

Enumerator
SPI_MODE_MASTER 

Channel operates as SPI master.

SPI_MODE_SLAVE 

Channel operates as SPI slave.

◆ spi_operation_t

Used by control block only.

Enumerator
SPI_OPERATION_DO_TX 

perform SPI transmission operation

SPI_OPERATION_DO_RX 

perform SPI reception operation

SPI_OPERATION_DO_TX_RX 

perform SPI Transmission and reception operation