hw_ssi.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. //*****************************************************************************
  2. //
  3. // hw_ssi.h - Macros used when accessing the SSI hardware.
  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 Firmware Development Package.
  37. //
  38. //*****************************************************************************
  39. #ifndef __HW_SSI_H__
  40. #define __HW_SSI_H__
  41. //*****************************************************************************
  42. //
  43. // The following are defines for the SSI register offsets.
  44. //
  45. //*****************************************************************************
  46. #define SSI_O_CR0 0x00000000 // SSI Control 0
  47. #define SSI_O_CR1 0x00000004 // SSI Control 1
  48. #define SSI_O_DR 0x00000008 // SSI Data
  49. #define SSI_O_SR 0x0000000C // SSI Status
  50. #define SSI_O_CPSR 0x00000010 // SSI Clock Prescale
  51. #define SSI_O_IM 0x00000014 // SSI Interrupt Mask
  52. #define SSI_O_RIS 0x00000018 // SSI Raw Interrupt Status
  53. #define SSI_O_MIS 0x0000001C // SSI Masked Interrupt Status
  54. #define SSI_O_ICR 0x00000020 // SSI Interrupt Clear
  55. #define SSI_O_DMACTL 0x00000024 // SSI DMA Control
  56. #define SSI_O_PP 0x00000FC0 // SSI Peripheral Properties
  57. #define SSI_O_CC 0x00000FC8 // SSI Clock Configuration
  58. //*****************************************************************************
  59. //
  60. // The following are defines for the bit fields in the SSI_O_CR0 register.
  61. //
  62. //*****************************************************************************
  63. #define SSI_CR0_SCR_M 0x0000FF00 // SSI Serial Clock Rate
  64. #define SSI_CR0_SPH 0x00000080 // SSI Serial Clock Phase
  65. #define SSI_CR0_SPO 0x00000040 // SSI Serial Clock Polarity
  66. #define SSI_CR0_FRF_M 0x00000030 // SSI Frame Format Select
  67. #define SSI_CR0_FRF_MOTO 0x00000000 // Freescale SPI Frame Format
  68. #define SSI_CR0_FRF_TI 0x00000010 // Synchronous Serial Frame Format
  69. #define SSI_CR0_FRF_NMW 0x00000020 // MICROWIRE Frame Format
  70. #define SSI_CR0_DSS_M 0x0000000F // SSI Data Size Select
  71. #define SSI_CR0_DSS_4 0x00000003 // 4-bit data
  72. #define SSI_CR0_DSS_5 0x00000004 // 5-bit data
  73. #define SSI_CR0_DSS_6 0x00000005 // 6-bit data
  74. #define SSI_CR0_DSS_7 0x00000006 // 7-bit data
  75. #define SSI_CR0_DSS_8 0x00000007 // 8-bit data
  76. #define SSI_CR0_DSS_9 0x00000008 // 9-bit data
  77. #define SSI_CR0_DSS_10 0x00000009 // 10-bit data
  78. #define SSI_CR0_DSS_11 0x0000000A // 11-bit data
  79. #define SSI_CR0_DSS_12 0x0000000B // 12-bit data
  80. #define SSI_CR0_DSS_13 0x0000000C // 13-bit data
  81. #define SSI_CR0_DSS_14 0x0000000D // 14-bit data
  82. #define SSI_CR0_DSS_15 0x0000000E // 15-bit data
  83. #define SSI_CR0_DSS_16 0x0000000F // 16-bit data
  84. #define SSI_CR0_SCR_S 8
  85. //*****************************************************************************
  86. //
  87. // The following are defines for the bit fields in the SSI_O_CR1 register.
  88. //
  89. //*****************************************************************************
  90. #define SSI_CR1_EOM 0x00000800 // Stop Frame (End of Message)
  91. #define SSI_CR1_FSSHLDFRM 0x00000400 // FSS Hold Frame
  92. #define SSI_CR1_HSCLKEN 0x00000200 // High Speed Clock Enable
  93. #define SSI_CR1_DIR 0x00000100 // SSI Direction of Operation
  94. #define SSI_CR1_MODE_M 0x000000C0 // SSI Mode
  95. #define SSI_CR1_MODE_LEGACY 0x00000000 // Legacy SSI mode
  96. #define SSI_CR1_MODE_BI 0x00000040 // Bi-SSI mode
  97. #define SSI_CR1_MODE_QUAD 0x00000080 // Quad-SSI Mode
  98. #define SSI_CR1_MODE_ADVANCED 0x000000C0 // Advanced SSI Mode with 8-bit
  99. // packet size
  100. #define SSI_CR1_EOT 0x00000010 // End of Transmission
  101. #define SSI_CR1_SOD 0x00000008 // SSI Slave Mode Output Disable
  102. #define SSI_CR1_MS 0x00000004 // SSI Master/Slave Select
  103. #define SSI_CR1_SSE 0x00000002 // SSI Synchronous Serial Port
  104. // Enable
  105. #define SSI_CR1_LBM 0x00000001 // SSI Loopback Mode
  106. //*****************************************************************************
  107. //
  108. // The following are defines for the bit fields in the SSI_O_DR register.
  109. //
  110. //*****************************************************************************
  111. #define SSI_DR_DATA_M 0x0000FFFF // SSI Receive/Transmit Data
  112. #define SSI_DR_DATA_S 0
  113. //*****************************************************************************
  114. //
  115. // The following are defines for the bit fields in the SSI_O_SR register.
  116. //
  117. //*****************************************************************************
  118. #define SSI_SR_BSY 0x00000010 // SSI Busy Bit
  119. #define SSI_SR_RFF 0x00000008 // SSI Receive FIFO Full
  120. #define SSI_SR_RNE 0x00000004 // SSI Receive FIFO Not Empty
  121. #define SSI_SR_TNF 0x00000002 // SSI Transmit FIFO Not Full
  122. #define SSI_SR_TFE 0x00000001 // SSI Transmit FIFO Empty
  123. //*****************************************************************************
  124. //
  125. // The following are defines for the bit fields in the SSI_O_CPSR register.
  126. //
  127. //*****************************************************************************
  128. #define SSI_CPSR_CPSDVSR_M 0x000000FF // SSI Clock Prescale Divisor
  129. #define SSI_CPSR_CPSDVSR_S 0
  130. //*****************************************************************************
  131. //
  132. // The following are defines for the bit fields in the SSI_O_IM register.
  133. //
  134. //*****************************************************************************
  135. #define SSI_IM_EOTIM 0x00000040 // End of Transmit Interrupt Mask
  136. #define SSI_IM_DMATXIM 0x00000020 // SSI Transmit DMA Interrupt Mask
  137. #define SSI_IM_DMARXIM 0x00000010 // SSI Receive DMA Interrupt Mask
  138. #define SSI_IM_TXIM 0x00000008 // SSI Transmit FIFO Interrupt Mask
  139. #define SSI_IM_RXIM 0x00000004 // SSI Receive FIFO Interrupt Mask
  140. #define SSI_IM_RTIM 0x00000002 // SSI Receive Time-Out Interrupt
  141. // Mask
  142. #define SSI_IM_RORIM 0x00000001 // SSI Receive Overrun Interrupt
  143. // Mask
  144. //*****************************************************************************
  145. //
  146. // The following are defines for the bit fields in the SSI_O_RIS register.
  147. //
  148. //*****************************************************************************
  149. #define SSI_RIS_EOTRIS 0x00000040 // End of Transmit Raw Interrupt
  150. // Status
  151. #define SSI_RIS_DMATXRIS 0x00000020 // SSI Transmit DMA Raw Interrupt
  152. // Status
  153. #define SSI_RIS_DMARXRIS 0x00000010 // SSI Receive DMA Raw Interrupt
  154. // Status
  155. #define SSI_RIS_TXRIS 0x00000008 // SSI Transmit FIFO Raw Interrupt
  156. // Status
  157. #define SSI_RIS_RXRIS 0x00000004 // SSI Receive FIFO Raw Interrupt
  158. // Status
  159. #define SSI_RIS_RTRIS 0x00000002 // SSI Receive Time-Out Raw
  160. // Interrupt Status
  161. #define SSI_RIS_RORRIS 0x00000001 // SSI Receive Overrun Raw
  162. // Interrupt Status
  163. //*****************************************************************************
  164. //
  165. // The following are defines for the bit fields in the SSI_O_MIS register.
  166. //
  167. //*****************************************************************************
  168. #define SSI_MIS_EOTMIS 0x00000040 // End of Transmit Masked Interrupt
  169. // Status
  170. #define SSI_MIS_DMATXMIS 0x00000020 // SSI Transmit DMA Masked
  171. // Interrupt Status
  172. #define SSI_MIS_DMARXMIS 0x00000010 // SSI Receive DMA Masked Interrupt
  173. // Status
  174. #define SSI_MIS_TXMIS 0x00000008 // SSI Transmit FIFO Masked
  175. // Interrupt Status
  176. #define SSI_MIS_RXMIS 0x00000004 // SSI Receive FIFO Masked
  177. // Interrupt Status
  178. #define SSI_MIS_RTMIS 0x00000002 // SSI Receive Time-Out Masked
  179. // Interrupt Status
  180. #define SSI_MIS_RORMIS 0x00000001 // SSI Receive Overrun Masked
  181. // Interrupt Status
  182. //*****************************************************************************
  183. //
  184. // The following are defines for the bit fields in the SSI_O_ICR register.
  185. //
  186. //*****************************************************************************
  187. #define SSI_ICR_EOTIC 0x00000040 // End of Transmit Interrupt Clear
  188. #define SSI_ICR_DMATXIC 0x00000020 // SSI Transmit DMA Interrupt Clear
  189. #define SSI_ICR_DMARXIC 0x00000010 // SSI Receive DMA Interrupt Clear
  190. #define SSI_ICR_RTIC 0x00000002 // SSI Receive Time-Out Interrupt
  191. // Clear
  192. #define SSI_ICR_RORIC 0x00000001 // SSI Receive Overrun Interrupt
  193. // Clear
  194. //*****************************************************************************
  195. //
  196. // The following are defines for the bit fields in the SSI_O_DMACTL register.
  197. //
  198. //*****************************************************************************
  199. #define SSI_DMACTL_TXDMAE 0x00000002 // Transmit DMA Enable
  200. #define SSI_DMACTL_RXDMAE 0x00000001 // Receive DMA Enable
  201. //*****************************************************************************
  202. //
  203. // The following are defines for the bit fields in the SSI_O_PP register.
  204. //
  205. //*****************************************************************************
  206. #define SSI_PP_FSSHLDFRM 0x00000008 // FSS Hold Frame Capability
  207. #define SSI_PP_MODE_M 0x00000006 // Mode of Operation
  208. #define SSI_PP_MODE_LEGACY 0x00000000 // Legacy SSI mode
  209. #define SSI_PP_MODE_ADVBI 0x00000002 // Legacy mode, Advanced SSI mode
  210. // and Bi-SSI mode enabled
  211. #define SSI_PP_MODE_ADVBIQUAD 0x00000004 // Legacy mode, Advanced mode,
  212. // Bi-SSI and Quad-SSI mode enabled
  213. #define SSI_PP_HSCLK 0x00000001 // High Speed Capability
  214. //*****************************************************************************
  215. //
  216. // The following are defines for the bit fields in the SSI_O_CC register.
  217. //
  218. //*****************************************************************************
  219. #define SSI_CC_CS_M 0x0000000F // SSI Baud Clock Source
  220. #define SSI_CC_CS_SYSPLL 0x00000000 // System clock (based on clock
  221. // source and divisor factor)
  222. #define SSI_CC_CS_PIOSC 0x00000005 // PIOSC
  223. #endif // __HW_SSI_H__