1 //*****************************************************************************
\r
3 // ssi.h - Prototypes for the Synchronous Serial Interface Driver.
\r
5 // Copyright (c) 2005-2008 Luminary Micro, Inc. All rights reserved.
\r
7 // Software License Agreement
\r
9 // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
\r
10 // exclusively on LMI's microcontroller products.
\r
12 // The software is owned by LMI and/or its suppliers, and is protected under
\r
13 // applicable copyright laws. All rights are reserved. You may not combine
\r
14 // this software with "viral" open-source software in order to form a larger
\r
15 // program. Any use in violation of the foregoing restrictions may subject
\r
16 // the user to criminal sanctions under applicable laws, as well as to civil
\r
17 // liability for the breach of the terms and conditions of this license.
\r
19 // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
\r
20 // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
\r
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
\r
22 // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
\r
23 // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
\r
25 // This is part of revision 2523 of the Stellaris Peripheral Driver Library.
\r
27 //*****************************************************************************
\r
32 //*****************************************************************************
\r
34 // If building with a C++ compiler, make all of the definitions in this header
\r
35 // have a C binding.
\r
37 //*****************************************************************************
\r
43 //*****************************************************************************
\r
45 // Values that can be passed to SSIIntEnable, SSIIntDisable, and SSIIntClear
\r
46 // as the ulIntFlags parameter, and returned by SSIIntStatus.
\r
48 //*****************************************************************************
\r
49 #define SSI_TXFF 0x00000008 // TX FIFO half empty or less
\r
50 #define SSI_RXFF 0x00000004 // RX FIFO half full or less
\r
51 #define SSI_RXTO 0x00000002 // RX timeout
\r
52 #define SSI_RXOR 0x00000001 // RX overrun
\r
54 //*****************************************************************************
\r
56 // Values that can be passed to SSIConfigSetExpClk.
\r
58 //*****************************************************************************
\r
59 #define SSI_FRF_MOTO_MODE_0 0x00000000 // Moto fmt, polarity 0, phase 0
\r
60 #define SSI_FRF_MOTO_MODE_1 0x00000002 // Moto fmt, polarity 0, phase 1
\r
61 #define SSI_FRF_MOTO_MODE_2 0x00000001 // Moto fmt, polarity 1, phase 0
\r
62 #define SSI_FRF_MOTO_MODE_3 0x00000003 // Moto fmt, polarity 1, phase 1
\r
63 #define SSI_FRF_TI 0x00000010 // TI frame format
\r
64 #define SSI_FRF_NMW 0x00000020 // National MicroWire frame format
\r
66 #define SSI_MODE_MASTER 0x00000000 // SSI master
\r
67 #define SSI_MODE_SLAVE 0x00000001 // SSI slave
\r
68 #define SSI_MODE_SLAVE_OD 0x00000002 // SSI slave with output disabled
\r
70 //*****************************************************************************
\r
72 // Values that can be passed to SSIDMAEnable() and SSIDMADisable().
\r
74 //*****************************************************************************
\r
75 #define SSI_DMA_TX 0x00000002 // Enable DMA for transmit
\r
76 #define SSI_DMA_RX 0x00000001 // Enable DMA for receive
\r
78 //*****************************************************************************
\r
80 // Prototypes for the APIs.
\r
82 //*****************************************************************************
\r
83 extern void SSIConfigSetExpClk(unsigned long ulBase, unsigned long ulSSIClk,
\r
84 unsigned long ulProtocol, unsigned long ulMode,
\r
85 unsigned long ulBitRate,
\r
86 unsigned long ulDataWidth);
\r
87 extern void SSIDataGet(unsigned long ulBase, unsigned long *pulData);
\r
88 extern long SSIDataGetNonBlocking(unsigned long ulBase,
\r
89 unsigned long *pulData);
\r
90 extern void SSIDataPut(unsigned long ulBase, unsigned long ulData);
\r
91 extern long SSIDataPutNonBlocking(unsigned long ulBase, unsigned long ulData);
\r
92 extern void SSIDisable(unsigned long ulBase);
\r
93 extern void SSIEnable(unsigned long ulBase);
\r
94 extern void SSIIntClear(unsigned long ulBase, unsigned long ulIntFlags);
\r
95 extern void SSIIntDisable(unsigned long ulBase, unsigned long ulIntFlags);
\r
96 extern void SSIIntEnable(unsigned long ulBase, unsigned long ulIntFlags);
\r
97 extern void SSIIntRegister(unsigned long ulBase, void(*pfnHandler)(void));
\r
98 extern unsigned long SSIIntStatus(unsigned long ulBase, tBoolean bMasked);
\r
99 extern void SSIIntUnregister(unsigned long ulBase);
\r
100 extern void SSIDMAEnable(unsigned long ulBase, unsigned long ulDMAFlags);
\r
101 extern void SSIDMADisable(unsigned long ulBase, unsigned long ulDMAFlags);
\r
103 //*****************************************************************************
\r
105 // Several SSI APIs have been renamed, with the original function name being
\r
106 // deprecated. These defines provide backward compatibility.
\r
108 //*****************************************************************************
\r
110 #include "sysctl.h"
\r
111 #define SSIConfig(a, b, c, d, e) \
\r
112 SSIConfigSetExpClk(a, SysCtlClockGet(), b, c, d, e)
\r
113 #define SSIDataNonBlockingGet(a, b) \
\r
114 SSIDataGetNonBlocking(a, b)
\r
115 #define SSIDataNonBlockingPut(a, b) \
\r
116 SSIDataPutNonBlocking(a, b)
\r
119 //*****************************************************************************
\r
121 // Mark the end of the C bindings section for C++ compilers.
\r
123 //*****************************************************************************
\r
128 #endif // __SSI_H__
\r