hw_ssi.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. //*****************************************************************************
  2. //
  3. // hw_ssi.h - Macros used when accessing the SSI hardware.
  4. //
  5. // Copyright (c) 2005-2011 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. // This is part of revision 8264 of the Stellaris Firmware Development Package.
  22. //
  23. //*****************************************************************************
  24. #ifndef __HW_SSI_H__
  25. #define __HW_SSI_H__
  26. //*****************************************************************************
  27. //
  28. // The following are defines for the SSI register offsets.
  29. //
  30. //*****************************************************************************
  31. #define SSI_O_CR0 0x00000000 // SSI Control 0
  32. #define SSI_O_CR1 0x00000004 // SSI Control 1
  33. #define SSI_O_DR 0x00000008 // SSI Data
  34. #define SSI_O_SR 0x0000000C // SSI Status
  35. #define SSI_O_CPSR 0x00000010 // SSI Clock Prescale
  36. #define SSI_O_IM 0x00000014 // SSI Interrupt Mask
  37. #define SSI_O_RIS 0x00000018 // SSI Raw Interrupt Status
  38. #define SSI_O_MIS 0x0000001C // SSI Masked Interrupt Status
  39. #define SSI_O_ICR 0x00000020 // SSI Interrupt Clear
  40. #define SSI_O_DMACTL 0x00000024 // SSI DMA Control
  41. #define SSI_O_CC 0x00000FC8 // SSI Clock Configuration
  42. //*****************************************************************************
  43. //
  44. // The following are defines for the bit fields in the SSI_O_CR0 register.
  45. //
  46. //*****************************************************************************
  47. #define SSI_CR0_SCR_M 0x0000FF00 // SSI Serial Clock Rate
  48. #define SSI_CR0_SPH 0x00000080 // SSI Serial Clock Phase
  49. #define SSI_CR0_SPO 0x00000040 // SSI Serial Clock Polarity
  50. #define SSI_CR0_FRF_M 0x00000030 // SSI Frame Format Select
  51. #define SSI_CR0_FRF_MOTO 0x00000000 // Freescale SPI Frame Format
  52. #define SSI_CR0_FRF_TI 0x00000010 // Texas Instruments Synchronous
  53. // Serial Frame Format
  54. #define SSI_CR0_FRF_NMW 0x00000020 // MICROWIRE Frame Format
  55. #define SSI_CR0_DSS_M 0x0000000F // SSI Data Size Select
  56. #define SSI_CR0_DSS_4 0x00000003 // 4-bit data
  57. #define SSI_CR0_DSS_5 0x00000004 // 5-bit data
  58. #define SSI_CR0_DSS_6 0x00000005 // 6-bit data
  59. #define SSI_CR0_DSS_7 0x00000006 // 7-bit data
  60. #define SSI_CR0_DSS_8 0x00000007 // 8-bit data
  61. #define SSI_CR0_DSS_9 0x00000008 // 9-bit data
  62. #define SSI_CR0_DSS_10 0x00000009 // 10-bit data
  63. #define SSI_CR0_DSS_11 0x0000000A // 11-bit data
  64. #define SSI_CR0_DSS_12 0x0000000B // 12-bit data
  65. #define SSI_CR0_DSS_13 0x0000000C // 13-bit data
  66. #define SSI_CR0_DSS_14 0x0000000D // 14-bit data
  67. #define SSI_CR0_DSS_15 0x0000000E // 15-bit data
  68. #define SSI_CR0_DSS_16 0x0000000F // 16-bit data
  69. #define SSI_CR0_SCR_S 8
  70. //*****************************************************************************
  71. //
  72. // The following are defines for the bit fields in the SSI_O_CR1 register.
  73. //
  74. //*****************************************************************************
  75. #define SSI_CR1_EOT 0x00000010 // End of Transmission
  76. #define SSI_CR1_SOD 0x00000008 // SSI Slave Mode Output Disable
  77. #define SSI_CR1_MS 0x00000004 // SSI Master/Slave Select
  78. #define SSI_CR1_SSE 0x00000002 // SSI Synchronous Serial Port
  79. // Enable
  80. #define SSI_CR1_LBM 0x00000001 // SSI Loopback Mode
  81. //*****************************************************************************
  82. //
  83. // The following are defines for the bit fields in the SSI_O_DR register.
  84. //
  85. //*****************************************************************************
  86. #define SSI_DR_DATA_M 0x0000FFFF // SSI Receive/Transmit Data
  87. #define SSI_DR_DATA_S 0
  88. //*****************************************************************************
  89. //
  90. // The following are defines for the bit fields in the SSI_O_SR register.
  91. //
  92. //*****************************************************************************
  93. #define SSI_SR_BSY 0x00000010 // SSI Busy Bit
  94. #define SSI_SR_RFF 0x00000008 // SSI Receive FIFO Full
  95. #define SSI_SR_RNE 0x00000004 // SSI Receive FIFO Not Empty
  96. #define SSI_SR_TNF 0x00000002 // SSI Transmit FIFO Not Full
  97. #define SSI_SR_TFE 0x00000001 // SSI Transmit FIFO Empty
  98. //*****************************************************************************
  99. //
  100. // The following are defines for the bit fields in the SSI_O_CPSR register.
  101. //
  102. //*****************************************************************************
  103. #define SSI_CPSR_CPSDVSR_M 0x000000FF // SSI Clock Prescale Divisor
  104. #define SSI_CPSR_CPSDVSR_S 0
  105. //*****************************************************************************
  106. //
  107. // The following are defines for the bit fields in the SSI_O_IM register.
  108. //
  109. //*****************************************************************************
  110. #define SSI_IM_TXIM 0x00000008 // SSI Transmit FIFO Interrupt Mask
  111. #define SSI_IM_RXIM 0x00000004 // SSI Receive FIFO Interrupt Mask
  112. #define SSI_IM_RTIM 0x00000002 // SSI Receive Time-Out Interrupt
  113. // Mask
  114. #define SSI_IM_RORIM 0x00000001 // SSI Receive Overrun Interrupt
  115. // Mask
  116. //*****************************************************************************
  117. //
  118. // The following are defines for the bit fields in the SSI_O_RIS register.
  119. //
  120. //*****************************************************************************
  121. #define SSI_RIS_TXRIS 0x00000008 // SSI Transmit FIFO Raw Interrupt
  122. // Status
  123. #define SSI_RIS_RXRIS 0x00000004 // SSI Receive FIFO Raw Interrupt
  124. // Status
  125. #define SSI_RIS_RTRIS 0x00000002 // SSI Receive Time-Out Raw
  126. // Interrupt Status
  127. #define SSI_RIS_RORRIS 0x00000001 // SSI Receive Overrun Raw
  128. // Interrupt Status
  129. //*****************************************************************************
  130. //
  131. // The following are defines for the bit fields in the SSI_O_MIS register.
  132. //
  133. //*****************************************************************************
  134. #define SSI_MIS_TXMIS 0x00000008 // SSI Transmit FIFO Masked
  135. // Interrupt Status
  136. #define SSI_MIS_RXMIS 0x00000004 // SSI Receive FIFO Masked
  137. // Interrupt Status
  138. #define SSI_MIS_RTMIS 0x00000002 // SSI Receive Time-Out Masked
  139. // Interrupt Status
  140. #define SSI_MIS_RORMIS 0x00000001 // SSI Receive Overrun Masked
  141. // Interrupt Status
  142. //*****************************************************************************
  143. //
  144. // The following are defines for the bit fields in the SSI_O_ICR register.
  145. //
  146. //*****************************************************************************
  147. #define SSI_ICR_RTIC 0x00000002 // SSI Receive Time-Out Interrupt
  148. // Clear
  149. #define SSI_ICR_RORIC 0x00000001 // SSI Receive Overrun Interrupt
  150. // Clear
  151. //*****************************************************************************
  152. //
  153. // The following are defines for the bit fields in the SSI_O_DMACTL register.
  154. //
  155. //*****************************************************************************
  156. #define SSI_DMACTL_TXDMAE 0x00000002 // Transmit DMA Enable
  157. #define SSI_DMACTL_RXDMAE 0x00000001 // Receive DMA Enable
  158. //*****************************************************************************
  159. //
  160. // The following are defines for the bit fields in the SSI_O_CC register.
  161. //
  162. //*****************************************************************************
  163. #define SSI_CC_CS_M 0x0000000F // SSI Baud Clock Source
  164. #define SSI_CC_CS_SYSPLL 0x00000000 // Either the system clock (if the
  165. // PLL bypass is in effect) or the
  166. // PLL output (default)
  167. #define SSI_CC_CS_PIOSC 0x00000001 // PIOSC
  168. //*****************************************************************************
  169. //
  170. // The following definitions are deprecated.
  171. //
  172. //*****************************************************************************
  173. #ifndef DEPRECATED
  174. //*****************************************************************************
  175. //
  176. // The following are deprecated defines for the bit fields in the SSI_O_CR0
  177. // register.
  178. //
  179. //*****************************************************************************
  180. #define SSI_CR0_SCR 0x0000FF00 // Serial clock rate
  181. #define SSI_CR0_FRF_MASK 0x00000030 // Frame format mask
  182. #define SSI_CR0_DSS 0x0000000F // Data size select
  183. //*****************************************************************************
  184. //
  185. // The following are deprecated defines for the bit fields in the SSI_O_CPSR
  186. // register.
  187. //
  188. //*****************************************************************************
  189. #define SSI_CPSR_CPSDVSR_MASK 0x000000FF // Clock prescale
  190. //*****************************************************************************
  191. //
  192. // The following are deprecated defines for the SSI controller's FIFO size.
  193. //
  194. //*****************************************************************************
  195. #define TX_FIFO_SIZE (8) // Number of entries in the TX FIFO
  196. #define RX_FIFO_SIZE (8) // Number of entries in the RX FIFO
  197. //*****************************************************************************
  198. //
  199. // The following are deprecated defines for the bit fields in the interrupt
  200. // mask set and clear, raw interrupt, masked interrupt, and interrupt clear
  201. // registers.
  202. //
  203. //*****************************************************************************
  204. #define SSI_INT_TXFF 0x00000008 // TX FIFO interrupt
  205. #define SSI_INT_RXFF 0x00000004 // RX FIFO interrupt
  206. #define SSI_INT_RXTO 0x00000002 // RX timeout interrupt
  207. #define SSI_INT_RXOR 0x00000001 // RX overrun interrupt
  208. #endif
  209. #endif // __HW_SSI_H__