Dataflow Runtime API  3.1.1.0
Enumerations | Functions
SystemPeripherals_SPI.h File Reference
#include <Imt.Base.Core.Platform/Platform.h>
#include "SystemMemoryMap.h"

Enumerations

enum  SpiModuleAddress { SpiModuleAddress_Spi0 = SOC_SPI_0_REGS , SpiModuleAddress_Spi1 = SOC_SPI_1_REGS }
 Multichannel Serial Port Interface (McSPI). More...
 
enum  SpiChannel { SpiChannel_0 = 0U , SpiChannel_1 = 1U , SpiChannel_2 = 2U , SpiChannel_3 = 3U }
 Id's of the available SPI channels (do not change the value, they are required for internal address calculation) More...
 
enum  SpiMode { SpiMode_0 , SpiMode_1 , SpiMode_2 , SpiMode_3 }
 Id's of the supported SPI modes. More...
 
enum  SpiDataLineDirection { SpiDataLineDirection_MOSI , SpiDataLineDirection_MISO , SpiDataLineDirection_NotUsed }
 Id's of the supported SPI data line directions. More...
 

Functions

void SPI_InitModuleAsMaster (const SpiModuleAddress moduleBaseAddress)
 Initializes the SPI module as master. More...
 
void SPI_InitChannel (const SpiModuleAddress moduleBaseAddress, const SpiChannel channel, const SpiMode mode, const SpiDataLineDirection directionLine0, const SpiDataLineDirection directionLine1, const uint32_t spiFrequencykHz, const bool chipSelectActiveLow)
 Initializes the channel of the given SPI module. More...
 
void SPI_WriteRead (const SpiModuleAddress moduleBaseAddress, const SpiChannel channel, const uint16_t *const pTxData, uint16_t *pRxData, const uint8_t bufferSize)
 Writes and reads data simultaneously with 16bit word length (blocking) More...
 

Enumeration Type Documentation

◆ SpiChannel

enum SpiChannel

Id's of the available SPI channels (do not change the value, they are required for internal address calculation)

Enumerator
SpiChannel_0 
SpiChannel_1 
SpiChannel_2 
SpiChannel_3 

◆ SpiDataLineDirection

Id's of the supported SPI data line directions.

Enumerator
SpiDataLineDirection_MOSI 
SpiDataLineDirection_MISO 
SpiDataLineDirection_NotUsed 

◆ SpiMode

enum SpiMode

Id's of the supported SPI modes.

Enumerator
SpiMode_0 
SpiMode_1 
SpiMode_2 
SpiMode_3 

◆ SpiModuleAddress

Multichannel Serial Port Interface (McSPI).

McSPI is a general-purpose receive/transmit master/slave controller that can interface with up to four slave external devices. It allows a duplex, synchronous, serial communication between a CPU and SPI compliant external devices (Slaves and Masters). Enumeration of the available SPI modules

Enumerator
SpiModuleAddress_Spi0 
SpiModuleAddress_Spi1 

Function Documentation

◆ SPI_InitChannel()

void SPI_InitChannel ( const SpiModuleAddress  moduleBaseAddress,
const SpiChannel  channel,
const SpiMode  mode,
const SpiDataLineDirection  directionLine0,
const SpiDataLineDirection  directionLine1,
const uint32_t  spiFrequencykHz,
const bool  chipSelectActiveLow 
)

Initializes the channel of the given SPI module.

Parameters
moduleBaseAddressThe SPI module to use
channelThe SPI channel to use
modeThe SPI communication mode
directionLine0Direction of SPI data line 0 (SPIDAT0)
directionLine1Direction of SPI data line 1 (SPIDAT1)
spiFrequencykHzFrequency of the SPI clock
chipSelectActiveLowTrue to set the level of chip select active to low, false otherwise

◆ SPI_InitModuleAsMaster()

void SPI_InitModuleAsMaster ( const SpiModuleAddress  moduleBaseAddress)

Initializes the SPI module as master.

Parameters
moduleBaseAddress- The SPI module to use

◆ SPI_WriteRead()

void SPI_WriteRead ( const SpiModuleAddress  moduleBaseAddress,
const SpiChannel  channel,
const uint16_t *const  pTxData,
uint16_t pRxData,
const uint8_t  bufferSize 
)

Writes and reads data simultaneously with 16bit word length (blocking)

Parameters
moduleBaseAddressThe SPI module to use
channelThe SPI channel to use
pTxDataBuffer containing the data to transmit
pRxDataBuffer containing the data received after function returned
bufferSizeThe number of elements in the send/receive buffer