![]() |
MCUSW
|
This file contains interface header for SPI MCAL driver.
Go to the source code of this file.
SPI Buffer Definition | |
| #define | SPI_IB (0U) |
| Buffer definitions IB - internal buffers. More... | |
| #define | SPI_EB (1U) |
| Buffer definitions EB - external buffers. Only this is supported. More... | |
| #define | SPI_IB_EB (2U) |
| Buffer definitions IB/EB - internal/external buffers. More... | |
| typedef uint8 | Spi_DataBufferType |
| Type of application data buffer elements. More... | |
| typedef uint16 | Spi_NumberOfDataType |
| Type for defining the number of data elements of the type Spi_DataBufferType to send and / or receive by Channel. More... | |
| typedef uint8 | Spi_ChannelType |
| Specifies the identification (ID) for a Channel. More... | |
| typedef uint16 | Spi_JobType |
| Specifies the identification (ID) for a Job. More... | |
| typedef uint8 | Spi_SequenceType |
| Specifies the identification (ID) for a sequence of jobs. More... | |
| typedef uint8 | Spi_HWUnitType |
| Specifies the identification (ID) for a SPI Hardware micro controller peripheral (unit) More... | |
SPI Config Ids | |
| #define | SPI_CFG_ID_0 (0x01U) |
| Config 0 (All configurations ON), Scaleability level 2) More... | |
| #define | SPI_CFG_ID_1 (0x02U) |
| Config 1 (All configurations OFF). SPI_CFG_ID_1 is used only for compile check. More... | |
| #define | SPI_CFG_ID_2 (0x04U) |
| Config 2 (All configurations ON except DET OFF) More... | |
| #define | SPI_CFG_ID_3 (0x08U) |
| Config 3 (Configurator auto generated file) More... | |
| #define | SPI_CFG_ID_4 (0x10U) |
| Config 4 (Config is used only by Unit Test, Scaleability level 0) More... | |
| #define | SPI_CFG_ID_5 (0x20U) |
| Config 5 (Config is used only by Unit Test for DMA More... | |
| #define | SPI_CFG_ID_6 (0x40U) |
| Config 6 (Config is used only by Unit Test for DMA. More... | |
| #define | SPI_CFG_ID_7 (0x80U) |
| Config 7 (Performance testing only, level 2, asynch, no DMA) More... | |
| #define | SPI_CFG_ID_8 (0x100U) |
| Config 8 (Loopback test on different data sizes, level 1, asynch, no DMA) More... | |
| enum | Spi_StatusType { SPI_UNINIT = 0U, SPI_IDLE = 1U, SPI_BUSY = 2U } |
| This type defines a range of specific status for SPI Handler/Driver. More... | |
| enum | Spi_JobResultType { SPI_JOB_OK = 0U, SPI_JOB_PENDING = 1U, SPI_JOB_FAILED = 2U, SPI_JOB_QUEUED = 3U } |
| This type defines a range of specific Jobs status for SPI Handler/Driver. More... | |
| enum | Spi_SeqResultType { SPI_SEQ_OK = 0U, SPI_SEQ_PENDING = 1U, SPI_SEQ_FAILED = 2U, SPI_SEQ_CANCELLED = 3U } |
| This type defines a range of specific Sequences status for SPI Handler/Driver. More... | |
| enum | Spi_HwUnitResultType { SPI_HW_UNIT_OK = 0U, SPI_HW_UNIT_PENDING = 1U, SPI_HW_UNIT_FAILED = 2U } |
| This type defines a range of specific HW unit status for SPI Handler/Driver. More... | |
| enum | Spi_AsyncModeType { SPI_POLLING_MODE = 0U, SPI_INTERRUPT_MODE = 1U } |
| Specifies the asynchronous mechanism mode for SPI busses handled asynchronously in LEVEL 2. More... | |
| enum | Spi_TransferType { SPI_MSB = 0U, SPI_LSB = 1U } |
| Word transfer order - MSB first or LSB first. More... | |
| enum | Spi_LevelType { SPI_LOW = STD_LOW, SPI_HIGH } |
| Type for SPI Chip Select Polarity and Clock Idle Level. More... | |
| enum | Spi_CsPinType { SPI_CS0 = 0U, SPI_CS1, SPI_CS2, SPI_CS3 } |
| SPI Chip Select Pin. More... | |
| enum | Spi_ClkMode { SPI_CLK_MODE_0 = 0x00U, SPI_CLK_MODE_1 = 0x01U, SPI_CLK_MODE_2 = 0x02U, SPI_CLK_MODE_3 = 0x03U } |
| SPI Clock Mode - sets the clock polarity and phase. Note: These values are a direct register mapping. So don't change value. More... | |
| enum | Spi_TxRxMode { SPI_TX_RX_MODE_BOTH = 0x00U, SPI_TX_RX_MODE_TX_ONLY = 0x02U } |
| SPI TX/RX Mode. More... | |
| enum | Spi_JobPriorityType { SPI_JOB_PRIORITY_0 = 0U, SPI_JOB_PRIORITY_1, SPI_JOB_PRIORITY_2, SPI_JOB_PRIORITY_3 } |
| SPI Job Priority. More... | |
| enum | Spi_CsModeType { SPI_SINGLE = 0U, SPI_CONTINUOUS = 1U } |
| SPI Chip Select Mode. More... | |
| enum | Spi_DataDelayType { SPI_DATADELAY_0 = 0U, SPI_DATADELAY_1 = 1U, SPI_DATADELAY_2 = 2U, SPI_DATADELAY_3 = 3U } |
| Spi_DataDelayType defines the number of interface clock cycles between CS toggling and first or last edge of MCSPI clock. More... | |
| enum | Spi_DataLineReceiveType { DATA_LINE_0_RECEPTION = 0U, DATA_LINE_1_RECEPTION = 1U } |
| Spi_DataLineReceiveType defines the lines selected for reception. More... | |
| enum | Spi_DataLineTransmitType { DATA_LINE_NO_TRANSMISSION = 0x3U, DATA_LINE_0_TRANSMISSION = 0x2U, DATA_LINE_1_TRANSMISSION = 0x1U, DATA_LINE_BOTH_TRANSMISSION = 0x0U } |
| Spi_DataLineTransmitType defines the lines selected for transmission. More... | |
| enum | Mcspi_IrqStatusType { SPI_NO_EVENT = 0U, SPI_EVENT_PENDING = 1U, SPI_STATUS_READ_FAIL = 2U } |
| Irq status and std return type. More... | |
| typedef void(* | Spi_CacheWbInv) (uint8 *BufPtr, uint16 LenByte) |
| Cache write-back invalidate function. More... | |
| typedef void(* | Spi_CacheWb) (uint8 *BufPtr, uint16 LenByte) |
| Cache write-back function. More... | |
| typedef void(* | Spi_CacheInv) (uint8 *BufPtr, uint16 LenByte) |
| Cache invalidate function. More... | |
| AUTOMATIC | |
| SPI_CONFIG_DATA | CfgPtr |
| SPI_APPL_DATA | versioninfo |
| FUNC (void, SPI_CODE) Spi_Init(P2CONST(Spi_ConfigType | |
| Service for SPI initialization. More... | |
| FUNC (Std_ReturnType, SPI_CODE) Spi_DeInit(void) | |
| Service for SPI de-initialization. More... | |
| FUNC (Spi_StatusType, SPI_CODE) Spi_GetStatus(void) | |
| Service returns the SPI Handler/Driver software module status. More... | |
| FUNC (Spi_JobResultType, SPI_CODE) Spi_GetJobResult(Spi_JobType Job) | |
| This service returns the last transmission result of the specified Job. More... | |
| FUNC (Spi_SeqResultType, SPI_CODE) Spi_GetSequenceResult(Spi_SequenceType Sequence) | |
| This service returns the last transmission result of the specified Sequence. More... | |
| P2CONST (Spi_DataBufferType, AUTOMATIC, SPI_APPL_DATA) DataBufferPtr) | |
| P2VAR (Spi_DataBufferType, AUTOMATIC, SPI_APPL_DATA) DataBufferPointer) | |
| P2VAR (Spi_RegisterReadbackType, AUTOMATIC, SPI_APPL_DATA) RegRbPtr) | |
Data Structures | |
| struct | Spi_ChannelConfigType |
| SPI Channel configuration structure. More... | |
| struct | Spi_McspiExternalDeviceConfigType |
| SPI Job configuration structure specific to McSPI peripheral. More... | |
| struct | Spi_ExternalDeviceConfigType |
| SPI external device specific configuration structure . More... | |
| struct | Spi_JobConfigType |
| SPI Job configuration structure. More... | |
| struct | Spi_SeqConfigType |
| SPI Sequence configuration structure. More... | |
| struct | Spi_HwUnitConfigType |
| SPI Hardware unit configuration structure. More... | |
| struct | Spi_ConfigType |
| SPI config structure. More... | |
| struct | Spi_ChannelConfigType_PC |
| SPI channel config structure parameters Pre-Compile only. More... | |
| struct | Spi_JobConfigType_PC |
| SPI job config structure parameters Pre-Compile only. More... | |
| struct | Spi_SeqConfigType_PC |
| SPI sequence config structure parameters Pre-Compile only. More... | |
| struct | Spi_RegisterReadbackType |
| SPI register readback structure. More... | |
Macros | |
SPI Driver Module SW Version Info | |
Defines for SPI Driver version used for compatibility checks | |
| #define | SPI_SW_MAJOR_VERSION (9U) |
| Driver Implementation Major Version. More... | |
| #define | SPI_SW_MINOR_VERSION (2U) |
| Driver Implementation Minor Version. More... | |
| #define | SPI_SW_PATCH_VERSION (1U) |
| Driver Implementation Patch Version. More... | |
SPI Driver Module AUTOSAR Version Info | |
Defines for SPI Driver AUTOSAR version used for compatibility checks | |
| #define | SPI_AR_RELEASE_MAJOR_VERSION (4U) |
| AUTOSAR Major version specification implemented by SPI Driver. More... | |
| #define | SPI_AR_RELEASE_MINOR_VERSION (3U) |
| AUTOSAR Minor version specification implemented by SPI Driver. More... | |
| #define | SPI_AR_RELEASE_REVISION_VERSION (1U) |
| AUTOSAR Patch version specification implemented by SPI Driver. More... | |
SPI Driver ID Info | |
| #define | SPI_VENDOR_ID ((uint16) 44U) |
| Texas Instruments Vendor ID. More... | |
| #define | SPI_MODULE_ID ((uint16) 83U) |
| SPI Driver Module ID. More... | |
| #define | SPI_INSTANCE_ID ((uint8) 0U) |
| SPI Driver Instance ID. More... | |
SPI Error Codes | |
Error codes returned by SPI functions | |
| #define | SPI_E_PARAM_CHANNEL ((uint8) 0x0AU) |
| API service called with wrong parameter. More... | |
| #define | SPI_E_PARAM_JOB ((uint8) 0x0BU) |
| API service called with wrong parameter. More... | |
| #define | SPI_E_PARAM_SEQ ((uint8) 0x0CU) |
| API service called with wrong parameter. More... | |
| #define | SPI_E_PARAM_LENGTH ((uint8) 0x0DU) |
| API service called with wrong parameter. More... | |
| #define | SPI_E_PARAM_UNIT ((uint8) 0x0EU) |
| API service called with wrong parameter. More... | |
| #define | SPI_E_PARAM_POINTER ((uint8) 0x10U) |
| APIs called with a Null Pointer. More... | |
| #define | SPI_E_UNINIT ((uint8) 0x1AU) |
| API service used without module initiali-zation. More... | |
| #define | SPI_E_SEQ_PENDING ((uint8) 0x2AU) |
| Services called in a wrong sequence. More... | |
| #define | SPI_E_SEQ_IN_PROCESS ((uint8) 0x3AU) |
| Synchronous transmission service called at wrong time. More... | |
| #define | SPI_E_ALREADY_INITIALIZED ((uint8) 0x4AU) |
| API Spi_Init service called while the SPI driver has already been initialized. More... | |
| #define | SPI_E_SEQUENCE_NOT_OK ((uint8) 0x5AU) |
| Sequence did not complete successfully. More... | |
SPI Service Ids | |
The Service Id is one of the argument to Det_ReportError function and is used to identify the source of the error | |
| #define | SPI_SID_INIT ((uint8) 0x00U) |
| Spi_Init() API Service ID. More... | |
| #define | SPI_SID_DEINIT ((uint8) 0x01U) |
| Spi_DeInit() API Service ID. More... | |
| #define | SPI_SID_WRITE_IB ((uint8) 0x02U) |
| Spi_WriteIB() API Service ID. More... | |
| #define | SPI_SID_ASYNC_TRANSMIT ((uint8) 0x03U) |
| Spi_AsyncTransmit() API Service ID. More... | |
| #define | SPI_SID_READ_IB ((uint8) 0x04U) |
| Spi_ReadIB() API Service ID. More... | |
| #define | SPI_SID_SETUP_EB ((uint8) 0x05U) |
| Spi_SetupEB() API Service ID. More... | |
| #define | SPI_SID_GET_STATUS ((uint8) 0x06U) |
| Spi_GetStatus() API Service ID. More... | |
| #define | SPI_SID_GET_JOB_RESULT ((uint8) 0x07U) |
| Spi_GetJobResult() API Service ID. More... | |
| #define | SPI_SID_GET_SEQ_RESULT ((uint8) 0x08U) |
| Spi_GetSequenceResult() API Service ID. More... | |
| #define | SPI_SID_GET_VERSION_INFO ((uint8) 0x09U) |
| Spi_GetVersionInfo() API Service ID. More... | |
| #define | SPI_SID_SYNC_TRANSMIT ((uint8) 0x0AU) |
| Spi_SyncTransmit() API Service ID. More... | |
| #define | SPI_SID_GET_HW_UNIT_STATUS ((uint8) 0x0BU) |
| Spi_GetHWUnitStatus() API Service ID. More... | |
| #define | SPI_SID_CANCEL ((uint8) 0x0CU) |
| Spi_Cancel() API Service ID. More... | |
| #define | SPI_SID_SET_ASYNC_MODE ((uint8) 0x0DU) |
| Spi_SetAsyncMode() API Service ID. More... | |
| #define | SPI_SID_MAINFUNCTION_HANDLING ((uint8) 0x10U) |
| Spi_MainFunction_Handling() API Service ID. More... | |
| #define | SPI_SID_DMA_INIT ((uint8) 0x20U) |
| Spi_GetDmaHandle() API Service ID. More... | |
| #define | SPI_MCSPI_FCLK (48000000U) |
| MCSPI functional clock input in Hz. This clock is used to generate the serial clock output after the divider. More... | |