csl_tsip.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. /**
  2. * @file csl_tsip.h
  3. *
  4. * @brief
  5. * This is the main header file for the TSIP Module which defines
  6. * all the data structures and exported API.
  7. *
  8. * \par
  9. * ============================================================================
  10. * @n (C) Copyright 2008-2015, Texas Instruments, Inc.
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions
  14. * are met:
  15. *
  16. * Redistributions of source code must retain the above copyright
  17. * notice, this list of conditions and the following disclaimer.
  18. *
  19. * Redistributions in binary form must reproduce the above copyright
  20. * notice, this list of conditions and the following disclaimer in the
  21. * documentation and/or other materials provided with the
  22. * distribution.
  23. *
  24. * Neither the name of Texas Instruments Incorporated nor the names of
  25. * its contributors may be used to endorse or promote products derived
  26. * from this software without specific prior written permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  29. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  30. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  31. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  32. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  33. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  34. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  35. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  36. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  37. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  38. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. */
  41. /** @defgroup CSL_TSIP_API TSIP
  42. *
  43. * @section Introduction
  44. *
  45. * @subsection xxx Overview
  46. * This page describes the Functions, Data Structures, Enumerations and Macros
  47. * within TSIP module.
  48. *
  49. * The TSIP is a serial interface peripheral with timeslot data management and
  50. * an integrated DMA capability. The primary purpose of this peripheral is to
  51. * provide a glueless interface to common telecom serial data streams and
  52. * efficient internal routing of the data to designated memories in a multi-CPU
  53. * device.
  54. *
  55. * The TSIP provides 8 serial transmit pins and 8 serial receive pins that
  56. * connect directly to TEMUX devices. Internally the TSIP offers multiple
  57. * channels of timeslot data management and multichannel DMA capability that
  58. * allow individual timeslots to be selectively processed.
  59. *
  60. * The 3 TSIPs are controlled by 3 different LPSCs. TSIP0 is controlled by
  61. * LPSC10. TSIP1 is controlled by LPSC11. TSIP2 is controlled by LPSC12. This
  62. * is done so that TSIPs can be independently clock gated.
  63. *
  64. *
  65. * @subsection References
  66. * -# CSL-001-DES, CSL 3.x Design Specification DocumentVersion 1.02
  67. *
  68. */
  69. #ifndef CSL_TSIP_H
  70. #define CSL_TSIP_H
  71. #ifdef __cplusplus
  72. extern "C" {
  73. #endif
  74. #include <ti/csl/soc.h>
  75. #include <ti/csl/csl.h>
  76. #include <ti/csl/tistdtypes.h>
  77. #include <ti/csl/csl_types.h>
  78. #include <ti/csl/csl_error.h>
  79. #include <ti/csl/cslr_tsip.h>
  80. /**
  81. @defgroup CSL_TSIP_SYMBOL TSIP Symbols Defined
  82. @ingroup CSL_TSIP_API
  83. */
  84. /**
  85. @defgroup CSL_TSIP_DATASTRUCT TSIP Data Structures
  86. @ingroup CSL_TSIP_API
  87. */
  88. /**
  89. @defgroup CSL_TSIP_FUNCTION TSIP Functions
  90. @ingroup CSL_TSIP_API
  91. */
  92. /**
  93. @defgroup CSL_TSIP_ENUM TSIP Enumerated Data Types
  94. @ingroup CSL_TSIP_API
  95. */
  96. /** @defgroup CSL_TSIP_BITMAP_SIZE Bitmap Size
  97. * @ingroup CSL_TSIP_SYMBOL
  98. *
  99. * @{ */
  100. #define CSL_TSIP_BITMAP_SIZE 64
  101. /**
  102. @} */
  103. /**************************************************************************\
  104. * TSIP global typedef declarations
  105. \**************************************************************************/
  106. /**
  107. * @defgroup CSL_TSIP_TESTMODE_ENUM Test Mode Selection
  108. * @ingroup CSL_TSIP_ENUM
  109. *
  110. * @brief Test mode selection on TSIP
  111. *
  112. * Use this symbol for selecting test mode
  113. * @{ */
  114. typedef enum {
  115. /** Data loopback mode */
  116. CSL_TSIP_TESTMODE_DATA_LOOPBACK = 0,
  117. /** Link loopback mode */
  118. CSL_TSIP_TESTMODE_LINK_LOOPBACK = 1
  119. } CSL_TsipTestModeSelect;
  120. /**
  121. @} */
  122. /**
  123. * @defgroup CSL_TSIP_DATARATE_ENUM Data Rate
  124. * @ingroup CSL_TSIP_ENUM
  125. *
  126. * @brief Data Rate supported on TSIP
  127. *
  128. * Use this symbol for setting Data rate
  129. * @{ */
  130. typedef enum {
  131. /** Data rate is 8 Mbps */
  132. CSL_TSIP_DATARATE_8M = 0,
  133. /** Data rate is 16 Mbps */
  134. CSL_TSIP_DATARATE_16M = 1,
  135. /** Data rate is 32 Mbps */
  136. CSL_TSIP_DATARATE_32M = 2
  137. } CSL_TsipDataRate;
  138. /**
  139. @} */
  140. /**
  141. * @defgroup CSL_TSIP_PRI_ENUM Priority 0 to 7
  142. * @ingroup CSL_TSIP_ENUM
  143. *
  144. * @brief Priority 0 to 7
  145. *
  146. * Use this symbol for repereseting DMA priority
  147. * @{ */
  148. typedef enum {
  149. /** Priority 0 */
  150. CSL_TSIP_PRI_0 = 0,
  151. /** Priority 1 */
  152. CSL_TSIP_PRI_1 = 1,
  153. /** Priority 2 */
  154. CSL_TSIP_PRI_2 = 2,
  155. /** Priority 3 */
  156. CSL_TSIP_PRI_3 = 3,
  157. /** Priority 4 */
  158. CSL_TSIP_PRI_4 = 4,
  159. /** Priority 5 */
  160. CSL_TSIP_PRI_5 = 5,
  161. /** Priority 6 */
  162. CSL_TSIP_PRI_6 = 6,
  163. /** Priority 7 */
  164. CSL_TSIP_PRI_7 = 7
  165. } CSL_TsipPri;
  166. /**
  167. @} */
  168. /**
  169. * @defgroup CSL_TSIP_CLKM_ENUM Clock mode options
  170. * @ingroup CSL_TSIP_ENUM
  171. *
  172. * @brief TSIP clock mode options
  173. *
  174. * Use this symbol to set clock mode
  175. * @{ */
  176. typedef enum {
  177. /** Double rate clock */
  178. CSL_TSIP_CLKM_DBL = 0,
  179. /** Single rate clock */
  180. CSL_TSIP_CLKM_SGL = 1
  181. } CSL_TsipClkm;
  182. /**
  183. @} */
  184. /**
  185. * @defgroup CSL_TSIP_FRAMECOUNT_ENUM Frame Count options
  186. * @ingroup CSL_TSIP_ENUM
  187. *
  188. * @brief TSIP frame count options
  189. *
  190. * Use this symbol to represent frame count
  191. * @{ */
  192. typedef enum {
  193. /** Frame Count is 0 */
  194. CSL_TSIP_FRAMECOUNT_1 = 0,
  195. /** Frame Count is 255 */
  196. CSL_TSIP_FRAMECOUNT_256 = 255
  197. } CSL_TsipFramecount;
  198. /**
  199. @} */
  200. /**
  201. * @defgroup CSL_TSIP_FRAMESIZE_ENUM Frame Size options
  202. * @ingroup CSL_TSIP_ENUM
  203. *
  204. * @brief TSIP frame size options
  205. *
  206. * Use this symbol to represent frame size
  207. * @{ */
  208. typedef enum {
  209. /** Frame size is 0 */
  210. CSL_TSIP_FRAMESIZE_1 = 0,
  211. /** Frame size is 128 */
  212. CSL_TSIP_FRAMESIZE_128 = 127
  213. } CSL_TsipFramesize;
  214. /**
  215. @} */
  216. /**
  217. * @defgroup CSL_TSIP_TIMESLOT_ENUM Timeslot Configuration options
  218. * @ingroup CSL_TSIP_ENUM
  219. *
  220. * @brief TSIP timeslot configuration options
  221. *
  222. * Use this symbol to represent timeslot configuration
  223. * @{ */
  224. typedef enum {
  225. /** Timeslot Disabled */
  226. CSL_TSIP_TIMESLOT_DISABLED = 0,
  227. /** Linear */
  228. CSL_TSIP_TIMESLOT_LINEAR = 1,
  229. /** u-law */
  230. CSL_TSIP_TIMESLOT_ULAW = 2,
  231. /** a-law */
  232. CSL_TSIP_TIMESLOT_ALAW = 3
  233. } CSL_TsipTimeslot;
  234. /**
  235. @} */
  236. /**
  237. * @defgroup CSL_TSIP_CLKSRC_ENUM Frame and Clock Source
  238. * @ingroup CSL_TSIP_ENUM
  239. *
  240. * @brief Clock Source.... A/B
  241. *
  242. * Use this symbol to select the clock source
  243. * @{ */
  244. typedef enum {
  245. /** Clock and Frame sync Source A */
  246. CSL_TSIP_CLKSRC_A = 0,
  247. /** Clock and Frame sync Source B */
  248. CSL_TSIP_CLKSRC_B = 1
  249. } CSL_TsipClkSrc;
  250. /**
  251. @} */
  252. /**
  253. * @defgroup CSL_TSIP_CLKP_ENUM Data Clock Polarity
  254. * @ingroup CSL_TSIP_ENUM
  255. *
  256. * @brief Clock Polarity.... rising/falling
  257. *
  258. * Use this symbol to represent data/fsync clock polarity
  259. * @{ */
  260. typedef enum {
  261. /** Rising Polarity */
  262. CSL_TSIP_CLKP_RISING = 0,
  263. /** Falling Polarity */
  264. CSL_TSIP_CLKP_FALLING = 1
  265. } CSL_TsipClkp;
  266. /**
  267. @} */
  268. /**
  269. * @defgroup CSL_TSIP_ENDIAN_ENUM Endian Selection
  270. * @ingroup CSL_TSIP_ENUM
  271. *
  272. * @brief Endian Selection.... Little/Big
  273. *
  274. * Use this symbol to represent the endianness
  275. * @{ */
  276. typedef enum {
  277. /** Little Endian */
  278. CSL_TSIP_ENDIAN_LITTLE = 0,
  279. /** Big Endian */
  280. CSL_TSIP_ENDIAN_BIG = 1
  281. } CSL_TsipEndian;
  282. /**
  283. @} */
  284. /**
  285. * @defgroup CSL_TSIP_FSYNCP_ENUM Frame Sync Polarity
  286. * @ingroup CSL_TSIP_ENUM
  287. *
  288. * @brief TSIP Frame Sync Polarity
  289. *
  290. * Use this symbol to represent Frame Sync Polarity
  291. * This symbol is used on both RCV and XMT
  292. * @{ */
  293. typedef enum {
  294. /** Active Low */
  295. CSL_TSIP_FSYNCP_ALOW = 0,
  296. /** Active High */
  297. CSL_TSIP_FSYNCP_AHIGH = 1
  298. } CSL_TsipFsyncp;
  299. /**
  300. @} */
  301. /**
  302. * @defgroup CSL_TSIP_DLY_ENUM Output Enanble Delay
  303. * @ingroup CSL_TSIP_ENUM
  304. *
  305. * @brief TSIP Output Enanble Delay
  306. *
  307. * Use this symbol to represent Output Enanble Delay
  308. * This symbol is used on both RCV and XMT
  309. * @{ */
  310. typedef enum {
  311. /** No Added Delay */
  312. CSL_TSIP_DLY_CTRL_DISABLE = 0,
  313. /** Active High */
  314. CSL_TSIP_DLY_CTRL_ENABLE = 1
  315. } CSL_TsipDlyCtrl;
  316. /**
  317. @} */
  318. /**
  319. * @defgroup CSL_TSIP_INT_ENUM Interrupt selection
  320. * @ingroup CSL_TSIP_ENUM
  321. *
  322. * @brief TSIP Interrupt selection
  323. *
  324. * Use this symbol to set the interrupt selection time
  325. * This symbol could be used for both RCV and XMT
  326. * @{ */
  327. typedef enum {
  328. /** Interrupt on Acknowledgement */
  329. CSL_TSIP_INT_ACK = 0,
  330. /** Interrupt on Delay */
  331. CSL_TSIP_INT_DLY = 1,
  332. /** Interrupt on either Acknowledgement or Delay */
  333. CSL_TSIP_INT_ACKORDLY = 2,
  334. /** Interrupt on both Acknowledgement and Delay */
  335. CSL_TSIP_INT_ACKNDLY = 3
  336. } CSL_TsipInt;
  337. /**
  338. @} */
  339. /**
  340. * @defgroup CSL_TSIP_XMTDIS_ENUM Transmit Output Disable
  341. * @ingroup CSL_TSIP_ENUM
  342. *
  343. * @brief Transmit Output Disable State
  344. *
  345. * Use this symbol to represent the transmit output disable state
  346. * @{ */
  347. typedef enum {
  348. /** High Impedence */
  349. CSL_TSIP_XMTDIS_HIGHIMP = 0,
  350. /** Driven Low */
  351. CSL_TSIP_XMTDIS_LOW = 2,
  352. /** Driven HIGH */
  353. CSL_TSIP_XMTDIS_HIGH = 3
  354. } CSL_TsipXmtDis;
  355. /**
  356. @} */
  357. /**
  358. * @defgroup CSL_TSIP_CLKD_ENUM Clock Mode
  359. * @ingroup CSL_TSIP_ENUM
  360. *
  361. * @brief Clock Redundancy selection source
  362. *
  363. * Use this symbol to set the CLKD for redundancy clock selection
  364. * @{ */
  365. typedef enum {
  366. /** Redundant Clock Mode */
  367. CSL_TSIP_CLKD_REDUN = 0,
  368. /** Dual Clock Mode */
  369. CSL_TSIP_CLKD_DUAL = 1
  370. } CSL_TsipClkd;
  371. /**
  372. @} */
  373. /**
  374. * @defgroup CSL_TSIP_CHST_ENUM Channel Active Status
  375. * @ingroup CSL_TSIP_ENUM
  376. *
  377. * @brief Channel Status: inactive or a config or b config
  378. *
  379. * Use this symbol to represent the Channel Status
  380. * @{ */
  381. typedef enum {
  382. /** Channel is Inactive */
  383. CSL_TSIP_CHST_INACTIVE = 0,
  384. /** A Config/Bitmap is used */
  385. CSL_TSIP_CHST_AACTIVE = 1,
  386. /** B Config/Bitmap is used */
  387. CSL_TSIP_CHST_BACTIVE = 2
  388. } CSL_TsipChst;
  389. /**
  390. @} */
  391. /**
  392. * @defgroup CSL_TSIP_EMU_ENUM Emulation mode setting
  393. * @ingroup CSL_TSIP_ENUM
  394. *
  395. * @brief Emulation mode setting
  396. *
  397. * Use this symbol to set the Emulation Mode
  398. * @{ */
  399. typedef enum {
  400. /** Emulation mode stop */
  401. CSL_TSIP_EMU_STOP = 0,
  402. /** Emulation mode TX stop */
  403. CSL_TSIP_EMU_TX_STOP = 1,
  404. /** Emulation free run mode */
  405. CSL_TSIP_EMU_FREERUN = 2
  406. } CSL_TsipEmu;
  407. /**
  408. @} */
  409. /** @addtogroup CSL_TSIP_DATASTRUCT
  410. @{ */
  411. /** @brief This is the handle to the TSIP instance */
  412. typedef volatile CSL_TsipRegs* CSL_TsipHandle;
  413. /**
  414. @}
  415. */
  416. /* Device specific API which opens the TSIP instance and returns a handle used in all subsequent calls */
  417. extern CSL_TsipHandle CSL_tsipOpen (Int32 instNum);
  418. #ifdef __cplusplus
  419. }
  420. #endif
  421. #endif