EE445M RTOS
Taken at the University of Texas Spring 2015
ssi.c
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // ssi.c - Driver for Synchronous Serial Interface.
4 //
5 // Copyright (c) 2005-2014 Texas Instruments Incorporated. All rights reserved.
6 // Software License Agreement
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions
10 // are met:
11 //
12 // Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the
18 // distribution.
19 //
20 // Neither the name of Texas Instruments Incorporated nor the names of
21 // its contributors may be used to endorse or promote products derived
22 // from this software without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 //
36 // This is part of revision 2.1.0.12573 of the Tiva Peripheral Driver Library.
37 //
38 //*****************************************************************************
39 
40 //*****************************************************************************
41 //
44 //
45 //*****************************************************************************
46 
47 #include <stdbool.h>
48 #include <stdint.h>
49 #include "inc/hw_ints.h"
50 #include "inc/hw_memmap.h"
51 #include "inc/hw_ssi.h"
52 #include "inc/hw_sysctl.h"
53 #include "inc/hw_types.h"
54 #include "driverlib/debug.h"
55 #include "driverlib/interrupt.h"
56 #include "driverlib/ssi.h"
57 
58 //*****************************************************************************
59 //
60 // A mapping of timer base address to interrupt number.
61 //
62 //*****************************************************************************
63 static const uint32_t g_ppui32SSIIntMap[][2] =
64 {
69 };
70 static const uint_fast8_t g_ui8SSIIntMapRows =
71  sizeof(g_ppui32SSIIntMap) / sizeof(g_ppui32SSIIntMap[0]);
72 
73 static const uint32_t g_ppui32SSIIntMapSnowflake[][2] =
74 {
79 };
80 static const uint_fast8_t g_ui8SSIIntMapSnowflakeRows =
81  sizeof(g_ppui32SSIIntMapSnowflake) / sizeof(g_ppui32SSIIntMapSnowflake[0]);
82 
83 //*****************************************************************************
84 //
94 //
95 //*****************************************************************************
96 #ifdef DEBUG
97 static bool
98 _SSIBaseValid(uint32_t ui32Base)
99 {
100  return((ui32Base == SSI0_BASE) || (ui32Base == SSI1_BASE) ||
101  (ui32Base == SSI2_BASE) || (ui32Base == SSI3_BASE));
102 }
103 #endif
104 
105 //*****************************************************************************
106 //
116 //
117 //*****************************************************************************
118 static uint32_t
119 _SSIIntNumberGet(uint32_t ui32Base)
120 {
121  uint_fast8_t ui8Idx, ui8Rows;
122  const uint32_t (*ppui32SSIIntMap)[2];
123 
124  //
125  // Check the arguments.
126  //
127  ASSERT(_SSIBaseValid(ui32Base));
128 
129  ppui32SSIIntMap = g_ppui32SSIIntMap;
130  ui8Rows = g_ui8SSIIntMapRows;
131 
132  if(CLASS_IS_TM4C129)
133  {
134  ppui32SSIIntMap = g_ppui32SSIIntMapSnowflake;
135  ui8Rows = g_ui8SSIIntMapSnowflakeRows;
136  }
137 
138  //
139  // Loop through the table that maps SSI base addresses to interrupt
140  // numbers.
141  //
142  for(ui8Idx = 0; ui8Idx < ui8Rows; ui8Idx++)
143  {
144  //
145  // See if this base address matches.
146  //
147  if(ppui32SSIIntMap[ui8Idx][0] == ui32Base)
148  {
149  //
150  // Return the corresponding interrupt number.
151  //
152  return(ppui32SSIIntMap[ui8Idx][1]);
153  }
154  }
155 
156  //
157  // The base address could not be found, so return an error.
158  //
159  return(0);
160 }
161 
162 //*****************************************************************************
163 //
218 //
219 //*****************************************************************************
220 void
221 SSIConfigSetExpClk(uint32_t ui32Base, uint32_t ui32SSIClk,
222  uint32_t ui32Protocol, uint32_t ui32Mode,
223  uint32_t ui32BitRate, uint32_t ui32DataWidth)
224 {
225  uint32_t ui32MaxBitRate;
226  uint32_t ui32RegVal;
227  uint32_t ui32PreDiv;
228  uint32_t ui32SCR;
229  uint32_t ui32SPH_SPO;
230 
231  //
232  // Check the arguments.
233  //
234  ASSERT(_SSIBaseValid(ui32Base));
235  ASSERT((ui32Protocol == SSI_FRF_MOTO_MODE_0) ||
236  (ui32Protocol == SSI_FRF_MOTO_MODE_1) ||
237  (ui32Protocol == SSI_FRF_MOTO_MODE_2) ||
238  (ui32Protocol == SSI_FRF_MOTO_MODE_3) ||
239  (ui32Protocol == SSI_FRF_TI) ||
240  (ui32Protocol == SSI_FRF_NMW));
241  ASSERT((ui32Mode == SSI_MODE_MASTER) ||
242  (ui32Mode == SSI_MODE_SLAVE) ||
243  (ui32Mode == SSI_MODE_SLAVE_OD));
244  ASSERT(((ui32Mode == SSI_MODE_MASTER) &&
245  (ui32BitRate <= (ui32SSIClk / 2))) ||
246  ((ui32Mode != SSI_MODE_MASTER) &&
247  (ui32BitRate <= (ui32SSIClk / 12))));
248  ASSERT((ui32SSIClk / ui32BitRate) <= (254 * 256));
249  ASSERT((ui32DataWidth >= 4) && (ui32DataWidth <= 16));
250 
251  //
252  // Set the mode.
253  //
254  ui32RegVal = (ui32Mode == SSI_MODE_SLAVE_OD) ? SSI_CR1_SOD : 0;
255  ui32RegVal |= (ui32Mode == SSI_MODE_MASTER) ? 0 : SSI_CR1_MS;
256  HWREG(ui32Base + SSI_O_CR1) = ui32RegVal;
257 
258  //
259  // Set the clock predivider.
260  //
261  ui32MaxBitRate = ui32SSIClk / ui32BitRate;
262  ui32PreDiv = 0;
263  do
264  {
265  ui32PreDiv += 2;
266  ui32SCR = (ui32MaxBitRate / ui32PreDiv) - 1;
267  }
268  while(ui32SCR > 255);
269  HWREG(ui32Base + SSI_O_CPSR) = ui32PreDiv;
270 
271  //
272  // Set protocol and clock rate.
273  //
274  ui32SPH_SPO = (ui32Protocol & 3) << 6;
275  ui32Protocol &= SSI_CR0_FRF_M;
276  ui32RegVal = (ui32SCR << 8) | ui32SPH_SPO | ui32Protocol |
277  (ui32DataWidth - 1);
278  HWREG(ui32Base + SSI_O_CR0) = ui32RegVal;
279 }
280 
281 //*****************************************************************************
282 //
291 //
292 //*****************************************************************************
293 void
294 SSIEnable(uint32_t ui32Base)
295 {
296  //
297  // Check the arguments.
298  //
299  ASSERT(_SSIBaseValid(ui32Base));
300 
301  //
302  // Read-modify-write the enable bit.
303  //
304  HWREG(ui32Base + SSI_O_CR1) |= SSI_CR1_SSE;
305 }
306 
307 //*****************************************************************************
308 //
316 //
317 //*****************************************************************************
318 void
319 SSIDisable(uint32_t ui32Base)
320 {
321  //
322  // Check the arguments.
323  //
324  ASSERT(_SSIBaseValid(ui32Base));
325 
326  //
327  // Read-modify-write the enable bit.
328  //
329  HWREG(ui32Base + SSI_O_CR1) &= ~(SSI_CR1_SSE);
330 }
331 
332 //*****************************************************************************
333 //
350 //
351 //*****************************************************************************
352 void
353 SSIIntRegister(uint32_t ui32Base, void (*pfnHandler)(void))
354 {
355  uint32_t ui32Int;
356 
357  //
358  // Check the arguments.
359  //
360  ASSERT(_SSIBaseValid(ui32Base));
361 
362  //
363  // Determine the interrupt number based on the SSI module.
364  //
365  ui32Int = _SSIIntNumberGet(ui32Base);
366 
367  ASSERT(ui32Int != 0);
368 
369  //
370  // Register the interrupt handler, returning an error if an error occurs.
371  //
372  IntRegister(ui32Int, pfnHandler);
373 
374  //
375  // Enable the synchronous serial interface interrupt.
376  //
377  IntEnable(ui32Int);
378 }
379 
380 //*****************************************************************************
381 //
394 //
395 //*****************************************************************************
396 void
397 SSIIntUnregister(uint32_t ui32Base)
398 {
399  uint32_t ui32Int;
400 
401  //
402  // Check the arguments.
403  //
404  ASSERT(_SSIBaseValid(ui32Base));
405 
406  //
407  // Determine the interrupt number based on the SSI module.
408  //
409  ui32Int = _SSIIntNumberGet(ui32Base);
410 
411  ASSERT(ui32Int != 0);
412 
413  //
414  // Disable the interrupt.
415  //
416  IntDisable(ui32Int);
417 
418  //
419  // Unregister the interrupt handler.
420  //
421  IntUnregister(ui32Int);
422 }
423 
424 //*****************************************************************************
425 //
438 //
439 //*****************************************************************************
440 void
441 SSIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
442 {
443  //
444  // Check the arguments.
445  //
446  ASSERT(_SSIBaseValid(ui32Base));
447 
448  //
449  // Enable the specified interrupts.
450  //
451  HWREG(ui32Base + SSI_O_IM) |= ui32IntFlags;
452 }
453 
454 //*****************************************************************************
455 //
466 //
467 //*****************************************************************************
468 void
469 SSIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
470 {
471  //
472  // Check the arguments.
473  //
474  ASSERT(_SSIBaseValid(ui32Base));
475 
476  //
477  // Disable the specified interrupts.
478  //
479  HWREG(ui32Base + SSI_O_IM) &= ~(ui32IntFlags);
480 }
481 
482 //*****************************************************************************
483 //
496 //
497 //*****************************************************************************
498 uint32_t
499 SSIIntStatus(uint32_t ui32Base, bool bMasked)
500 {
501  //
502  // Check the arguments.
503  //
504  ASSERT(_SSIBaseValid(ui32Base));
505 
506  //
507  // Return either the interrupt status or the raw interrupt status as
508  // requested.
509  //
510  if(bMasked)
511  {
512  return(HWREG(ui32Base + SSI_O_MIS));
513  }
514  else
515  {
516  return(HWREG(ui32Base + SSI_O_RIS));
517  }
518 }
519 
520 //*****************************************************************************
521 //
543 //
544 //*****************************************************************************
545 void
546 SSIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
547 {
548  //
549  // Check the arguments.
550  //
551  ASSERT(_SSIBaseValid(ui32Base));
552 
553  //
554  // Clear the requested interrupt sources.
555  //
556  HWREG(ui32Base + SSI_O_ICR) = ui32IntFlags;
557 }
558 
559 //*****************************************************************************
560 //
576 //
577 //*****************************************************************************
578 void
579 SSIDataPut(uint32_t ui32Base, uint32_t ui32Data)
580 {
581  //
582  // Check the arguments.
583  //
584  ASSERT(_SSIBaseValid(ui32Base));
585  ASSERT((ui32Data & (0xfffffffe << (HWREG(ui32Base + SSI_O_CR0) &
586  SSI_CR0_DSS_M))) == 0);
587 
588  //
589  // Wait until there is space.
590  //
591  while(!(HWREG(ui32Base + SSI_O_SR) & SSI_SR_TNF))
592  {
593  }
594 
595  //
596  // Write the data to the SSI.
597  //
598  HWREG(ui32Base + SSI_O_DR) = ui32Data;
599 }
600 
601 //*****************************************************************************
602 //
618 //
619 //*****************************************************************************
620 int32_t
621 SSIDataPutNonBlocking(uint32_t ui32Base, uint32_t ui32Data)
622 {
623  //
624  // Check the arguments.
625  //
626  ASSERT(_SSIBaseValid(ui32Base));
627  ASSERT((ui32Data & (0xfffffffe << (HWREG(ui32Base + SSI_O_CR0) &
628  SSI_CR0_DSS_M))) == 0);
629 
630  //
631  // Check for space to write.
632  //
633  if(HWREG(ui32Base + SSI_O_SR) & SSI_SR_TNF)
634  {
635  HWREG(ui32Base + SSI_O_DR) = ui32Data;
636  return(1);
637  }
638  else
639  {
640  return(0);
641  }
642 }
643 
644 //*****************************************************************************
645 //
664 //
665 //*****************************************************************************
666 void
667 SSIDataGet(uint32_t ui32Base, uint32_t *pui32Data)
668 {
669  //
670  // Check the arguments.
671  //
672  ASSERT(_SSIBaseValid(ui32Base));
673 
674  //
675  // Wait until there is data to be read.
676  //
677  while(!(HWREG(ui32Base + SSI_O_SR) & SSI_SR_RNE))
678  {
679  }
680 
681  //
682  // Read data from SSI.
683  //
684  *pui32Data = HWREG(ui32Base + SSI_O_DR);
685 }
686 
687 //*****************************************************************************
688 //
707 //
708 //*****************************************************************************
709 int32_t
710 SSIDataGetNonBlocking(uint32_t ui32Base, uint32_t *pui32Data)
711 {
712  //
713  // Check the arguments.
714  //
715  ASSERT(_SSIBaseValid(ui32Base));
716 
717  //
718  // Check for data to read.
719  //
720  if(HWREG(ui32Base + SSI_O_SR) & SSI_SR_RNE)
721  {
722  *pui32Data = HWREG(ui32Base + SSI_O_DR);
723  return(1);
724  }
725  else
726  {
727  return(0);
728  }
729 }
730 
731 //*****************************************************************************
732 //
750 //
751 //*****************************************************************************
752 void
753 SSIDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags)
754 {
755  //
756  // Check the arguments.
757  //
758  ASSERT(_SSIBaseValid(ui32Base));
759 
760  //
761  // Set the requested bits in the SSI DMA control register.
762  //
763  HWREG(ui32Base + SSI_O_DMACTL) |= ui32DMAFlags;
764 }
765 
766 //*****************************************************************************
767 //
781 //
782 //*****************************************************************************
783 void
784 SSIDMADisable(uint32_t ui32Base, uint32_t ui32DMAFlags)
785 {
786  //
787  // Check the arguments.
788  //
789  ASSERT(_SSIBaseValid(ui32Base));
790 
791  //
792  // Clear the requested bits in the SSI DMA control register.
793  //
794  HWREG(ui32Base + SSI_O_DMACTL) &= ~ui32DMAFlags;
795 }
796 
797 //*****************************************************************************
798 //
810 //
811 //*****************************************************************************
812 bool
813 SSIBusy(uint32_t ui32Base)
814 {
815  //
816  // Check the arguments.
817  //
818  ASSERT(_SSIBaseValid(ui32Base));
819 
820  //
821  // Determine if the SSI is busy.
822  //
823  return((HWREG(ui32Base + SSI_O_SR) & SSI_SR_BSY) ? true : false);
824 }
825 
826 //*****************************************************************************
827 //
846 //
847 //*****************************************************************************
848 void
849 SSIClockSourceSet(uint32_t ui32Base, uint32_t ui32Source)
850 {
851  //
852  // Check the arguments.
853  //
854  ASSERT(_SSIBaseValid(ui32Base));
855  ASSERT((ui32Source == SSI_CLOCK_SYSTEM) ||
856  (ui32Source == SSI_CLOCK_PIOSC));
857 
858  //
859  // Set the SSI clock source.
860  //
861  HWREG(ui32Base + SSI_O_CC) = ui32Source;
862 }
863 
864 //*****************************************************************************
865 //
878 //
879 //*****************************************************************************
880 uint32_t
881 SSIClockSourceGet(uint32_t ui32Base)
882 {
883  //
884  // Check the arguments.
885  //
886  ASSERT(_SSIBaseValid(ui32Base));
887 
888  //
889  // Return the SSI clock source.
890  //
891  return(HWREG(ui32Base + SSI_O_CC));
892 }
893 
894 //*****************************************************************************
895 //
962 //
963 //*****************************************************************************
964 void
965 SSIAdvModeSet(uint32_t ui32Base, uint32_t ui32Mode)
966 {
967  //
968  // Check the arguments.
969  //
970  ASSERT(_SSIBaseValid(ui32Base));
971  ASSERT((ui32Mode == SSI_ADV_MODE_LEGACY) ||
972  (ui32Mode == SSI_ADV_MODE_WRITE) ||
973  (ui32Mode == SSI_ADV_MODE_READ_WRITE) ||
974  (ui32Mode == SSI_ADV_MODE_BI_READ) ||
975  (ui32Mode == SSI_ADV_MODE_BI_WRITE) ||
976  (ui32Mode == SSI_ADV_MODE_QUAD_READ) ||
977  (ui32Mode == SSI_ADV_MODE_QUAD_WRITE));
978 
979  //
980  // Set the SSI mode of operation.
981  //
982  HWREG(ui32Base + SSI_O_CR1) =
983  ((HWREG(ui32Base + SSI_O_CR1) & ~(SSI_CR1_DIR | SSI_CR1_MODE_M)) |
984  ui32Mode);
985 }
986 
987 //*****************************************************************************
988 //
1007 //
1008 //*****************************************************************************
1009 void
1010 SSIAdvDataPutFrameEnd(uint32_t ui32Base, uint32_t ui32Data)
1011 {
1012  //
1013  // Check the arguments.
1014  //
1015  ASSERT(_SSIBaseValid(ui32Base));
1016  ASSERT((ui32Data & 0xff) == 0);
1017 
1018  //
1019  // Wait until there is space.
1020  //
1021  while(!(HWREG(ui32Base + SSI_O_SR) & SSI_SR_TNF))
1022  {
1023  }
1024 
1025  //
1026  // Write the data to the SSI.
1027  //
1028  HWREG(ui32Base + SSI_O_CR1) |= SSI_CR1_EOM;
1029  HWREG(ui32Base + SSI_O_DR) = ui32Data;
1030 }
1031 
1032 //*****************************************************************************
1033 //
1052 //
1053 //*****************************************************************************
1054 int32_t
1055 SSIAdvDataPutFrameEndNonBlocking(uint32_t ui32Base, uint32_t ui32Data)
1056 {
1057  //
1058  // Check the arguments.
1059  //
1060  ASSERT(_SSIBaseValid(ui32Base));
1061  ASSERT((ui32Data & 0xff) == 0);
1062 
1063  //
1064  // Check for space to write.
1065  //
1066  if(HWREG(ui32Base + SSI_O_SR) & SSI_SR_TNF)
1067  {
1068  HWREG(ui32Base + SSI_O_CR1) |= SSI_CR1_EOM;
1069  HWREG(ui32Base + SSI_O_DR) = ui32Data;
1070  return(1);
1071  }
1072  else
1073  {
1074  return(0);
1075  }
1076 }
1077 
1078 //*****************************************************************************
1079 //
1096 //
1097 //*****************************************************************************
1098 void
1099 SSIAdvFrameHoldEnable(uint32_t ui32Base)
1100 {
1101  //
1102  // Check the arguments.
1103  //
1104  ASSERT(_SSIBaseValid(ui32Base));
1105 
1106  //
1107  // Set the hold frame bit.
1108  //
1109  HWREG(ui32Base + SSI_O_CR1) |= SSI_CR1_FSSHLDFRM;
1110 }
1111 
1112 //*****************************************************************************
1113 //
1129 //
1130 //*****************************************************************************
1131 void
1132 SSIAdvFrameHoldDisable(uint32_t ui32Base)
1133 {
1134  //
1135  // Check the arguments.
1136  //
1137  ASSERT(_SSIBaseValid(ui32Base));
1138 
1139  //
1140  // Clear the hold frame bit.
1141  //
1142  HWREG(ui32Base + SSI_O_CR1) &= ~(SSI_CR1_FSSHLDFRM);
1143 }
1144 
1145 //*****************************************************************************
1146 //
1147 // Close the Doxygen group.
1149 //
1150 //*****************************************************************************
uint32_t SSIIntStatus(uint32_t ui32Base, bool bMasked)
Definition: ssi.c:499
#define SSI1_BASE
Definition: hw_memmap.h:58
static const uint_fast8_t g_ui8SSIIntMapSnowflakeRows
Definition: ssi.c:80
#define SSI_O_CR0
Definition: hw_ssi.h:48
#define SSI_ADV_MODE_WRITE
Definition: ssi.h:108
static const uint32_t g_ppui32SSIIntMap[][2]
Definition: ssi.c:63
#define SSI_CR0_FRF_M
Definition: hw_ssi.h:69
#define SSI_SR_TNF
Definition: hw_ssi.h:127
void SSIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: ssi.c:469
#define HWREG(x)
Definition: hw_types.h:48
#define SSI_O_IM
Definition: hw_ssi.h:53
#define INT_SSI0_TM4C129
Definition: hw_ints.h:183
void SSIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: ssi.c:441
#define INT_SSI1_TM4C123
Definition: hw_ints.h:99
#define SSI_MODE_SLAVE
Definition: ssi.h:81
#define SSI_O_ICR
Definition: hw_ssi.h:56
#define SSI_CLOCK_SYSTEM
Definition: ssi.h:98
void SSIDataGet(uint32_t ui32Base, uint32_t *pui32Data)
Definition: ssi.c:667
#define SSI_O_RIS
Definition: hw_ssi.h:54
#define SSI_ADV_MODE_QUAD_READ
Definition: ssi.h:111
#define SSI_SR_BSY
Definition: hw_ssi.h:124
#define SSI_CR1_MODE_M
Definition: hw_ssi.h:98
#define ASSERT(expr)
Definition: debug.h:67
#define SSI_FRF_TI
Definition: ssi.h:77
#define SSI_CR1_EOM
Definition: hw_ssi.h:94
#define SSI_O_CR1
Definition: hw_ssi.h:49
#define SSI_FRF_NMW
Definition: ssi.h:78
#define SSI_O_DR
Definition: hw_ssi.h:50
static const uint_fast8_t g_ui8SSIIntMapRows
Definition: ssi.c:70
#define SSI_ADV_MODE_QUAD_WRITE
Definition: ssi.h:112
#define INT_SSI3_TM4C129
Definition: hw_ints.h:231
#define SSI_O_CC
Definition: hw_ssi.h:59
#define SSI_FRF_MOTO_MODE_0
Definition: ssi.h:73
void SSIClockSourceSet(uint32_t ui32Base, uint32_t ui32Source)
Definition: ssi.c:849
int32_t SSIDataPutNonBlocking(uint32_t ui32Base, uint32_t ui32Data)
Definition: ssi.c:621
#define SSI_FRF_MOTO_MODE_2
Definition: ssi.h:75
void SSIDisable(uint32_t ui32Base)
Definition: ssi.c:319
uint32_t SSIClockSourceGet(uint32_t ui32Base)
Definition: ssi.c:881
#define SSI_O_CPSR
Definition: hw_ssi.h:52
void SSIAdvFrameHoldEnable(uint32_t ui32Base)
Definition: ssi.c:1099
#define SSI_SR_RNE
Definition: hw_ssi.h:126
void SSIEnable(uint32_t ui32Base)
Definition: ssi.c:294
#define SSI_ADV_MODE_BI_READ
Definition: ssi.h:109
#define SSI_CR1_SOD
Definition: hw_ssi.h:105
#define INT_SSI0_TM4C123
Definition: hw_ints.h:71
#define INT_SSI2_TM4C123
Definition: hw_ints.h:118
int32_t SSIDataGetNonBlocking(uint32_t ui32Base, uint32_t *pui32Data)
Definition: ssi.c:710
void SSIDataPut(uint32_t ui32Base, uint32_t ui32Data)
Definition: ssi.c:579
#define SSI_O_DMACTL
Definition: hw_ssi.h:57
void SSIAdvFrameHoldDisable(uint32_t ui32Base)
Definition: ssi.c:1132
#define SSI_CR1_MS
Definition: hw_ssi.h:106
#define SSI_CR1_DIR
Definition: hw_ssi.h:97
#define SSI3_BASE
Definition: hw_memmap.h:60
#define SSI_CLOCK_PIOSC
Definition: ssi.h:99
void SSIIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: ssi.c:353
void IntUnregister(uint32_t ui32Interrupt)
Definition: interrupt.c:381
static const uint32_t g_ppui32SSIIntMapSnowflake[][2]
Definition: ssi.c:73
void SSIAdvDataPutFrameEnd(uint32_t ui32Base, uint32_t ui32Data)
Definition: ssi.c:1010
bool SSIBusy(uint32_t ui32Base)
Definition: ssi.c:813
#define INT_SSI3_TM4C123
Definition: hw_ints.h:119
void SSIIntUnregister(uint32_t ui32Base)
Definition: ssi.c:397
#define SSI_ADV_MODE_READ_WRITE
Definition: ssi.h:107
void SSIDMADisable(uint32_t ui32Base, uint32_t ui32DMAFlags)
Definition: ssi.c:784
static uint32_t _SSIIntNumberGet(uint32_t ui32Base)
Definition: ssi.c:119
#define INT_SSI1_TM4C129
Definition: hw_ints.h:210
#define CLASS_IS_TM4C129
Definition: hw_types.h:99
#define SSI_MODE_MASTER
Definition: ssi.h:80
#define SSI_MODE_SLAVE_OD
Definition: ssi.h:82
#define SSI_CR1_SSE
Definition: hw_ssi.h:107
#define SSI_FRF_MOTO_MODE_1
Definition: ssi.h:74
#define SSI_CR1_FSSHLDFRM
Definition: hw_ssi.h:95
#define SSI_FRF_MOTO_MODE_3
Definition: ssi.h:76
void SSIConfigSetExpClk(uint32_t ui32Base, uint32_t ui32SSIClk, uint32_t ui32Protocol, uint32_t ui32Mode, uint32_t ui32BitRate, uint32_t ui32DataWidth)
Definition: ssi.c:221
#define SSI2_BASE
Definition: hw_memmap.h:59
int32_t SSIAdvDataPutFrameEndNonBlocking(uint32_t ui32Base, uint32_t ui32Data)
Definition: ssi.c:1055
#define SSI_CR0_DSS_M
Definition: hw_ssi.h:73
#define SSI0_BASE
Definition: hw_memmap.h:57
void IntDisable(uint32_t ui32Interrupt)
Definition: interrupt.c:684
void IntRegister(uint32_t ui32Interrupt, void(*pfnHandler)(void))
Definition: interrupt.c:309
void SSIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: ssi.c:546
void SSIAdvModeSet(uint32_t ui32Base, uint32_t ui32Mode)
Definition: ssi.c:965
void IntEnable(uint32_t ui32Interrupt)
Definition: interrupt.c:610
#define SSI_ADV_MODE_BI_WRITE
Definition: ssi.h:110
#define SSI_O_SR
Definition: hw_ssi.h:51
#define SSI_ADV_MODE_LEGACY
Definition: ssi.h:106
#define SSI_O_MIS
Definition: hw_ssi.h:55
void SSIDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags)
Definition: ssi.c:753
#define INT_SSI2_TM4C129
Definition: hw_ints.h:230