hw_ssi.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. //*****************************************************************************
  2. //
  3. // hw_ssi.h - Macros used when accessing the SSI hardware.
  4. //
  5. // Copyright (c) 2005-2010 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 6459 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. //*****************************************************************************
  42. //
  43. // The following are defines for the bit fields in the SSI_O_CR0 register.
  44. //
  45. //*****************************************************************************
  46. #define SSI_CR0_SCR_M 0x0000FF00 // SSI Serial Clock Rate
  47. #define SSI_CR0_SPH 0x00000080 // SSI Serial Clock Phase
  48. #define SSI_CR0_SPO 0x00000040 // SSI Serial Clock Polarity
  49. #define SSI_CR0_FRF_M 0x00000030 // SSI Frame Format Select
  50. #define SSI_CR0_FRF_MOTO 0x00000000 // Freescale SPI Frame Format
  51. #define SSI_CR0_FRF_TI 0x00000010 // Texas Instruments Synchronous
  52. // Serial Frame Format
  53. #define SSI_CR0_FRF_NMW 0x00000020 // MICROWIRE Frame Format
  54. #define SSI_CR0_DSS_M 0x0000000F // SSI Data Size Select
  55. #define SSI_CR0_DSS_4 0x00000003 // 4-bit data
  56. #define SSI_CR0_DSS_5 0x00000004 // 5-bit data
  57. #define SSI_CR0_DSS_6 0x00000005 // 6-bit data
  58. #define SSI_CR0_DSS_7 0x00000006 // 7-bit data
  59. #define SSI_CR0_DSS_8 0x00000007 // 8-bit data
  60. #define SSI_CR0_DSS_9 0x00000008 // 9-bit data
  61. #define SSI_CR0_DSS_10 0x00000009 // 10-bit data
  62. #define SSI_CR0_DSS_11 0x0000000A // 11-bit data
  63. #define SSI_CR0_DSS_12 0x0000000B // 12-bit data
  64. #define SSI_CR0_DSS_13 0x0000000C // 13-bit data
  65. #define SSI_CR0_DSS_14 0x0000000D // 14-bit data
  66. #define SSI_CR0_DSS_15 0x0000000E // 15-bit data
  67. #define SSI_CR0_DSS_16 0x0000000F // 16-bit data
  68. #define SSI_CR0_SCR_S 8
  69. //*****************************************************************************
  70. //
  71. // The following are defines for the bit fields in the SSI_O_CR1 register.
  72. //
  73. //*****************************************************************************
  74. #define SSI_CR1_EOT 0x00000010 // End of Transmission
  75. #define SSI_CR1_SOD 0x00000008 // SSI Slave Mode Output Disable
  76. #define SSI_CR1_MS 0x00000004 // SSI Master/Slave Select
  77. #define SSI_CR1_SSE 0x00000002 // SSI Synchronous Serial Port
  78. // Enable
  79. #define SSI_CR1_LBM 0x00000001 // SSI Loopback Mode
  80. //*****************************************************************************
  81. //
  82. // The following are defines for the bit fields in the SSI_O_DR register.
  83. //
  84. //*****************************************************************************
  85. #define SSI_DR_DATA_M 0x0000FFFF // SSI Receive/Transmit Data
  86. #define SSI_DR_DATA_S 0
  87. //*****************************************************************************
  88. //
  89. // The following are defines for the bit fields in the SSI_O_SR register.
  90. //
  91. //*****************************************************************************
  92. #define SSI_SR_BSY 0x00000010 // SSI Busy Bit
  93. #define SSI_SR_RFF 0x00000008 // SSI Receive FIFO Full
  94. #define SSI_SR_RNE 0x00000004 // SSI Receive FIFO Not Empty
  95. #define SSI_SR_TNF 0x00000002 // SSI Transmit FIFO Not Full
  96. #define SSI_SR_TFE 0x00000001 // SSI Transmit FIFO Empty
  97. //*****************************************************************************
  98. //
  99. // The following are defines for the bit fields in the SSI_O_CPSR register.
  100. //
  101. //*****************************************************************************
  102. #define SSI_CPSR_CPSDVSR_M 0x000000FF // SSI Clock Prescale Divisor
  103. #define SSI_CPSR_CPSDVSR_S 0
  104. //*****************************************************************************
  105. //
  106. // The following are defines for the bit fields in the SSI_O_IM register.
  107. //
  108. //*****************************************************************************
  109. #define SSI_IM_TXIM 0x00000008 // SSI Transmit FIFO Interrupt Mask
  110. #define SSI_IM_RXIM 0x00000004 // SSI Receive FIFO Interrupt Mask
  111. #define SSI_IM_RTIM 0x00000002 // SSI Receive Time-Out Interrupt
  112. // Mask
  113. #define SSI_IM_RORIM 0x00000001 // SSI Receive Overrun Interrupt
  114. // Mask
  115. //*****************************************************************************
  116. //
  117. // The following are defines for the bit fields in the SSI_O_RIS register.
  118. //
  119. //*****************************************************************************
  120. #define SSI_RIS_TXRIS 0x00000008 // SSI Transmit FIFO Raw Interrupt
  121. // Status
  122. #define SSI_RIS_RXRIS 0x00000004 // SSI Receive FIFO Raw Interrupt
  123. // Status
  124. #define SSI_RIS_RTRIS 0x00000002 // SSI Receive Time-Out Raw
  125. // Interrupt Status
  126. #define SSI_RIS_RORRIS 0x00000001 // SSI Receive Overrun Raw
  127. // Interrupt Status
  128. //*****************************************************************************
  129. //
  130. // The following are defines for the bit fields in the SSI_O_MIS register.
  131. //
  132. //*****************************************************************************
  133. #define SSI_MIS_TXMIS 0x00000008 // SSI Transmit FIFO Masked
  134. // Interrupt Status
  135. #define SSI_MIS_RXMIS 0x00000004 // SSI Receive FIFO Masked
  136. // Interrupt Status
  137. #define SSI_MIS_RTMIS 0x00000002 // SSI Receive Time-Out Masked
  138. // Interrupt Status
  139. #define SSI_MIS_RORMIS 0x00000001 // SSI Receive Overrun Masked
  140. // Interrupt Status
  141. //*****************************************************************************
  142. //
  143. // The following are defines for the bit fields in the SSI_O_ICR register.
  144. //
  145. //*****************************************************************************
  146. #define SSI_ICR_RTIC 0x00000002 // SSI Receive Time-Out Interrupt
  147. // Clear
  148. #define SSI_ICR_RORIC 0x00000001 // SSI Receive Overrun Interrupt
  149. // Clear
  150. //*****************************************************************************
  151. //
  152. // The following are defines for the bit fields in the SSI_O_DMACTL register.
  153. //
  154. //*****************************************************************************
  155. #define SSI_DMACTL_TXDMAE 0x00000002 // Transmit DMA Enable
  156. #define SSI_DMACTL_RXDMAE 0x00000001 // Receive DMA Enable
  157. //*****************************************************************************
  158. //
  159. // The following definitions are deprecated.
  160. //
  161. //*****************************************************************************
  162. #ifndef DEPRECATED
  163. //*****************************************************************************
  164. //
  165. // The following are deprecated defines for the bit fields in the SSI_O_CR0
  166. // register.
  167. //
  168. //*****************************************************************************
  169. #define SSI_CR0_SCR 0x0000FF00 // Serial clock rate
  170. #define SSI_CR0_FRF_MASK 0x00000030 // Frame format mask
  171. #define SSI_CR0_DSS 0x0000000F // Data size select
  172. //*****************************************************************************
  173. //
  174. // The following are deprecated defines for the bit fields in the SSI_O_CPSR
  175. // register.
  176. //
  177. //*****************************************************************************
  178. #define SSI_CPSR_CPSDVSR_MASK 0x000000FF // Clock prescale
  179. //*****************************************************************************
  180. //
  181. // The following are deprecated defines for the SSI controller's FIFO size.
  182. //
  183. //*****************************************************************************
  184. #define TX_FIFO_SIZE (8) // Number of entries in the TX FIFO
  185. #define RX_FIFO_SIZE (8) // Number of entries in the RX FIFO
  186. //*****************************************************************************
  187. //
  188. // The following are deprecated defines for the bit fields in the interrupt
  189. // mask set and clear, raw interrupt, masked interrupt, and interrupt clear
  190. // registers.
  191. //
  192. //*****************************************************************************
  193. #define SSI_INT_TXFF 0x00000008 // TX FIFO interrupt
  194. #define SSI_INT_RXFF 0x00000004 // RX FIFO interrupt
  195. #define SSI_INT_RXTO 0x00000002 // RX timeout interrupt
  196. #define SSI_INT_RXOR 0x00000001 // RX overrun interrupt
  197. #endif
  198. #endif // __HW_SSI_H__