F2837xD_Mcbsp.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_McBSP.c
  4. //
  5. // TITLE: F2837xD Device McBSP Initialization & Support Functions.
  6. //
  7. //###########################################################################
  8. // $TI Release: F2837xD Support Library v3.05.00.00 $
  9. // $Release Date: Tue Jun 26 03:15:23 CDT 2018 $
  10. // $Copyright:
  11. // Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/
  12. //
  13. // Redistribution and use in source and binary forms, with or without
  14. // modification, are permitted provided that the following conditions
  15. // are met:
  16. //
  17. // Redistributions of source code must retain the above copyright
  18. // notice, this list of conditions and the following disclaimer.
  19. //
  20. // Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the
  23. // distribution.
  24. //
  25. // Neither the name of Texas Instruments Incorporated nor the names of
  26. // its contributors may be used to endorse or promote products derived
  27. // from this software without specific prior written permission.
  28. //
  29. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  30. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  31. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  32. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  33. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  34. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  35. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  36. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  37. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. // $
  41. //###########################################################################
  42. //
  43. // Included Files
  44. //
  45. #include "F2837xD_device.h"
  46. #include "F2837xD_Examples.h"
  47. //
  48. // MCBSP_INIT_DELAY determines the amount of CPU cycles in the 2 sample rate
  49. // generator (SRG) cycles required for the Mcbsp initialization routine.
  50. // MCBSP_CLKG_DELAY determines the amount of CPU cycles in the 2 clock
  51. // generator (CLKG) cycles required for the Mcbsp initialization routine.
  52. //
  53. //
  54. // Defines
  55. //
  56. #define CPU_SPD 200E6
  57. #define MCBSP_SRG_FREQ CPU_SPD/4 // SRG input is LSPCLK (SYSCLKOUT/4)
  58. // for examples
  59. #define CLKGDV_VAL 1
  60. // # of CPU cycles in 2 SRG cycles-init delay
  61. #define MCBSP_INIT_DELAY 2*(CPU_SPD/MCBSP_SRG_FREQ)
  62. // # of CPU cycles in 2 CLKG cycles-init delay
  63. #define MCBSP_CLKG_DELAY 2*(CPU_SPD/(MCBSP_SRG_FREQ/(1+CLKGDV_VAL)))
  64. //
  65. // Function Prototypes
  66. //
  67. void delay_loop(void); // Delay function used for SRG initialization
  68. void clkg_delay_loop(void); // Delay function used for CLKG initialization
  69. //
  70. // InitMcbsp - This function initializes the McBSP to a known state.
  71. //
  72. void InitMcbspa(void)
  73. {
  74. //
  75. // Reset the McBSP
  76. // Disable all interrupts
  77. // Frame sync generator reset
  78. // Sample rate generator reset
  79. // Transmitter reset
  80. // Receiver reset
  81. //
  82. McbspaRegs.SPCR2.bit.FRST = 0;
  83. McbspaRegs.SPCR2.bit.GRST = 0;
  84. McbspaRegs.SPCR2.bit.XRST = 0;
  85. McbspaRegs.SPCR1.bit.RRST = 0;
  86. //
  87. // Enable loop back mode
  88. // This does not require external hardware
  89. //
  90. McbspaRegs.SPCR2.all = 0x0000;
  91. McbspaRegs.SPCR1.all = 0x8000;
  92. //
  93. // RX data delay is 1 bit
  94. // TX data delay is 1 bit
  95. //
  96. McbspaRegs.RCR2.bit.RDATDLY = 1;
  97. McbspaRegs.XCR2.bit.XDATDLY = 1;
  98. //
  99. // No clock sync for CLKG
  100. // Frame-synchronization period
  101. //
  102. McbspaRegs.SRGR2.bit.GSYNC = 0;
  103. McbspaRegs.SRGR2.bit.FPER = 320;
  104. //
  105. // Frame-synchronization pulses from
  106. // the sample rate generator
  107. //
  108. McbspaRegs.SRGR2.bit.FSGM = 1;
  109. //
  110. // Sample rate generator input clock is LSPCLK
  111. //
  112. McbspaRegs.SRGR2.bit.CLKSM = 1;
  113. McbspaRegs.PCR.bit.SCLKME = 0;
  114. //
  115. // Divide-down value for CLKG
  116. // Frame-synchronization pulse width
  117. //
  118. McbspaRegs.SRGR1.bit.CLKGDV = CLKGDV_VAL;
  119. clkg_delay_loop();
  120. McbspaRegs.SRGR1.bit.FWID = 1;
  121. //
  122. // CLKX is driven by the sample rate generator
  123. // Transmit frame synchronization generated by internal
  124. // sample rate generator
  125. //
  126. McbspaRegs.PCR.bit.CLKXM = 1;
  127. McbspaRegs.PCR.bit.FSXM = 1;
  128. //
  129. // Enable Sample rate generator and
  130. // wait at least 2 CLKG clock cycles
  131. //
  132. McbspaRegs.SPCR2.bit.GRST = 1;
  133. clkg_delay_loop();
  134. //
  135. // Release from reset
  136. // RX, TX and frame sync generator
  137. //
  138. McbspaRegs.SPCR2.bit.XRST = 1;
  139. McbspaRegs.SPCR1.bit.RRST = 1;
  140. McbspaRegs.SPCR2.bit.FRST = 1;
  141. }
  142. //
  143. // InitMcbspaInt - Enable TX and RX interrupts
  144. //
  145. void InitMcbspaInt(void)
  146. {
  147. // Reset TX and RX
  148. // Enable interrupts for TX and RX
  149. // Release TX and RX
  150. McbspaRegs.SPCR2.bit.XRST = 0;
  151. McbspaRegs.SPCR1.bit.RRST = 0;
  152. McbspaRegs.MFFINT.bit.XINT = 1;
  153. McbspaRegs.MFFINT.bit.RINT = 1;
  154. McbspaRegs.SPCR2.bit.XRST = 1;
  155. McbspaRegs.SPCR1.bit.RRST = 1;
  156. }
  157. //
  158. // InitMcbspa8bit - McBSP uses an 8-bit word for both TX and RX
  159. //
  160. void InitMcbspa8bit(void)
  161. {
  162. McbspaRegs.RCR1.bit.RWDLEN1 = 0;
  163. McbspaRegs.XCR1.bit.XWDLEN1 = 0;
  164. }
  165. //
  166. // InitMcbspa12bit - McBSP uses an 12-bit word for both TX and RX
  167. //
  168. void InitMcbspa12bit(void)
  169. {
  170. McbspaRegs.RCR1.bit.RWDLEN1 = 1;
  171. McbspaRegs.XCR1.bit.XWDLEN1 = 1;
  172. }
  173. //
  174. // InitMcbspa16bit - McBSP uses an 16-bit word for both TX and RX
  175. //
  176. void InitMcbspa16bit(void)
  177. {
  178. McbspaRegs.RCR1.bit.RWDLEN1 = 2;
  179. McbspaRegs.XCR1.bit.XWDLEN1 = 2;
  180. }
  181. //
  182. // InitMcbspa20bit - McBSP uses an 20-bit word for both TX and RX
  183. //
  184. void InitMcbspa20bit(void)
  185. {
  186. McbspaRegs.RCR1.bit.RWDLEN1 = 3;
  187. McbspaRegs.XCR1.bit.XWDLEN1 = 3;
  188. }
  189. //
  190. // InitMcbspa24bit - McBSP uses an 24-bit word for both TX and RX
  191. //
  192. void InitMcbspa24bit(void)
  193. {
  194. McbspaRegs.RCR1.bit.RWDLEN1 = 4;
  195. McbspaRegs.XCR1.bit.XWDLEN1 = 4;
  196. }
  197. //
  198. // InitMcbspa32bit - McBSP uses an 32-bit word for both TX and RX
  199. //
  200. void InitMcbspa32bit(void)
  201. {
  202. McbspaRegs.RCR1.bit.RWDLEN1 = 5;
  203. McbspaRegs.XCR1.bit.XWDLEN1 = 5;
  204. }
  205. //
  206. // InitMcbspaGpio - Assign GPIO pins to the McBSP peripheral
  207. // (Note: This function must be called from CPU1.)
  208. //
  209. void InitMcbspaGpio(void)
  210. {
  211. #ifdef CPU1
  212. EALLOW;
  213. //
  214. // This specifies which of the possible GPIO pins will be
  215. // McBSPA functional pins. Comment out unwanted connections.
  216. // Set qualification for selected input pins to asynchronous only
  217. // This will select asynchronous (no qualification) for the selected pins.
  218. //
  219. //
  220. // MDXA
  221. // GPIO20
  222. // GPIO84
  223. //
  224. GpioCtrlRegs.GPAMUX2.bit.GPIO20 = 2;
  225. //GpioCtrlRegs.GPCGMUX2.bit.GPIO84 = 3;
  226. //GpioCtrlRegs.GPCMUX2.bit.GPIO84 = 3;
  227. //
  228. // MDRA
  229. // GPIO21 with asynchronous qualification
  230. // GPIO85 with asynchronous qualification
  231. //
  232. GpioCtrlRegs.GPAMUX2.bit.GPIO21 = 2;
  233. GpioCtrlRegs.GPAQSEL2.bit.GPIO21 = 3;
  234. //GpioCtrlRegs.GPCGMUX2.bit.GPIO85 = 3;
  235. //GpioCtrlRegs.GPCMUX2.bit.GPIO85 = 3;
  236. //GpioCtrlRegs.GPCQSEL2.bit.GPIO85 = 3;
  237. //
  238. // MCLKXA
  239. // GPIO22 with asynchronous qualification
  240. // GPIO86 with asynchronous qualification
  241. //
  242. GpioCtrlRegs.GPAMUX2.bit.GPIO22 = 2;
  243. //GpioCtrlRegs.GPAQSEL2.bit.GPIO22 = 3;
  244. //GpioCtrlRegs.GPCGMUX2.bit.GPIO86 = 3;
  245. //GpioCtrlRegs.GPCMUX2.bit.GPIO86 = 3;
  246. //GpioCtrlRegs.GPCQSEL2.bit.GPIO86 = 3;
  247. //
  248. // MCLKRA
  249. // Select one of the following
  250. // GPIO7 with asynchronous qualification
  251. // GPIO58 with asynchronous qualification
  252. //
  253. GpioCtrlRegs.GPAMUX1.bit.GPIO7 = 2;
  254. GpioCtrlRegs.GPAQSEL1.bit.GPIO7 = 3;
  255. //GpioCtrlRegs.GPBMUX2.bit.GPIO58 = 1;
  256. //GpioCtrlRegs.GPBQSEL2.bit.GPIO58 = 3;
  257. //
  258. // MFSXA
  259. // GPIO23 with asynchronous qualification
  260. // GPIO87 with asynchronous qualification
  261. //
  262. GpioCtrlRegs.GPAMUX2.bit.GPIO23 = 2;
  263. //GpioCtrlRegs.GPAQSEL2.bit.GPIO23 = 3;
  264. //GpioCtrlRegs.GPCGMUX2.bit.GPIO87 = 3;
  265. //GpioCtrlRegs.GPCMUX2.bit.GPIO87 = 3;
  266. //GpioCtrlRegs.GPCQSEL2.bit.GPIO87 = 3;
  267. //
  268. // MFSRA
  269. // Select one of the following
  270. // GPIO5 with asynchronous qualification
  271. // GPIO59 with asynchronous qualification
  272. //
  273. GpioCtrlRegs.GPAMUX1.bit.GPIO5 = 2;
  274. GpioCtrlRegs.GPAQSEL1.bit.GPIO5 = 3;
  275. //GpioCtrlRegs.GPBMUX2.bit.GPIO59 = 1;
  276. //GpioCtrlRegs.GPBQSEL2.bit.GPIO59 = 3;
  277. EDIS;
  278. #endif
  279. }
  280. //
  281. // InitMcbspb - McBSPB initialization routine for examples
  282. //
  283. void InitMcbspb(void)
  284. {
  285. //
  286. // Reset the McBSP
  287. // Disable all interrupts
  288. // Frame sync generator reset
  289. // Sample rate generator reset
  290. // Transmitter reset
  291. // Receiver reset
  292. //
  293. McbspbRegs.SPCR2.bit.FRST = 0;
  294. McbspbRegs.SPCR2.bit.GRST = 0;
  295. McbspbRegs.SPCR2.bit.XRST = 0;
  296. McbspbRegs.SPCR1.bit.RRST = 0;
  297. //
  298. // Enable loop back mode
  299. // This does not require external hardware
  300. //
  301. McbspbRegs.SPCR2.all = 0x0000;
  302. McbspbRegs.SPCR1.all = 0x8000;
  303. //
  304. // RX data delay is 1 bit
  305. // TX data delay is 1 bit
  306. //
  307. McbspbRegs.RCR2.bit.RDATDLY = 1;
  308. McbspbRegs.XCR2.bit.XDATDLY = 1;
  309. //
  310. // No clock sync for CLKG
  311. // Frame-synchronization period
  312. //
  313. McbspbRegs.SRGR2.bit.GSYNC = 0;
  314. McbspbRegs.SRGR2.bit.FPER = 320;
  315. //
  316. // Frame-synchronization pulses from
  317. // the sample rate generator
  318. //
  319. McbspbRegs.SRGR2.bit.FSGM = 1;
  320. //
  321. // Sample rate generator input clock is LSPCLK
  322. //
  323. McbspbRegs.SRGR2.bit.CLKSM = 1;
  324. McbspbRegs.PCR.bit.SCLKME = 0;
  325. //
  326. // Divide-down value for CLKG
  327. // Frame-synchronization pulse width
  328. //
  329. McbspbRegs.SRGR1.bit.CLKGDV = CLKGDV_VAL;
  330. clkg_delay_loop();
  331. McbspbRegs.SRGR1.bit.FWID = 1;
  332. //
  333. // CLKX is driven by the sample rate generator
  334. // Transmit frame synchronization generated by internal
  335. // sample rate generator
  336. //
  337. McbspbRegs.PCR.bit.CLKXM = 1;
  338. McbspbRegs.PCR.bit.FSXM = 1;
  339. //
  340. // Enable Sample rate generator and
  341. // wait at least 2 CLKG clock cycles
  342. //
  343. McbspbRegs.SPCR2.bit.GRST = 1;
  344. clkg_delay_loop();
  345. //
  346. // Release from reset
  347. // RX, TX and frame sync generator
  348. //
  349. McbspbRegs.SPCR2.bit.XRST = 1;
  350. McbspbRegs.SPCR1.bit.RRST = 1;
  351. McbspbRegs.SPCR2.bit.FRST = 1;
  352. }
  353. //
  354. // InitMcbspbInt - Enable TX and RX interrupts
  355. //
  356. void InitMcbspbInt(void)
  357. {
  358. //
  359. // Reset TX and RX
  360. // Enable interrupts for TX and RX
  361. // Release TX and RX
  362. //
  363. McbspbRegs.SPCR2.bit.XRST = 0;
  364. McbspbRegs.SPCR1.bit.RRST = 0;
  365. McbspbRegs.MFFINT.bit.XINT = 1;
  366. McbspbRegs.MFFINT.bit.RINT = 1;
  367. McbspbRegs.SPCR2.bit.XRST = 1;
  368. McbspbRegs.SPCR1.bit.RRST = 1;
  369. }
  370. //
  371. // InitMcbspb8bit - McBSPB uses an 8-bit word for both TX and RX
  372. //
  373. void InitMcbspb8bit(void)
  374. {
  375. McbspbRegs.RCR1.bit.RWDLEN1 = 0;
  376. McbspbRegs.XCR1.bit.XWDLEN1 = 0;
  377. }
  378. //
  379. // IniMcbspb12bit - McBSPB uses an 12-bit word for both TX and RX
  380. //
  381. void IniMcbspb12bit(void)
  382. {
  383. McbspbRegs.RCR1.bit.RWDLEN1 = 1;
  384. McbspbRegs.XCR1.bit.XWDLEN1 = 1;
  385. }
  386. //
  387. // InitMcbspb16bit - McBSPB uses an 16-bit word for both TX and RX
  388. //
  389. void InitMcbspb16bit(void)
  390. {
  391. McbspbRegs.RCR1.bit.RWDLEN1 = 2;
  392. McbspbRegs.XCR1.bit.XWDLEN1 = 2;
  393. }
  394. //
  395. // InitMcbspb20bit - McBSPB uses an 20-bit word for both TX and RX
  396. //
  397. void InitMcbspb20bit(void)
  398. {
  399. McbspbRegs.RCR1.bit.RWDLEN1 = 3;
  400. McbspbRegs.XCR1.bit.XWDLEN1 = 3;
  401. }
  402. //
  403. // InitMcbspb24bit - McBSPB uses an 24-bit word for both TX and RX
  404. //
  405. void InitMcbspb24bit(void)
  406. {
  407. McbspbRegs.RCR1.bit.RWDLEN1 = 4;
  408. McbspbRegs.XCR1.bit.XWDLEN1 = 4;
  409. }
  410. //
  411. // InitMcbspb32bit - McBSPB uses an 32-bit word for both TX and RX
  412. //
  413. void InitMcbspb32bit(void)
  414. {
  415. McbspbRegs.RCR1.bit.RWDLEN1 = 5;
  416. McbspbRegs.XCR1.bit.XWDLEN1 = 5;
  417. }
  418. //
  419. // InitMcbspbGpio - Assign GPIO pins to the McBSP peripheral
  420. // (Note: This function must be called from CPU1.)
  421. //
  422. void InitMcbspbGpio(void)
  423. {
  424. #ifdef CPU1
  425. EALLOW;
  426. //
  427. // This specifies which of the possible GPIO pins will be
  428. // McBSPB functional pins. Comment out unwanted connections.
  429. // Set qualification for selected input pins to asynchronous only
  430. // This will select asynchronous (no qualification) for the selected pins.
  431. //
  432. //
  433. // Select one of the following for MDXB
  434. // GPIO24
  435. // GPIO84
  436. //
  437. //GpioCtrlRegs.GPAMUX2.bit.GPIO24 = 3;
  438. GpioCtrlRegs.GPCGMUX2.bit.GPIO84 = 1;
  439. GpioCtrlRegs.GPCMUX2.bit.GPIO84 = 2;
  440. //
  441. // MDRB
  442. // GPIO13 with asynchronous qualification
  443. // GPIO25 with asynchronous qualification
  444. // GPIO85 with asynchronous qualification
  445. //
  446. //GpioCtrlRegs.GPAMUX1.bit.GPIO13 = 3;
  447. //GpioCtrlRegs.GPAQSEL1.bit.GPIO13 = 3;
  448. //GpioCtrlRegs.GPAMUX2.bit.GPIO25 = 3;
  449. //GpioCtrlRegs.GPAQSEL2.bit.GPIO25 = 3;
  450. GpioCtrlRegs.GPCGMUX2.bit.GPIO85 = 1;
  451. GpioCtrlRegs.GPCMUX2.bit.GPIO85 = 2;
  452. GpioCtrlRegs.GPCQSEL2.bit.GPIO85 = 3;
  453. //
  454. // MCLKXB
  455. // GPIO14 with asynchronous qualification
  456. // GPIO26 with asynchronous qualification
  457. // GPIO86 with asynchronous qualification
  458. //
  459. //GpioCtrlRegs.GPAMUX1.bit.GPIO14 = 3;
  460. //GpioCtrlRegs.GPAQSEL1.bit.GPIO14 = 3;
  461. //GpioCtrlRegs.GPAMUX2.bit.GPIO26 = 3;
  462. //GpioCtrlRegs.GPAQSEL2.bit.GPIO26 = 3;
  463. GpioCtrlRegs.GPCGMUX2.bit.GPIO86 = 1;
  464. GpioCtrlRegs.GPCMUX2.bit.GPIO86 = 2;
  465. GpioCtrlRegs.GPCQSEL2.bit.GPIO86= 3;
  466. //
  467. // MCLKRB
  468. // Select one of the following
  469. // GPIO3 with asynchronous qualification
  470. // GPIO60 with asynchronous qualification
  471. //
  472. //GpioCtrlRegs.GPAMUX1.bit.GPIO3 = 3;
  473. //GpioCtrlRegs.GPAQSEL1.bit.GPIO3 = 3;
  474. GpioCtrlRegs.GPBMUX2.bit.GPIO60 = 1;
  475. GpioCtrlRegs.GPBQSEL2.bit.GPIO60 = 3;
  476. //
  477. // MFSXB
  478. // GPIO15 with asynchronous qualification
  479. // GPIO27 with asynchronous qualification
  480. // GPIO87 with asynchronous qualification
  481. //
  482. //GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 3;
  483. //GpioCtrlRegs.GPAQSEL1.bit.GPIO15 = 3;
  484. //GpioCtrlRegs.GPAMUX2.bit.GPIO27 = 3;
  485. //GpioCtrlRegs.GPAQSEL2.bit.GPIO27 = 3;
  486. GpioCtrlRegs.GPCGMUX2.bit.GPIO87 = 1;
  487. GpioCtrlRegs.GPCMUX2.bit.GPIO87 = 2;
  488. GpioCtrlRegs.GPCQSEL2.bit.GPIO87= 3;
  489. //
  490. // MFSRB
  491. // Select one of the following
  492. // GPIO1 with asynchronous qualification
  493. // GPIO61 with asynchronous qualification
  494. //
  495. //GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 3;
  496. //GpioCtrlRegs.GPAQSEL1.bit.GPIO1 = 3;
  497. GpioCtrlRegs.GPBMUX2.bit.GPIO61 = 1;
  498. GpioCtrlRegs.GPBQSEL2.bit.GPIO61 = 3;
  499. EDIS;
  500. #endif
  501. }
  502. //
  503. // delay_loop - Delay function (at least 2 SRG cycles)
  504. // Required in McBSP initialization
  505. //
  506. void delay_loop(void)
  507. {
  508. long i;
  509. for (i = 0; i < MCBSP_INIT_DELAY; i++) {}
  510. }
  511. //
  512. // clkg_delay_loop - Delay function (at least 2 CLKG cycles)
  513. // Required in McBSP init
  514. //
  515. void clkg_delay_loop(void)
  516. {
  517. long i;
  518. for (i = 0; i < MCBSP_CLKG_DELAY; i++) {}
  519. }
  520. //
  521. // End of file
  522. //