138 #include "Std_Types.h" 140 #if defined (SOC_J721E) || defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4) 141 #include <ti/drv/udma/udma.h> 143 #include "Spi/mcspi_hw/V0/mcspi.h" 161 #define SPI_SW_MAJOR_VERSION (9U) 163 #define SPI_SW_MINOR_VERSION (0U) 165 #define SPI_SW_PATCH_VERSION (1U) 175 #define SPI_AR_RELEASE_MAJOR_VERSION (4U) 177 #define SPI_AR_RELEASE_MINOR_VERSION (3U) 179 #define SPI_AR_RELEASE_REVISION_VERSION (1U) 187 #define SPI_VENDOR_ID ((uint16) 44U) 189 #define SPI_MODULE_ID ((uint16) 83U) 191 #define SPI_INSTANCE_ID ((uint8) 0U) 203 #define SPI_IB_EB (2U) 250 #ifndef SPI_E_PARAM_CHANNEL 252 #define SPI_E_PARAM_CHANNEL ((uint8) 0x0AU) 254 #ifndef SPI_E_PARAM_JOB 256 #define SPI_E_PARAM_JOB ((uint8) 0x0BU) 258 #ifndef SPI_E_PARAM_SEQ 260 #define SPI_E_PARAM_SEQ ((uint8) 0x0CU) 262 #ifndef SPI_E_PARAM_LENGTH 264 #define SPI_E_PARAM_LENGTH ((uint8) 0x0DU) 266 #ifndef SPI_E_PARAM_UNIT 268 #define SPI_E_PARAM_UNIT ((uint8) 0x0EU) 270 #ifndef SPI_E_PARAM_POINTER 272 #define SPI_E_PARAM_POINTER ((uint8) 0x10U) 276 #define SPI_E_UNINIT ((uint8) 0x1AU) 278 #ifndef SPI_E_SEQ_PENDING 280 #define SPI_E_SEQ_PENDING ((uint8) 0x2AU) 282 #ifndef SPI_E_SEQ_IN_PROCESS 284 #define SPI_E_SEQ_IN_PROCESS ((uint8) 0x3AU) 286 #ifndef SPI_E_ALREADY_INITIALIZED 291 #define SPI_E_ALREADY_INITIALIZED ((uint8) 0x4AU) 293 #ifndef SPI_E_SEQUENCE_NOT_OK 295 #define SPI_E_SEQUENCE_NOT_OK ((uint8) 0x5AU) 308 #define SPI_SID_INIT ((uint8) 0x00U) 310 #define SPI_SID_DEINIT ((uint8) 0x01U) 312 #define SPI_SID_WRITE_IB ((uint8) 0x02U) 314 #define SPI_SID_ASYNC_TRANSMIT ((uint8) 0x03U) 316 #define SPI_SID_READ_IB ((uint8) 0x04U) 318 #define SPI_SID_SETUP_EB ((uint8) 0x05U) 320 #define SPI_SID_GET_STATUS ((uint8) 0x06U) 322 #define SPI_SID_GET_JOB_RESULT ((uint8) 0x07U) 324 #define SPI_SID_GET_SEQ_RESULT ((uint8) 0x08U) 326 #define SPI_SID_GET_VERSION_INFO ((uint8) 0x09U) 328 #define SPI_SID_SYNC_TRANSMIT ((uint8) 0x0AU) 330 #define SPI_SID_GET_HW_UNIT_STATUS ((uint8) 0x0BU) 332 #define SPI_SID_CANCEL ((uint8) 0x0CU) 334 #define SPI_SID_SET_ASYNC_MODE ((uint8) 0x0DU) 336 #define SPI_SID_MAINFUNCTION_HANDLING ((uint8) 0x10U) 348 #define SPI_MCSPI_FCLK (48000000U) 358 #define SPI_CFG_ID_0 (0x01U) 361 #define SPI_CFG_ID_1 (0x02U) 363 #define SPI_CFG_ID_2 (0x04U) 365 #define SPI_CFG_ID_3 (0x08U) 367 #define SPI_CFG_ID_4 (0x10U) 369 #define SPI_CFG_ID_5 (0x20U) 371 #define SPI_CFG_ID_6 (0x40U) 373 #define SPI_CFG_ID_7 (0x80U) 803 typedef struct Spi_ConfigType_s
847 typedef struct Spi_ChannelConfigType_PC_s
859 typedef struct Spi_JobConfigType_PC_s
873 typedef struct Spi_SeqConfigType_PC_s
879 #if (STD_ON == SPI_REGISTER_READBACK_API) 960 FUNC(Std_ReturnType, SPI_CODE)
Spi_DeInit(
void);
1026 #if (STD_ON == SPI_VERSION_INFO_API) 1048 P2VAR(Std_VersionInfoType, AUTOMATIC, SPI_APPL_DATA) versioninfo);
1051 #if (STD_ON == SPI_HW_STATUS_API) 1076 #if ((SPI_CHANNELBUFFERS == SPI_IB) || (SPI_CHANNELBUFFERS == SPI_IB_EB)) 1139 #if ((SPI_CHANNELBUFFERS == SPI_EB) || (SPI_CHANNELBUFFERS == SPI_IB_EB)) 1172 FUNC(Std_ReturnType, SPI_CODE) Spi_SetupEB(
1180 #if ((SPI_SCALEABILITY == SPI_LEVEL_1) || (SPI_SCALEABILITY == \ 1206 #if (STD_ON == SPI_CANCEL_API) 1228 #if ((SPI_SCALEABILITY == SPI_LEVEL_0) || (SPI_SCALEABILITY == \ 1254 #if (SPI_SCALEABILITY == SPI_LEVEL_2) 1304 #if (STD_ON == SPI_REGISTER_READBACK_API) 1339 #if (STD_ON == SPI_SAFETY_API)
SPI Sequence configuration structure.
Definition: Spi.h:769
uint8 Spi_SequenceType
Specifies the identification (ID) for a sequence of jobs.
Definition: Spi.h:234
Std_ReturnType Spi_RegisterReadback(Spi_HWUnitType HWUnit, Spi_RegisterReadbackType *RegRbPtr)
This function reads the important registers of the hardware unit and returns the value in the structu...
Spi_SeqEndNotifyType Spi_SequenceEndNotification
Definition: Spi.h:773
Std_ReturnType Spi_SyncTransmit(Spi_SequenceType Sequence)
Service to transmit data on the SPI bus.
Spi_SeqResultType Spi_GetSequenceResult(Spi_SequenceType Sequence)
This service returns the last transmission result of the specified Sequence.
#define SPI_MAX_JOBS
Maximum jobs across all sequence/hwunit.
Definition: Spi_Cfg.h:185
void(* Spi_CacheInv)(uint8 *BufPtr, uint16 LenByte)
Cache invalidate function.
Definition: Spi.h:658
Spi_JobPriorityType jobPriority
Definition: Spi.h:750
Spi_AsyncModeType
Specifies the asynchronous mechanism mode for SPI busses handled asynchronously in LEVEL 2.
Definition: Spi.h:463
Spi_DataLineTransmitType transmissionLineEnable
Definition: Spi.h:728
#define SPI_MAX_CHANNELS_PER_JOB
Maximum channels allowed per job.
Definition: Spi_Cfg.h:176
Spi_StatusType Spi_GetHWUnitStatus(Spi_HWUnitType HWUnit)
This service returns the status of the specified SPI Hardware microcontroller peripheral.
Spi_NumberOfDataType maxBufLength
Definition: Spi.h:676
void(* Spi_CacheWb)(uint8 *BufPtr, uint16 LenByte)
Cache write-back function.
Definition: Spi.h:648
Std_ReturnType Spi_WriteIB(Spi_ChannelType Channel, const Spi_DataBufferType *DataBufferPtr)
Service for writing one or more data to an IB SPI Handler/Driver Channel specified by parameter.
uint8 externalDeviceCfgId
Definition: Spi.h:865
Spi_CacheWb cacheWb
Definition: Spi.h:828
void Spi_GetVersionInfo(Std_VersionInfoType *versioninfo)
This service returns the version information of this module.
Spi_JobResultType
This type defines a range of specific Jobs status for SPI Handler/Driver.
Definition: Spi.h:408
Spi_CsPinType
SPI Chip Select Pin.
Definition: Spi.h:499
Spi_TxRxMode
SPI TX/RX Mode.
Definition: Spi.h:539
uint8 Spi_HWUnitType
Specifies the identification (ID) for a SPI Hardware micro controller peripheral (unit)
Definition: Spi.h:242
#define SPI_MAX_HW_UNIT
Maximum HW unit - This should match the sum for the below units ISR which are ON.
Definition: Spi_Cfg.h:194
Mcspi_IrqStatusType
Irq status and std return type.
Definition: Spi.h:621
boolean enabledmaMode
Definition: Spi.h:789
Std_ReturnType Spi_dataOverflowUnderflowIntrDisable(Spi_HWUnitType HWUnit, uint32 intFlags)
This function Disable Under/Overflow Interupts of the hardware unit and returns the status.
Spi_DataDelayType
Spi_DataDelayType defines the number of interface clock cycles between CS toggling and first or last ...
Definition: Spi.h:580
Std_ReturnType Spi_SetAsyncMode(Spi_AsyncModeType Mode)
Service to set the asynchronous mechanism mode for SPI busses handled asynchronously.
Spi_HWUnitType hwUnitId
Definition: Spi.h:787
uint16 Spi_NumberOfDataType
Type for defining the number of data elements of the type Spi_DataBufferType to send and / or receive...
Definition: Spi.h:219
uint8 Spi_DataBufferType
Type of application data buffer elements.
Definition: Spi.h:211
SPI channel config structure parameters Pre-Compile only.
Definition: Spi.h:847
uint32 clkDivider
Definition: Spi.h:711
uint32 defaultTxData
Definition: Spi.h:674
#define SPI_MAX_JOBS_PER_SEQ
Maximum jobs allowed per sequence.
Definition: Spi_Cfg.h:179
uint32 udmaInstId
Definition: Spi.h:820
uint32 mcspiCh3config
Definition: Spi.h:908
Spi_CsModeType
SPI Chip Select Mode.
Definition: Spi.h:568
uint16 Spi_JobType
Specifies the identification (ID) for a Job.
Definition: Spi.h:229
Spi_SeqResultType
This type defines a range of specific Sequences status for SPI Handler/Driver.
Definition: Spi.h:429
Spi_HwUnitResultType
This type defines a range of specific HW unit status for SPI Handler/Driver.
Definition: Spi.h:446
#define SPI_MAX_CHANNELS
Maximum channels across all jobs/sequence/hwunit.
Definition: Spi_Cfg.h:182
SPI job config structure parameters Pre-Compile only.
Definition: Spi.h:859
SPI sequence config structure parameters Pre-Compile only.
Definition: Spi.h:873
Spi_TransferType transferType
Definition: Spi.h:686
uint32 mcspiRev
Definition: Spi.h:895
Mcspi_IrqStatusType Spi_dataOverflowUnderflowIntrGetStatus(Spi_HWUnitType HWUnit, uint32 intFlags)
This function status Under/Overflow Interupts of the hardware unit and returns the status.
uint16 startBitEnable
Definition: Spi.h:721
uint32 mcspiHlSysConfig
Definition: Spi.h:893
SPI Hardware unit configuration structure.
Definition: Spi.h:785
Spi_CacheWbInv cacheWbInv
Definition: Spi.h:826
uint8 dataWidth
Definition: Spi.h:671
Spi_ChannelType channelId
Definition: Spi.h:849
Spi_StatusType Spi_GetStatus(void)
Service returns the SPI Handler/Driver software module status.
Spi_CsModeType csMode
Definition: Spi.h:698
uint32 dmaTxChIntrNum
Definition: Spi.h:791
Std_ReturnType Spi_dataOverflowUnderflowIntrStatusClear(Spi_HWUnitType HWUnit, uint32 intFlags)
This function status clear Under/Overflow Interupts of the hardware unit and returns the status.
Spi_ClkMode clkMode
Definition: Spi.h:717
void(* Spi_CacheWbInv)(uint8 *BufPtr, uint16 LenByte)
Cache write-back invalidate function.
Definition: Spi.h:638
uint8 maxExtDevCfg
Definition: Spi.h:817
Spi_LevelType csPolarity
Definition: Spi.h:701
Spi_DataLineReceiveType receptionLineEnable
Definition: Spi.h:726
This file contains generated pre compile configuration file for SPI MCAL driver.
uint32 mcspiIrqenable
Definition: Spi.h:910
#define SPI_MAX_EXT_DEV
Maximum external device cfg.
Definition: Spi_Cfg.h:199
Spi_DataDelayType csIdleTime
Definition: Spi.h:703
Spi_McspiExternalDeviceConfigType mcspi
Definition: Spi.h:737
Std_ReturnType Spi_DeInit(void)
Service for SPI de-initialization.
void Spi_Init(const Spi_ConfigType *CfgPtr)
Service for SPI initialization.
uint8 maxSeq
Definition: Spi.h:811
Spi_LevelType startBitLevel
Definition: Spi.h:724
void Spi_Cancel(Spi_SequenceType Sequence)
Service cancels the specified on-going sequence transmission.
uint32 mcspiModulctrl
Definition: Spi.h:901
uint8 maxHwUnit
Definition: Spi.h:814
#define SPI_MAX_SEQ
Maximum sequence across all hwunit.
Definition: Spi_Cfg.h:188
Spi_CacheInv cacheInv
Definition: Spi.h:830
Spi_StatusType
This type defines a range of specific status for SPI Handler/Driver.
Definition: Spi.h:391
Std_ReturnType Spi_dataOverflowUnderflowIntrEnable(Spi_HWUnitType HWUnit, uint32 intFlags)
This function Enable Under/Overflow Interupts of the hardware unit and returns the status.
uint32 channelPerJob
Definition: Spi.h:756
uint32 mcspiCh0config
Definition: Spi.h:905
uint32 mcspiSysConfig
Definition: Spi.h:903
uint8 seqInterruptible
Definition: Spi.h:771
SPI register readback structure.
Definition: Spi.h:884
uint32 jobPerSeq
Definition: Spi.h:775
Spi_ClkMode
SPI Clock Mode - sets the clock polarity and phase. Note: These values are a direct register mapping....
Definition: Spi.h:515
uint32 mcspiHlRev
Definition: Spi.h:889
Spi_HWUnitType hwUnitId
Definition: Spi.h:752
uint32 mcspiSyst
Definition: Spi.h:899
Spi_TxRxMode txRxMode
Definition: Spi.h:719
SPI external device specific configuration structure .
Definition: Spi.h:735
uint32 dmaRxChIntrNum
Definition: Spi.h:793
uint8 maxChannels
Definition: Spi.h:805
SPI Job configuration structure specific to McSPI peripheral.
Definition: Spi.h:694
Std_ReturnType Spi_ReadIB(Spi_ChannelType Channel, Spi_DataBufferType *DataBufferPointer)
Service for reading synchronously one or more data from an IB SPI Handler/Driver Channel specified by...
Spi_JobType jobId
Definition: Spi.h:861
SPI Job configuration structure.
Definition: Spi.h:748
Spi_LevelType
Type for SPI Chip Select Polarity and Clock Idle Level.
Definition: Spi.h:488
Spi_JobEndNotifyType Spi_JobEndNotification
Definition: Spi.h:754
Spi_DataLineTransmitType
Spi_DataLineTransmitType defines the lines selected for transmission.
Definition: Spi.h:606
uint32 mcspiSysStatus
Definition: Spi.h:897
Spi_CsPinType csPin
Definition: Spi.h:863
uint32 mcspiHlHwInfo
Definition: Spi.h:891
Spi_JobPriorityType
SPI Job Priority.
Definition: Spi.h:553
Spi_DataLineReceiveType
Spi_DataLineReceiveType defines the lines selected for reception.
Definition: Spi.h:595
uint8 Spi_ChannelType
Specifies the identification (ID) for a Channel.
Definition: Spi.h:224
void Spi_MainFunction_Handling(void)
This function polls the SPI interrupts linked to HW Units allocated to the transmission of SPI sequen...
SPI Channel configuration structure.
Definition: Spi.h:667
Spi_SequenceType seqId
Definition: Spi.h:875
Std_ReturnType Spi_AsyncTransmit(Spi_SequenceType Sequence)
Service to transmit data on the SPI bus.
uint8 channelBufType
Definition: Spi.h:669
uint32 mcspiCh2config
Definition: Spi.h:907
uint16 csEnable
Definition: Spi.h:696
Spi_TransferType
Word transfer order - MSB first or LSB first.
Definition: Spi.h:477
Spi_JobResultType Spi_GetJobResult(Spi_JobType Job)
This service returns the last transmission result of the specified Job.
SPI config structure.
Definition: Spi.h:803
uint8 maxJobs
Definition: Spi.h:808
uint32 mcspiCh1config
Definition: Spi.h:906