AM263Px MCU+ SDK  10.01.00
mcspi/v0/mcspi.h File Reference

Introduction

MCSPI Driver API/interface file.

Go to the source code of this file.

Transfer Mode

This determines whether the driver operates synchronously or asynchronously

In MCSPI_TRANSFER_MODE_BLOCKING mode MCSPI_transfer() blocks code execution until the transaction has completed

In MCSPI_TRANSFER_MODE_CALLBACK MCSPI_transfer() does not block code execution and instead calls a MCSPI_CallbackFxn callback function when the transaction has completed

#define MCSPI_TRANSFER_MODE_BLOCKING   (0U)
 MCSPI_transfer() blocks execution. This mode can only be used when called within a Task context More...
 
#define MCSPI_TRANSFER_MODE_CALLBACK   (1U)
 MCSPI_transfer() does not block code execution and will call a MCSPI_CallbackFxn. This mode can be used in a Task, Swi, or Hwi context More...
 
typedef void(* MCSPI_CallbackFxn) (MCSPI_Handle handle, MCSPI_Transaction *transaction)
 The definition of a callback function used by the SPI driver when used in MCSPI_TRANSFER_MODE_CALLBACK. More...
 
MCSPI_Config gMcspiConfig []
 Externally defined driver configuration array. More...
 
uint32_t gMcspiConfigNum
 Externally defined driver configuration array size. More...
 
void MCSPI_init (void)
 This function initializes the MCSPI module. More...
 
void MCSPI_deinit (void)
 This function de-initializes the MCSPI module. More...
 
MCSPI_Handle MCSPI_open (uint32_t index, const MCSPI_OpenParams *openPrms)
 This function opens a given MCSPI peripheral. More...
 
void MCSPI_close (MCSPI_Handle handle)
 Function to close a MCSPI peripheral specified by the MCSPI handle. More...
 
MCSPI_Handle MCSPI_getHandle (uint32_t index)
 Function to return a open'ed MCSPI handle given a MCSPI instance index. More...
 
int32_t MCSPI_chConfig (MCSPI_Handle handle, const MCSPI_ChConfig *chCfg)
 Function to configure a MCSPI channel. More...
 
int32_t MCSPI_dmaChConfig (MCSPI_Handle handle, const MCSPI_ChConfig *chCfg, const MCSPI_DmaChConfig *dmaChCfg)
 Function to configure a DMA of a channel. More...
 
int32_t MCSPI_transfer (MCSPI_Handle handle, MCSPI_Transaction *transaction)
 Function to perform MCSPI transactions. More...
 
int32_t MCSPI_transferCancel (MCSPI_Handle handle)
 Function to cancel MCSPI transactions on channel of a SPI peripheral specified by the MCSPI handle. More...
 
static void MCSPI_OpenParams_init (MCSPI_OpenParams *openPrms)
 Function to initialize the MCSPI_OpenParams struct to its defaults. More...
 
static void MCSPI_ChConfig_init (MCSPI_ChConfig *chConfig)
 Function to initialize the MCSPI_ChConfig struct to its defaults. More...
 
static void MCSPI_Transaction_init (MCSPI_Transaction *trans)
 Function to initialize the MCSPI_Transaction struct to its defaults. More...
 
int32_t MCSPI_reConfigFifo (MCSPI_Handle handle, uint32_t chNum, uint32_t numWordsRxTx)
 Function to re-configure Effective FIFO Words. More...
 
uint32_t MCSPI_getBaseAddr (MCSPI_Handle handle)
 Function to get base address of MCSPI instance of a particular handle. More...
 

Data Structures

struct  MCSPI_OpenParams
 MCSPI Parameters. More...
 
struct  MCSPI_Attrs
 MCSPI instance attributes - used during init time. More...
 
struct  MCSPI_Object
 MCSPI driver object. More...
 
struct  MCSPI_Config
 MCSPI global configuration array. More...
 

Typedefs

typedef void * MCSPI_Handle
 A handle that is returned from a MCSPI_open() call. More...