MCUSW
Spi.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright (c) 2019 Texas Instruments Incorporated
4 *
5 * All rights reserved not granted herein.
6 *
7 * Limited License.
8 *
9 * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
10 * license under copyrights and patents it now or hereafter owns or controls to make,
11 * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
12 * terms herein. With respect to the foregoing patent license, such license is granted
13 * solely to the extent that any such patent is necessary to Utilize the software alone.
14 * The patent license shall not apply to any combinations which include this software,
15 * other than combinations with devices manufactured by or for TI ("TI Devices").
16 * No hardware patent is licensed hereunder.
17 *
18 * Redistributions must preserve existing copyright notices and reproduce this license
19 * (including the above copyright notice and the disclaimer and (if applicable) source
20 * code license limitations below) in the documentation and/or other materials provided
21 * with the distribution
22 *
23 * Redistribution and use in binary form, without modification, are permitted provided
24 * that the following conditions are met:
25 *
26 * * No reverse engineering, decompilation, or disassembly of this software is
27 * permitted with respect to any software provided in binary form.
28 *
29 * * any redistribution and use are licensed by TI for use only with TI Devices.
30 *
31 * * Nothing shall obligate TI to provide you with source code for the software
32 * licensed and provided to you in object code.
33 *
34 * If software source code is provided to you, modification and redistribution of the
35 * source code are permitted provided that the following conditions are met:
36 *
37 * * any redistribution and use of the source code, including any resulting derivative
38 * works, are licensed by TI for use only with TI Devices.
39 *
40 * * any redistribution and use of any object code compiled from the source code
41 * and any resulting derivative works, are licensed by TI for use only with TI Devices.
42 *
43 * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
44 *
45 * may be used to endorse or promote products derived from this software without
46 * specific prior written permission.
47 *
48 * DISCLAIMER.
49 *
50 * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
51 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53 * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
54 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
55 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
57 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
58 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
59 * OF THE POSSIBILITY OF SUCH DAMAGE.
60 *
61 */
62 
116 /*
117  * Below are the global design requirements which are met by this SPI handler
118  * driver which can't be mapped to a particular source ID
119  */
120 /*
121  * Design: MCAL-6422,MCAL-6412,MCAL-6690,MCAL-6487,MCAL-6429,MCAL-6683,MCAL-6384,MCAL-6478,MCAL-6383,MCAL-6593,MCAL-6573,MCAL-6381,MCAL-6492,MCAL-6610,MCAL-6658,MCAL-6451,MCAL-6449,MCAL-6448,MCAL-6581,MCAL-6710,MCAL-6527,MCAL-6642,MCAL-6458,MCAL-6544
122  */
123 
124 /*
125  * Below are the SPI's module environment design requirements which can't be mapped
126  * to this driver.
127  */
128 /*
129  * Design: MCAL-6719,MCAL-6486,MCAL-6415,MCAL-6685,MCAL-6421,MCAL-6390,MCAL-6608,MCAL-6670,MCAL-6643
130  */
131 
132 #ifndef SPI_H_
133 #define SPI_H_
134 
135 /* ========================================================================== */
136 /* Include Files */
137 /* ========================================================================== */
138 #include "Std_Types.h"
139 #include "Spi_Cfg.h"
140 #include <ti/drv/udma/udma.h>
141 #include "Spi/mcspi_hw/V0/mcspi.h"
142 
143 #ifdef __cplusplus
144 extern "C"
145 {
146 #endif
147 
148 /* ========================================================================== */
149 /* Macros & Typedefs */
150 /* ========================================================================== */
151 
159 #define SPI_SW_MAJOR_VERSION (2U)
160 
161 #define SPI_SW_MINOR_VERSION (0U)
162 
163 #define SPI_SW_PATCH_VERSION (0U)
164 /* @} */
165 
173 #define SPI_AR_RELEASE_MAJOR_VERSION (4U)
174 
175 #define SPI_AR_RELEASE_MINOR_VERSION (3U)
176 
177 #define SPI_AR_RELEASE_REVISION_VERSION (1U)
178 /* @} */
179 
185 #define SPI_VENDOR_ID ((uint16) 44U)
186 
187 #define SPI_MODULE_ID ((uint16) 83U)
188 
189 #define SPI_INSTANCE_ID ((uint8) 0U)
190 /* @} */
191 
197 #define SPI_IB (0U)
198 
199 #define SPI_EB (1U)
200 
201 #define SPI_IB_EB (2U)
202 /* @} */
203 
204 
206 /*
207  * Design: MCAL-6691,MCAL-6394,MCAL-6615
208  */
209 typedef uint8 Spi_DataBufferType;
214 /*
215  * Design: MCAL-6625,MCAL-6669
216  */
217 typedef uint16 Spi_NumberOfDataType;
219 /*
220  * Design: MCAL-6528,MCAL-6493,MCAL-6687
221  */
222 typedef uint8 Spi_ChannelType;
224 /*
225  * Design: MCAL-6457,MCAL-6689,MCAL-6728
226  */
227 typedef uint16 Spi_JobType;
229 /*
230  * Design: MCAL-6639,MCAL-6505,MCAL-6729
231  */
232 typedef uint8 Spi_SequenceType;
237 /*
238  * Design: MCAL-6655,MCAL-6682,MCAL-6707
239  */
240 typedef uint8 Spi_HWUnitType;
241 
248 #ifndef SPI_E_PARAM_CHANNEL
249 
250 #define SPI_E_PARAM_CHANNEL ((uint8) 0x0AU)
251 #endif
252 #ifndef SPI_E_PARAM_JOB
253 
254 #define SPI_E_PARAM_JOB ((uint8) 0x0BU)
255 #endif
256 #ifndef SPI_E_PARAM_SEQ
257 
258 #define SPI_E_PARAM_SEQ ((uint8) 0x0CU)
259 #endif
260 #ifndef SPI_E_PARAM_LENGTH
261 
262 #define SPI_E_PARAM_LENGTH ((uint8) 0x0DU)
263 #endif
264 #ifndef SPI_E_PARAM_UNIT
265 
266 #define SPI_E_PARAM_UNIT ((uint8) 0x0EU)
267 #endif
268 #ifndef SPI_E_PARAM_POINTER
269 
270 #define SPI_E_PARAM_POINTER ((uint8) 0x10U)
271 #endif
272 #ifndef SPI_E_UNINIT
273 
274 #define SPI_E_UNINIT ((uint8) 0x1AU)
275 #endif
276 #ifndef SPI_E_SEQ_PENDING
277 
278 #define SPI_E_SEQ_PENDING ((uint8) 0x2AU)
279 #endif
280 #ifndef SPI_E_SEQ_IN_PROCESS
281 
282 #define SPI_E_SEQ_IN_PROCESS ((uint8) 0x3AU)
283 #endif
284 #ifndef SPI_E_ALREADY_INITIALIZED
285 
289 #define SPI_E_ALREADY_INITIALIZED ((uint8) 0x4AU)
290 #endif
291 #ifndef SPI_E_SEQUENCE_NOT_OK
292 
293 #define SPI_E_SEQUENCE_NOT_OK ((uint8) 0x5AU)
294 #endif
295 
296 /* @} */
297 
306 #define SPI_SID_INIT ((uint8) 0x00U)
307 
308 #define SPI_SID_DEINIT ((uint8) 0x01U)
309 
310 #define SPI_SID_WRITE_IB ((uint8) 0x02U)
311 
312 #define SPI_SID_ASYNC_TRANSMIT ((uint8) 0x03U)
313 
314 #define SPI_SID_READ_IB ((uint8) 0x04U)
315 
316 #define SPI_SID_SETUP_EB ((uint8) 0x05U)
317 
318 #define SPI_SID_GET_STATUS ((uint8) 0x06U)
319 
320 #define SPI_SID_GET_JOB_RESULT ((uint8) 0x07U)
321 
322 #define SPI_SID_GET_SEQ_RESULT ((uint8) 0x08U)
323 
324 #define SPI_SID_GET_VERSION_INFO ((uint8) 0x09U)
325 
326 #define SPI_SID_SYNC_TRANSMIT ((uint8) 0x0AU)
327 
328 #define SPI_SID_GET_HW_UNIT_STATUS ((uint8) 0x0BU)
329 
330 #define SPI_SID_CANCEL ((uint8) 0x0CU)
331 
332 #define SPI_SID_SET_ASYNC_MODE ((uint8) 0x0DU)
333 
334 #define SPI_SID_MAINFUNCTION_HANDLING ((uint8) 0x10U)
335 /* @} */
336 
343 /*
344  * Design: MCAL-6699
345  */
346 #define SPI_MCSPI_FCLK (48000000U)
347 
356 #define SPI_CFG_ID_0 (0x01U)
357 
359 #define SPI_CFG_ID_1 (0x02U)
360 
361 #define SPI_CFG_ID_2 (0x04U)
362 
363 #define SPI_CFG_ID_3 (0x08U)
364 
365 #define SPI_CFG_ID_4 (0x10U)
366 
367 #define SPI_CFG_ID_5 (0x20U)
368 
369 #define SPI_CFG_ID_6 (0x40U)
370 /* @} */
371 
372 /* ========================================================================== */
373 /* Structures and Enums */
374 /* ========================================================================== */
375 
384 /*
385  * Design: MCAL-6531,MCAL-6648,MCAL-6537,MCAL-6574
386  */
387 typedef enum
388 {
391  SPI_IDLE = 1U,
393  SPI_BUSY = 2U
396 
401 /*
402  * Design: MCAL-6703,MCAL-6425,MCAL-6430
403  */
404 typedef enum
405 {
417 
422 /*
423  * Design: MCAL-6512,MCAL-6607,MCAL-6686
424  */
425 typedef enum
426 {
437 
442 typedef enum
443 {
451 
456 /*
457  * Design: MCAL-6502,MCAL-6659,MCAL-6420,MCAL-6475,MCAL-6419,MCAL-6517,MCAL-6641
458  */
459 typedef enum
460 {
469 
473 typedef enum
474 {
475  SPI_MSB = 0U,
477  SPI_LSB = 1U
480 
484 typedef enum
485 {
486  SPI_LOW = STD_LOW,
490 } Spi_LevelType;
491 
495 typedef enum
496 {
497  SPI_CS0 = 0U,
505 } Spi_CsPinType;
506 
511 typedef enum
512 {
513  SPI_CLK_MODE_0 = 0x00U,
515  SPI_CLK_MODE_1 = 0x01U,
517  SPI_CLK_MODE_2 = 0x02U,
519  SPI_CLK_MODE_3 = 0x03U,
521 } Spi_ClkMode;
522 
535 typedef enum
536 {
541 } Spi_TxRxMode;
542 
546 /*
547  * Design: MCAL-6597
548  */
549 typedef enum
550 {
560 
564 typedef enum
565 {
571 
576 typedef enum
577 {
587 
591 typedef enum
592 {
598 
602 typedef enum
603 {
613 
617 typedef enum
618 {
626 
634 typedef void (*Spi_CacheWbInv)(uint8 *BufPtr,
635  uint16 LenByte);
636 
644 typedef void (*Spi_CacheWb)(uint8 *BufPtr,
645  uint16 LenByte);
646 
654 typedef void (*Spi_CacheInv)(uint8 *BufPtr,
655  uint16 LenByte);
656 
660 /*
661  * Design: MCAL-6529,MCAL-6519,MCAL-6649,MCAL-6716,MCAL-6619
662  */
663 typedef struct
664 {
667  uint8 dataWidth;
686 
690 typedef struct
691 {
692  uint16 csEnable;
707  uint32 clkDivider;
727 
731 typedef struct
732 {
737 
741 /*
742  * Design: MCAL-6692,MCAL-6437,MCAL-6684,MCAL-6522,MCAL-6572,MCAL-6406,MCAL-6632,MCAL-6476
743  */
744 typedef struct
745 {
750  Spi_JobEndNotifyType Spi_JobEndNotification;
758 
762 /*
763  * Design: MCAL-6496,MCAL-6536,MCAL-6742,MCAL-6413
764  */
765 typedef struct
766 {
769  Spi_SeqEndNotifyType Spi_SequenceEndNotification;
771  uint32 jobPerSeq;
777 
781 typedef struct
782 {
785  boolean enabledmaMode;
792 
796 /*
797  * Design: MCAL-6570,MCAL-6423,MCAL-6588,MCAL-6485,MCAL-6733
798  */
799 typedef struct Spi_ConfigType_s
800 {
801  uint8 maxChannels;
804  uint8 maxJobs;
807  uint8 maxSeq;
810  uint8 maxHwUnit;
816  uint32 udmaInstId;
839 
843 typedef struct Spi_ChannelConfigType_PC_s
844 {
848 
849 /*
850  * Design: MCAL-6717,MCAL-6650
851  */
855 typedef struct Spi_JobConfigType_PC_s
856 {
865 
869 typedef struct Spi_SeqConfigType_PC_s
870 {
874 
875 #if (STD_ON == SPI_REGISTER_READBACK_API)
876 
880 typedef struct
881 {
882  /*
883  * McSPI related registers
884  */
885  uint32 mcspiHlRev;
891  uint32 mcspiRev;
895  uint32 mcspiSyst;
909 #endif /* #if (STD_ON == SPI_REGISTER_READBACK_API) */
910 /* @} */
911 /* @} */
912 /* ========================================================================== */
913 /* Function Declarations */
914 /* ========================================================================== */
915 
933 FUNC(void, SPI_CODE) Spi_Init(
934  P2CONST(Spi_ConfigType, AUTOMATIC, SPI_CONFIG_DATA) CfgPtr);
935 
956 FUNC(Std_ReturnType, SPI_CODE) Spi_DeInit(void);
957 
975 FUNC(Spi_StatusType, SPI_CODE) Spi_GetStatus(void);
976 
996 FUNC(Spi_JobResultType, SPI_CODE) Spi_GetJobResult(Spi_JobType Job);
997 
1020  Spi_SequenceType Sequence);
1021 
1022 #if (STD_ON == SPI_VERSION_INFO_API)
1023 
1043 FUNC(void, SPI_CODE) Spi_GetVersionInfo(
1044  P2VAR(Std_VersionInfoType, AUTOMATIC, SPI_APPL_DATA) versioninfo);
1045 #endif /* #if (STD_ON == SPI_VERSION_INFO_API) */
1046 
1047 #if (STD_ON == SPI_HW_STATUS_API)
1048 
1069 FUNC(Spi_StatusType, SPI_CODE) Spi_GetHWUnitStatus(Spi_HWUnitType HWUnit);
1070 #endif /* #if (STD_ON == SPI_HW_STATUS_API) */
1071 
1072 #if ((SPI_CHANNELBUFFERS == SPI_IB) || (SPI_CHANNELBUFFERS == SPI_IB_EB))
1073 
1101 FUNC(Std_ReturnType, SPI_CODE) Spi_WriteIB(
1102  Spi_ChannelType Channel,
1103  P2CONST(Spi_DataBufferType, AUTOMATIC, SPI_APPL_DATA) DataBufferPtr);
1104 
1130 FUNC(Std_ReturnType, SPI_CODE) Spi_ReadIB(
1131  Spi_ChannelType Channel,
1132  P2VAR(Spi_DataBufferType, AUTOMATIC, SPI_APPL_DATA) DataBufferPointer);
1133 #endif /* #if SPI_IB || SPI_IB_EB */
1134 
1135 #if ((SPI_CHANNELBUFFERS == SPI_EB) || (SPI_CHANNELBUFFERS == SPI_IB_EB))
1136 
1168 FUNC(Std_ReturnType, SPI_CODE) Spi_SetupEB(
1169  Spi_ChannelType Channel,
1170  P2CONST(Spi_DataBufferType, AUTOMATIC, SPI_APPL_DATA) SrcDataBufferPtr,
1171  P2VAR(Spi_DataBufferType, AUTOMATIC, SPI_APPL_DATA) DesDataBufferPtr,
1172  Spi_NumberOfDataType Length);
1173 #endif /* #if ((SPI_CHANNELBUFFERS == SPI_EB) || (SPI_CHANNELBUFFERS ==
1174  *SPI_IB_EB)) */
1175 
1176 #if ((SPI_SCALEABILITY == SPI_LEVEL_1) || (SPI_SCALEABILITY == \
1177  SPI_LEVEL_2))
1178 
1198 FUNC(Std_ReturnType, SPI_CODE) Spi_AsyncTransmit(Spi_SequenceType Sequence);
1199 #endif /* #if ((SPI_SCALEABILITY == SPI_LEVEL_1) ||
1200  *(SPI_SCALEABILITY == SPI_LEVEL_2)) */
1201 
1202 #if (STD_ON == SPI_CANCEL_API)
1203 
1221 FUNC(void, SPI_CODE) Spi_Cancel(Spi_SequenceType Sequence);
1222 #endif /* #if (STD_ON == SPI_CANCEL_API) */
1223 
1224 #if ((SPI_SCALEABILITY == SPI_LEVEL_0) || (SPI_SCALEABILITY == \
1225  SPI_LEVEL_2))
1226 
1246 FUNC(Std_ReturnType, SPI_CODE) Spi_SyncTransmit(Spi_SequenceType Sequence);
1247 #endif /* #if ((SPI_SCALEABILITY == SPI_LEVEL_0) ||
1248  *(SPI_SCALEABILITY == SPI_LEVEL_2)) */
1249 
1250 #if (SPI_SCALEABILITY == SPI_LEVEL_2)
1251 
1273 FUNC(Std_ReturnType, SPI_CODE) Spi_SetAsyncMode(Spi_AsyncModeType Mode);
1274 #endif /* #if (SPI_SCALEABILITY == SPI_LEVEL_2) */
1275 
1298 FUNC(void, SPI_CODE) Spi_MainFunction_Handling(void);
1299 
1300 #if (STD_ON == SPI_REGISTER_READBACK_API)
1301 
1330 FUNC(Std_ReturnType, SPI_CODE) Spi_RegisterReadback(
1331  Spi_HWUnitType HWUnit,
1332  P2VAR(Spi_RegisterReadbackType, AUTOMATIC, SPI_APPL_DATA) RegRbPtr);
1333 #endif /* #if (STD_ON == SPI_REGISTER_READBACK_API) */
1334 
1335 #if (STD_ON == SPI_SAFETY_API)
1336 
1354 FUNC(Std_ReturnType, SPI_CODE) Spi_dataOverflowUnderflowIntrEnable(
1355  Spi_HWUnitType HWUnit, uint32 intFlags );
1356 
1376 FUNC(Std_ReturnType, SPI_CODE) Spi_dataOverflowUnderflowIntrDisable(
1377  Spi_HWUnitType HWUnit, uint32 intFlags);
1378 
1399  Spi_HWUnitType HWUnit, uint32 intFlags);
1400 
1420 FUNC(Std_ReturnType, SPI_CODE) Spi_dataOverflowUnderflowIntrStatusClear(
1421  Spi_HWUnitType HWUnit, uint32 intFlags);
1422 
1423 #endif /* #if (STD_ON == SPI_SAFETY_API) */
1424 
1425 #ifdef __cplusplus
1426 }
1427 #endif
1428 
1429 #endif /* #ifndef SPI_H_ */
1430 
1431 /* @} */
Definition: Spi.h:477
SPI Sequence configuration structure.
Definition: Spi.h:765
uint8 Spi_SequenceType
Specifies the identification (ID) for a sequence of jobs.
Definition: Spi.h:232
Definition: Spi.h:604
Definition: Spi.h:537
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:769
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:182
void(* Spi_CacheInv)(uint8 *BufPtr, uint16 LenByte)
Cache invalidate function.
Definition: Spi.h:654
Spi_JobPriorityType jobPriority
Definition: Spi.h:746
Definition: Spi.h:582
Spi_AsyncModeType
Specifies the asynchronous mechanism mode for SPI busses handled asynchronously in LEVEL 2.
Definition: Spi.h:459
Spi_DataLineTransmitType transmissionLineEnable
Definition: Spi.h:724
Definition: Spi.h:499
#define SPI_MAX_CHANNELS_PER_JOB
Maximum channels allowed per job.
Definition: Spi_Cfg.h:173
Definition: Spi.h:446
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:672
void(* Spi_CacheWb)(uint8 *BufPtr, uint16 LenByte)
Cache write-back function.
Definition: Spi.h:644
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:861
Spi_CacheWb cacheWb
Definition: Spi.h:824
Definition: Spi.h:608
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:404
Spi_CsPinType
SPI Chip Select Pin.
Definition: Spi.h:495
Spi_TxRxMode
SPI TX/RX Mode.
Definition: Spi.h:535
uint8 Spi_HWUnitType
Specifies the identification (ID) for a SPI Hardware micro controller peripheral (unit)
Definition: Spi.h:240
#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:191
Mcspi_IrqStatusType
Irq status and std return type.
Definition: Spi.h:617
boolean enabledmaMode
Definition: Spi.h:785
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:576
Definition: Spi.h:610
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:783
Definition: Spi.h:429
uint16 Spi_NumberOfDataType
Type for defining the number of data elements of the type Spi_DataBufferType to send and / or receive...
Definition: Spi.h:217
Definition: Spi.h:517
Definition: Spi.h:623
Definition: Spi.h:488
Definition: Spi.h:551
uint8 Spi_DataBufferType
Type of application data buffer elements.
Definition: Spi.h:209
SPI channel config structure parameters Pre-Compile only.
Definition: Spi.h:843
uint32 clkDivider
Definition: Spi.h:707
uint32 defaultTxData
Definition: Spi.h:670
#define SPI_MAX_JOBS_PER_SEQ
Maximum jobs allowed per sequence.
Definition: Spi_Cfg.h:176
uint32 udmaInstId
Definition: Spi.h:816
Definition: Spi.h:519
Definition: Spi.h:593
Definition: Spi.h:501
uint32 mcspiCh3config
Definition: Spi.h:904
Spi_CsModeType
SPI Chip Select Mode.
Definition: Spi.h:564
Definition: Spi.h:621
uint16 Spi_JobType
Specifies the identification (ID) for a Job.
Definition: Spi.h:227
Spi_SeqResultType
This type defines a range of specific Sequences status for SPI Handler/Driver.
Definition: Spi.h:425
Spi_HwUnitResultType
This type defines a range of specific HW unit status for SPI Handler/Driver.
Definition: Spi.h:442
#define SPI_MAX_CHANNELS
Maximum channels across all jobs/sequence/hwunit.
Definition: Spi_Cfg.h:179
SPI job config structure parameters Pre-Compile only.
Definition: Spi.h:855
SPI sequence config structure parameters Pre-Compile only.
Definition: Spi.h:869
Definition: Spi.h:606
Spi_TransferType transferType
Definition: Spi.h:682
uint32 mcspiRev
Definition: Spi.h:891
Definition: Spi.h:486
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:717
uint32 mcspiHlSysConfig
Definition: Spi.h:889
SPI Hardware unit configuration structure.
Definition: Spi.h:781
Definition: Spi.h:389
Spi_CacheWbInv cacheWbInv
Definition: Spi.h:822
Definition: Spi.h:408
uint8 dataWidth
Definition: Spi.h:667
Definition: Spi.h:497
Spi_ChannelType channelId
Definition: Spi.h:845
Definition: Spi.h:393
Spi_StatusType Spi_GetStatus(void)
Service returns the SPI Handler/Driver software module status.
Spi_CsModeType csMode
Definition: Spi.h:694
Definition: Spi.h:584
Definition: Spi.h:578
uint32 dmaTxChIntrNum
Definition: Spi.h:787
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:713
void(* Spi_CacheWbInv)(uint8 *BufPtr, uint16 LenByte)
Cache write-back invalidate function.
Definition: Spi.h:634
uint8 maxExtDevCfg
Definition: Spi.h:813
Spi_LevelType csPolarity
Definition: Spi.h:697
Definition: Spi.h:513
Spi_DataLineReceiveType receptionLineEnable
Definition: Spi.h:722
This file contains generated pre compile configuration file for SPI MCAL driver.
uint32 mcspiIrqenable
Definition: Spi.h:906
#define SPI_MAX_EXT_DEV
Maximum external device cfg.
Definition: Spi_Cfg.h:196
Definition: Spi.h:557
Spi_DataDelayType csIdleTime
Definition: Spi.h:699
Spi_McspiExternalDeviceConfigType mcspi
Definition: Spi.h:733
Definition: Spi.h:413
Definition: Spi.h:568
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:807
Definition: Spi.h:444
Spi_LevelType startBitLevel
Definition: Spi.h:720
void Spi_Cancel(Spi_SequenceType Sequence)
Service cancels the specified on-going sequence transmission.
uint32 mcspiModulctrl
Definition: Spi.h:897
Definition: Spi.h:475
uint8 maxHwUnit
Definition: Spi.h:810
#define SPI_MAX_SEQ
Maximum sequence across all hwunit.
Definition: Spi_Cfg.h:185
Spi_CacheInv cacheInv
Definition: Spi.h:826
Spi_StatusType
This type defines a range of specific status for SPI Handler/Driver.
Definition: Spi.h:387
Std_ReturnType Spi_dataOverflowUnderflowIntrEnable(Spi_HWUnitType HWUnit, uint32 intFlags)
This function Enable Under/Overflow Interupts of the hardware unit and returns the status.
Definition: Spi.h:619
uint32 channelPerJob
Definition: Spi.h:752
Definition: Spi.h:539
Definition: Spi.h:434
uint32 mcspiCh0config
Definition: Spi.h:901
Definition: Spi.h:566
uint32 mcspiSysConfig
Definition: Spi.h:899
uint8 seqInterruptible
Definition: Spi.h:767
SPI register readback structure.
Definition: Spi.h:880
uint32 jobPerSeq
Definition: Spi.h:771
Definition: Spi.h:391
Spi_ClkMode
SPI Clock Mode - sets the clock polarity and phase. Note: These values are a direct register mapping....
Definition: Spi.h:511
Definition: Spi.h:427
Definition: Spi.h:580
Definition: Spi.h:515
uint32 mcspiHlRev
Definition: Spi.h:885
Spi_HWUnitType hwUnitId
Definition: Spi.h:748
uint32 mcspiSyst
Definition: Spi.h:895
Spi_TxRxMode txRxMode
Definition: Spi.h:715
SPI external device specific configuration structure .
Definition: Spi.h:731
Definition: Spi.h:448
uint32 dmaRxChIntrNum
Definition: Spi.h:789
uint8 maxChannels
Definition: Spi.h:801
Definition: Spi.h:432
SPI Job configuration structure specific to McSPI peripheral.
Definition: Spi.h:690
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...
Definition: Spi.h:406
Definition: Spi.h:555
Spi_JobType jobId
Definition: Spi.h:857
Definition: Spi.h:503
SPI Job configuration structure.
Definition: Spi.h:744
Definition: Spi.h:595
Definition: Spi.h:464
Spi_LevelType
Type for SPI Chip Select Polarity and Clock Idle Level.
Definition: Spi.h:484
Spi_JobEndNotifyType Spi_JobEndNotification
Definition: Spi.h:750
Spi_DataLineTransmitType
Spi_DataLineTransmitType defines the lines selected for transmission.
Definition: Spi.h:602
Definition: Spi.h:411
uint32 mcspiSysStatus
Definition: Spi.h:893
Spi_CsPinType csPin
Definition: Spi.h:859
uint32 mcspiHlHwInfo
Definition: Spi.h:887
Spi_JobPriorityType
SPI Job Priority.
Definition: Spi.h:549
Spi_DataLineReceiveType
Spi_DataLineReceiveType defines the lines selected for reception.
Definition: Spi.h:591
uint8 Spi_ChannelType
Specifies the identification (ID) for a Channel.
Definition: Spi.h:222
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:663
Spi_SequenceType seqId
Definition: Spi.h:871
Std_ReturnType Spi_AsyncTransmit(Spi_SequenceType Sequence)
Service to transmit data on the SPI bus.
uint8 channelBufType
Definition: Spi.h:665
Definition: Spi.h:461
Definition: Spi.h:553
uint32 mcspiCh2config
Definition: Spi.h:903
uint16 csEnable
Definition: Spi.h:692
Spi_TransferType
Word transfer order - MSB first or LSB first.
Definition: Spi.h:473
Spi_JobResultType Spi_GetJobResult(Spi_JobType Job)
This service returns the last transmission result of the specified Job.
SPI config structure.
Definition: Spi.h:799
uint8 maxJobs
Definition: Spi.h:804
uint32 mcspiCh1config
Definition: Spi.h:902