Tiva Driver Lib
ssi.h
1 //*****************************************************************************
2 //
3 // ssi.h - Prototypes for the Synchronous Serial Interface Driver.
4 //
5 // Copyright (c) 2005-2013 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 1.1 of the Tiva Peripheral Driver Library.
37 //
38 //*****************************************************************************
39 
40 #ifndef __DRIVERLIB_SSI_H__
41 #define __DRIVERLIB_SSI_H__
42 
43 //*****************************************************************************
44 //
45 // If building with a C++ compiler, make all of the definitions in this header
46 // have a C binding.
47 //
48 //*****************************************************************************
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 //*****************************************************************************
55 //
56 // Values that can be passed to SSIIntEnable, SSIIntDisable, and SSIIntClear
57 // as the ui32IntFlags parameter, and returned by SSIIntStatus.
58 //
59 //*****************************************************************************
60 #define SSI_TXFF 0x00000008 // TX FIFO half full or less
61 #define SSI_RXFF 0x00000004 // RX FIFO half full or more
62 #define SSI_RXTO 0x00000002 // RX timeout
63 #define SSI_RXOR 0x00000001 // RX overrun
64 
65 //*****************************************************************************
66 //
67 // Values that can be passed to SSIConfigSetExpClk.
68 //
69 //*****************************************************************************
70 #define SSI_FRF_MOTO_MODE_0 0x00000000 // Moto fmt, polarity 0, phase 0
71 #define SSI_FRF_MOTO_MODE_1 0x00000002 // Moto fmt, polarity 0, phase 1
72 #define SSI_FRF_MOTO_MODE_2 0x00000001 // Moto fmt, polarity 1, phase 0
73 #define SSI_FRF_MOTO_MODE_3 0x00000003 // Moto fmt, polarity 1, phase 1
74 #define SSI_FRF_TI 0x00000010 // TI frame format
75 #define SSI_FRF_NMW 0x00000020 // National MicroWire frame format
76 
77 #define SSI_MODE_MASTER 0x00000000 // SSI master
78 #define SSI_MODE_SLAVE 0x00000001 // SSI slave
79 #define SSI_MODE_SLAVE_OD 0x00000002 // SSI slave with output disabled
80 
81 //*****************************************************************************
82 //
83 // Values that can be passed to SSIDMAEnable() and SSIDMADisable().
84 //
85 //*****************************************************************************
86 #define SSI_DMA_TX 0x00000002 // Enable DMA for transmit
87 #define SSI_DMA_RX 0x00000001 // Enable DMA for receive
88 
89 //*****************************************************************************
90 //
91 // Values that can be passed to SSIClockSourceSet() or returned from
92 // SSIClockSourceGet().
93 //
94 //*****************************************************************************
95 #define SSI_CLOCK_SYSTEM 0x00000000
96 #define SSI_CLOCK_PIOSC 0x00000005
97 
98 //*****************************************************************************
99 //
100 // Prototypes for the APIs.
101 //
102 //*****************************************************************************
103 extern void SSIConfigSetExpClk(uint32_t ui32Base, uint32_t ui32SSIClk,
104  uint32_t ui32Protocol, uint32_t ui32Mode,
105  uint32_t ui32BitRate,
106  uint32_t ui32DataWidth);
107 extern void SSIDataGet(uint32_t ui32Base, uint32_t *pui32Data);
108 extern int32_t SSIDataGetNonBlocking(uint32_t ui32Base,
109  uint32_t *pui32Data);
110 extern void SSIDataPut(uint32_t ui32Base, uint32_t ui32Data);
111 extern int32_t SSIDataPutNonBlocking(uint32_t ui32Base, uint32_t ui32Data);
112 extern void SSIDisable(uint32_t ui32Base);
113 extern void SSIEnable(uint32_t ui32Base);
114 extern void SSIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags);
115 extern void SSIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags);
116 extern void SSIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags);
117 extern void SSIIntRegister(uint32_t ui32Base, void (*pfnHandler)(void));
118 extern uint32_t SSIIntStatus(uint32_t ui32Base, bool bMasked);
119 extern void SSIIntUnregister(uint32_t ui32Base);
120 extern void SSIDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags);
121 extern void SSIDMADisable(uint32_t ui32Base, uint32_t ui32DMAFlags);
122 extern bool SSIBusy(uint32_t ui32Base);
123 extern void SSIClockSourceSet(uint32_t ui32Base, uint32_t ui32Source);
124 extern uint32_t SSIClockSourceGet(uint32_t ui32Base);
125 
126 //*****************************************************************************
127 //
128 // Mark the end of the C bindings section for C++ compilers.
129 //
130 //*****************************************************************************
131 #ifdef __cplusplus
132 }
133 #endif
134 
135 #endif // __DRIVERLIB_SSI_H__
uint32_t SSIIntStatus(uint32_t ui32Base, bool bMasked)
Definition: ssi.c:479
void SSIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: ssi.c:449
void SSIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: ssi.c:421
void SSIDataGet(uint32_t ui32Base, uint32_t *pui32Data)
Definition: ssi.c:647
void SSIClockSourceSet(uint32_t ui32Base, uint32_t ui32Source)
Definition: ssi.c:829
int32_t SSIDataPutNonBlocking(uint32_t ui32Base, uint32_t ui32Data)
Definition: ssi.c:601
void SSIDisable(uint32_t ui32Base)
Definition: ssi.c:299
uint32_t SSIClockSourceGet(uint32_t ui32Base)
Definition: ssi.c:861
void SSIEnable(uint32_t ui32Base)
Definition: ssi.c:274
int32_t SSIDataGetNonBlocking(uint32_t ui32Base, uint32_t *pui32Data)
Definition: ssi.c:690
void SSIDataPut(uint32_t ui32Base, uint32_t ui32Data)
Definition: ssi.c:559
void SSIIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: ssi.c:333
bool SSIBusy(uint32_t ui32Base)
Definition: ssi.c:793
void SSIIntUnregister(uint32_t ui32Base)
Definition: ssi.c:377
void SSIDMADisable(uint32_t ui32Base, uint32_t ui32DMAFlags)
Definition: ssi.c:764
void SSIConfigSetExpClk(uint32_t ui32Base, uint32_t ui32SSIClk, uint32_t ui32Protocol, uint32_t ui32Mode, uint32_t ui32BitRate, uint32_t ui32DataWidth)
Definition: ssi.c:201
void SSIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: ssi.c:526
void SSIDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags)
Definition: ssi.c:733