SPI Functions

Top  Previous  Next
Got to SUB-20 page

SPI Pins Configuration

 

After SPI is enabled SUB-20 SPI module will take control over SPI pins.

Pin

Function

Master mode

Slave mode

Disabled

SCK

SPI Master Clock

Output

Input

HiZ

MOSI

Master Out Slave In

Output

Input

MISO

Master In Slave Out

Input

Output**

SS0

Slave Select 0

Output Hi

(Configurable by sub_spi_transfer)

Input

SS1

SS2

SS3

SS4

Slave Select 1..4

HiZ

(Configurable by sub_spi_transfer)

Not in use

*If SPI is disabled all SPI pins are in HiZ.

** In SPI slave mode MISO is output only when SS0 is low

 

SPI SCK Polarity and Phase explanations

 

 

SPI Transfer format with SPI_SMPL_SETUP

 

 

SPI_CPOL_RISE

 

 

SPI_CPOL_FALL

 

 

 

Sample

 

 

MOSI Pin

 

MISO Pin

 

 

 

 

SPI Transfer format with SPI_SETUP_SMPL

 

 

SPI_CPOL_RISE

 

 

SPI_CPOL_FALL

 

 

 

Sample

 

 

MOSI Pin

 

MISO Pin

 

Functions

sub_spi_config

sub_spi_transfer

sub_spi_transfer_ess

sub_sdio_transfer