AM273x MCU+ SDK  08.01.01
mibspi/v0/mibspi.h File Reference

Introduction

MIBSPI Driver API/interface file.

Go to the source code of this file.

Data Structures

struct  MIBSPI_HW_Stats
 SPI Driver Statistics. More...
 
struct  MIBSPI_Stats
 MIBSPI_Stats data structure is used with SPI_getStats() to get driver statistics. More...
 
struct  MIBSPI_SlaveProfile
 MIBSPI slave profile Parameters. More...
 
struct  MIBSPI_SlaveModeParams
 MIBSPI slave mode Parameters. More...
 
struct  MIBSPI_DriverDmaInfo
 SPI Driver Info for Master. More...
 
struct  MIBSPI_DMAReqlineCfg
 MIBSPI Driver DMA request line tie up for the SoC. More...
 
struct  MIBSPI_DMAXferAddrInfo
 MIBSPI Driver DMA module Address info definition. More...
 
struct  MIBSPI_DMAXferSizeInfo
 MIBSPI Driver DMA module Transfer size definition. More...
 
struct  MIBSPI_DMAXferInfo
 MIBSPI Driver DMA module Transfer Info definition. More...
 
struct  MIBSPI_Transaction
 MIBSPI_Transaction data structure is used with MIBSPI_transfer(). It indicates how many MIBSPI_FrameFormat frames are sent and received from the buffers pointed to txBuf and rxBuf. More...
 
struct  MIBSPI_TransactionState
 MIBSPI Driver DMA module Tranaction state definition. More...
 
struct  MIBSPI_MasterModeParams
 MIBSPI master Parameters. More...
 
struct  MIBSPI_EDMAChParams
 MIBSPI EDMA Parameters. More...
 
struct  MIBSPI_OpenParams
 MIBSPI Parameters. More...
 
struct  MIBSPI_Attrs
 MIBSPI Driver HW configuration. More...
 
struct  MIBSPI_Object
 SPI Driver Object. More...
 
struct  MIBSPI_Config
 MIBSPI Instance configuration. More...
 

Macros

#define MIBSPI_RAM_BUFFER_MODE   (7U)
 MibSPI RAM buffer mode. More...
 
#define MIBSPI_SLAVEMODE_TRANS_GROUP   (0U)
 Transfer group used in slave mode. More...
 
#define MIBSPI_INT_LEVEL   (1U)
 MIBSPI interrupt level. More...
 
#define MIBSPI_FEATURE_PARALLEL_MODE_ENA   (0x1U << 0)
 MIBSPI Parallel mode operation Enable. More...
 
#define MIBSPI_FEATURE_PARALLEL_MODE_DIS   (0U)
 MIBSPI Parallel mode operation Disable. More...
 
#define MIBSPI_FEATURE_MODULO_MODE_ENA   (0x1U << 1)
 MIBSPI Modulo mode operation Enable. More...
 
#define MIBSPI_FEATURE_MODULO_MODE_DIS   (0U)
 MIBSPI Modulo mode operation Disable. More...
 
#define MIBSPI_FEATURE_SPIENA_PIN_ENA   (0x1U << 2)
 MIBSPI SPIENA pin Enable. More...
 
#define MIBSPI_FEATURE_SPIENA_PIN_DIS   (0U)
 MIBSPI SPIENA pin Disable. More...
 
#define MIBSPI_RAM_MAX_ELEM   (128U)
 Maximum element in MibSPI RAM. For 8bit data size, the maximum transfer size is 64 bytes For 16bit data size, the maximum transfer size is 128 bytes. More...
 
#define MIBSPI_SLAVE_MAX   (3U)
 Max number of slaves supported when MibSPI is configured as master. More...
 
#define MIBSPI_DMA_REQLINE_MAX   (3U)
 Max number of DMA REQ lines supported by MIBSPI. More...
 
#define MIBSPI_MAX_CS   (MIBSPI_SLAVE_MAX)
 Maximum CS supported for the device. More...
 
#define MIBSPI_NUM_TRANS_GROUP   (8U)
 Max number of transport group. More...
 
#define MIBSPI_NUM_DMA_GROUP   (8U)
 Max number of DMA group. More...
 
#define MIBSPI_CS_NONE   (0xFFU)
 CS configuration value when none of the CS is activated. More...
 

Typedefs

typedef void * MIBSPI_Handle
 A handle that is returned from a MIBSPI_open() call. More...
 
typedef void(* MIBSPI_CallbackFxn) (MIBSPI_Handle handle, MIBSPI_Transaction *transaction)
 The definition of a callback function used by the SPI driver when used in MIBSPI_MODE_CALLBACK. More...
 

Enumerations

enum  MIBSPI_EdmaCBFlag_e { MIBSPI_NONE_EDMA_CALLBACK_OCCURED = 0x0U, MIBSPI_TX_EDMA_CALLBACK_OCCURED = 0x1U, MIBSPI_RX_EDMA_CALLBACK_OCCURED = 0x2U }
 Enum used to track status of EDMA callbacks internally in driver. More...
 
enum  MIBSPI_XferErr_e { MIBSPI_XFER_ERR_NONE, MIBSPI_XFER_ERR_RXOR, MIBSPI_XFER_ERR_BE, MIBSPI_XFER_ERR_TIMEOUT }
 SPI_v3 transfer error code. More...
 
enum  MIBSPI_Status {
  MIBSPI_TRANSFER_COMPLETED = 0, MIBSPI_TRANSFER_STARTED, MIBSPI_TRANSFER_CANCELED, MIBSPI_TRANSFER_FAILED,
  MIBSPI_TRANSFER_CSN_DEASSERT, MIBSPI_TRANSFER_TIMEOUT
}
 Status codes that are set by the SPI driver. More...
 
enum  MIBSPI_PinMode { MIBSPI_PINMODE_3PIN = 0, MIBSPI_PINMODE_4PIN_CS = 1 }
 Definitions for MIBSPI Pins Operation Mode. More...
 
enum  MIBSPI_DataShiftFmt { MIBSPI_MSB_FIRST = 0, MIBSPI_LSB_FIRST = 1 }
 Definitions for MIBSPI Data shift format. More...
 
enum  MIBSPI_LoopBackType { MIBSPI_LOOPBK_DIGITAL = 0, MIBSPI_LOOPBK_ANALOG = 1, MIBSPI_LOOPBK_NONE = 2 }
 Definitions for MIBSPI loopback modes. More...
 
enum  MIBSPI_Mode { MIBSPI_MASTER = 0, MIBSPI_SLAVE = 1 }
 Definitions for various SPI modes of operation. More...
 
enum  MIBSPI_FrameFormat { MIBSPI_POL0_PHA0 = 0, MIBSPI_POL0_PHA1 = 1, MIBSPI_POL1_PHA0 = 2, MIBSPI_POL1_PHA1 = 3 }
 Definitions for various SPI data frame formats. More...
 
enum  MIBSPI_TransferMode { MIBSPI_MODE_BLOCKING, MIBSPI_MODE_CALLBACK }
 MIBSPI transfer mode determines the whether the MIBSPI controller operates synchronously or asynchronously. In MIBSPI_MODE_BLOCKING mode MIBSPI_transfer() blocks code execution until the MIBSPI transaction has completed. In MIBSPI_MODE_CALLBACK MIBSPI_transfer() does not block code execution and instead calls a MIBSPI_CallbackFxn callback function when the transaction has completed. More...
 
enum  MIBSPI_DmaCtrlChType { MIBSPI_DMACTRL_CH_TX, MIBSPI_DMACTRL_CH_RX, MIBSPI_DMACTRL_CH_BOTH }
 Definitions for DMA controller channel type. More...
 

Functions

void MIBSPI_init (void)
 This function initializes the MIBSPI module. More...
 
void MIBSPI_deinit (void)
 This function de-initializes the MIBSPI module. More...
 
MIBSPI_Handle MIBSPI_open (uint32_t index, MIBSPI_OpenParams *params)
 This function opens a given instance of the MIBSPI peripheral. More...
 
void MIBSPI_close (MIBSPI_Handle handle)
 Function to close a instance of a MIBSPI peripheral specified by the MIBSPI handle. More...
 
int32_t MIBSPI_transfer (MIBSPI_Handle handle, MIBSPI_Transaction *transaction)
 Function to perform MIBSPI transactions on a instance of a MIBSPI peripheral specified by the MIBSPI handle for a specific slave. More...
 
void MIBSPI_transferCancel (MIBSPI_Handle handle)
 Function to cancel MIBSPI transactions on instance of a MIBSPI peripheral specified by the MIBSPI handle. More...
 
int32_t MIBSPI_enableLoopback (MIBSPI_Handle handle, MIBSPI_LoopBackType loopbacktype)
 This function enables the Loopback mode for self test. Loopback is SPI master only feature. More...
 
int32_t MIBSPI_disableLoopback (MIBSPI_Handle handle)
 This function disable the Loopback mode. More...
 
int32_t MIBSPI_setClockPhasePolarity (MIBSPI_Handle handle, uint8_t clockFmt)
 This function sets the Polarity and phase for MibSpi as requested. More...
 
int32_t MIBSPI_getDrvStats (MIBSPI_Handle handle, MIBSPI_Stats *ptrStats)
 Get SPI driver internal stats. More...
 
void MIBSPI_dmaDoneCb (MIBSPI_Handle mibspiHandle)
 Function invoked by the SoC DMA implementation to the driver on DMA transfer completion. More...
 
static void MIBSPI_Params_init (MIBSPI_OpenParams *openPrms)
 Function to initialize the MIBSPI_OpenParams struct to its defaults. More...
 

Variables

MIBSPI_Config gMibspiConfig []
 Externally defined driver configuration array. More...
 
uint32_t gMibspiConfigNum
 Externally defined driver configuration array size. More...