csl_wdtAux.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. /**
  2. * @file csl_wdtAux.h
  3. *
  4. * @brief
  5. * This is the WDT Auxilary Header File which exposes the various
  6. * CSL Functional Layer API's to configure the WDT Module.
  7. *
  8. * \par
  9. * ============================================================================
  10. * @n (C) Copyright 2002-2011, 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. #ifndef CSL_WDTAUX_H_
  42. #define CSL_WDTAUX_H_
  43. #include <ti/csl/csl_wdt.h>
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /******************************************************************************\
  48. * global macro declarations
  49. \******************************************************************************/
  50. /** @addtogroup CSL_WDTAUX_ENUM
  51. @{ */
  52. /**
  53. @}
  54. */
  55. /** @addtogroup CSL_WDTAUX_FUNCTION
  56. @{ */
  57. /** ============================================================================
  58. * @n@b CSL_wdtGetRevision
  59. *
  60. * @b Description
  61. * @n This API shall enable the user to read the revision number of WDT.
  62. *
  63. * @b Arguments
  64. @verbatim
  65. hWdt The handle of the WDT module.
  66. @endverbatim
  67. *
  68. * <b> Return Value </b>
  69. * @n None
  70. *
  71. * <b> Pre Condition </b>
  72. * @n None
  73. *
  74. * <b> Post Condition </b>
  75. * @n None
  76. *
  77. * @b Example
  78. * @verbatim
  79. CSL_wdtGetRevision(hWdt); // Enable the MMU
  80. @endverbatim
  81. * =============================================================================
  82. */
  83. static inline Uint32 CSL_wdtGetRevision(CSL_wdtHandle hWdt)
  84. {
  85. /* Read the Revision number. */
  86. return(hWdt->WIDR);
  87. }
  88. /** ============================================================================
  89. * @n@b CSL_wdtReset
  90. *
  91. * @b Description
  92. * @n This API shall perform a soft reset of the WDT.
  93. *
  94. * @b Arguments
  95. @verbatim
  96. hWdt The handle of the WDT module.
  97. @endverbatim
  98. *
  99. * <b> Return Value </b>
  100. * @n None
  101. *
  102. * <b> Pre Condition </b>
  103. * @n None
  104. *
  105. * <b> Post Condition </b>
  106. * @n None
  107. *
  108. * @b Example
  109. * @verbatim
  110. CSL_wdtReset(hWdt); // Enable the MMU
  111. @endverbatim
  112. * =============================================================================
  113. */
  114. static inline void CSL_wdtReset(CSL_wdtHandle hWdt)
  115. {
  116. /* Reset the WDT module. */
  117. CSL_FINS(hWdt->WDSC, WDT_WDSC_SOFTRESET, 0x1U);
  118. /* Wait until the reset is done */
  119. while(1U != (hWdt->WDST & 0x1U));
  120. }
  121. /** ============================================================================
  122. * @n@b CSL_wdtEnable
  123. *
  124. * @b Description
  125. * @n This API shall enable(start)/disable(stop) the WDT.
  126. *
  127. * @b Arguments
  128. @verbatim
  129. hWdt The handle of the WDT module.
  130. @endverbatim
  131. *
  132. * <b> Return Value </b>
  133. * @n None
  134. *
  135. * <b> Pre Condition </b>
  136. * @n None
  137. *
  138. * <b> Post Condition </b>
  139. * @n None
  140. *
  141. * @b Example
  142. * @verbatim
  143. CSL_wdtEnable(hWdt, enableWdt); // Enable the MMU
  144. @endverbatim
  145. * =============================================================================
  146. */
  147. static inline void CSL_wdtEnable(CSL_wdtHandle hWdt, Uint32 enableWdt)
  148. {
  149. /* Wait for previous write to complete. */
  150. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WSPR);
  151. if (TRUE == enableWdt)
  152. {
  153. /* Enable the WDT module. Sequence 1 is initiated. */
  154. CSL_FINS(hWdt->WSPR, WDT_WSPR_WSPR_VALUE, CSL_WDT_ENABLE_SEQ1);
  155. /* Wait for previous write to complete. */
  156. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WSPR);
  157. /* Enable the WDT module. Sequence 2 is initiated. */
  158. CSL_FINS(hWdt->WSPR, WDT_WSPR_WSPR_VALUE, CSL_WDT_ENABLE_SEQ2);
  159. }
  160. else
  161. {
  162. /* Disable the WDT module. Sequence 1 is initiated. */
  163. CSL_FINS(hWdt->WSPR, WDT_WSPR_WSPR_VALUE, CSL_WDT_DISABLE_SEQ1);
  164. /* Wait for previous write to complete. */
  165. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WSPR);
  166. /* Disable the WDT module. Sequence 2 is initiated. */
  167. CSL_FINS(hWdt->WSPR, WDT_WSPR_WSPR_VALUE, CSL_WDT_DISABLE_SEQ2);
  168. }
  169. }
  170. /** ============================================================================
  171. * @n@b CSL_wdtPrescalerClkEnable
  172. *
  173. * @b Description
  174. * @n This API shall enable and configure the WDT prescaler clock value.
  175. *
  176. * @b Arguments
  177. @verbatim
  178. hWdt The handle of the WDT module.
  179. @endverbatim
  180. *
  181. * <b> Return Value </b>
  182. * @n None
  183. *
  184. * <b> Pre Condition </b>
  185. * @n None
  186. *
  187. * <b> Post Condition </b>
  188. * @n None
  189. *
  190. * @b Example
  191. * @verbatim
  192. CSL_wdtPrescalerClkEnable(hWdt, prescaler); // Enable the MMU
  193. @endverbatim
  194. * =============================================================================
  195. */
  196. static inline void CSL_wdtPrescalerClkEnable(CSL_wdtHandle hWdt, Uint32 prescaler)
  197. {
  198. /* Wait for previous write to complete. */
  199. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WCLR);
  200. /* Enable the prescaler for WDT. */
  201. CSL_FINS(hWdt->WCLR, WDT_WCLR_PRE, 0x1U);
  202. /* Wait for previous write to complete. */
  203. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WCLR);
  204. /* Configure the prescaler value. */
  205. CSL_FINS(hWdt->WCLR, WDT_WCLR_PTV, prescaler);
  206. }
  207. /** ============================================================================
  208. * @n@b CSL_wdtPrescalerClkDisable
  209. *
  210. * @b Description
  211. * @n This API shall disable the WDT prescaler clock.
  212. *
  213. * @b Arguments
  214. @verbatim
  215. hWdt The handle of the WDT module.
  216. @endverbatim
  217. *
  218. * <b> Return Value </b>
  219. * @n None
  220. *
  221. * <b> Pre Condition </b>
  222. * @n None
  223. *
  224. * <b> Post Condition </b>
  225. * @n None
  226. *
  227. * @b Example
  228. * @verbatim
  229. CSL_wdtPrescalerClkDisable(hWdt); // Enable the MMU
  230. @endverbatim
  231. * =============================================================================
  232. */
  233. static inline void CSL_wdtPrescalerClkDisable(CSL_wdtHandle hWdt)
  234. {
  235. /* Wait for previous write to complete. */
  236. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WCLR);
  237. /* Disable the prescaler for WDT. */
  238. CSL_FINS(hWdt->WCLR, WDT_WCLR_PRE, 0x0U);
  239. }
  240. /** ============================================================================
  241. * @n@b CSL_wdtSetCounter
  242. *
  243. * @b Description
  244. * @n Set the WDT counter value. When the WDT is started/enabled
  245. the count will start from the current value present in the
  246. counter. This API shall program the counter value.
  247. *
  248. * @b Arguments
  249. @verbatim
  250. hWdt The handle of the WDT module.
  251. @endverbatim
  252. *
  253. * <b> Return Value </b>
  254. * @n None
  255. *
  256. * <b> Pre Condition </b>
  257. * @n None
  258. *
  259. * <b> Post Condition </b>
  260. * @n None
  261. *
  262. * @b Example
  263. * @verbatim
  264. CSL_wdtSetCounter(hWdt, cntrVal); // Enable the MMU
  265. @endverbatim
  266. * =============================================================================
  267. */
  268. static inline void CSL_wdtSetCounter(CSL_wdtHandle hWdt, Uint32 cntrVal)
  269. {
  270. /* Wait for previous write to complete. */
  271. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WCRR);
  272. /* Program the WDT counter value. */
  273. hWdt->WCRR = cntrVal;
  274. }
  275. /** ============================================================================
  276. * @n@b CSL_wdtGetCounter
  277. *
  278. * @b Description
  279. * @n This function sets the WDT reload value.
  280. *
  281. * @b Arguments
  282. @verbatim
  283. hWdt The handle of the WDT module.
  284. @endverbatim
  285. *
  286. * <b> Return Value </b>
  287. * @n None
  288. *
  289. * <b> Pre Condition </b>
  290. * @n None
  291. *
  292. * <b> Post Condition </b>
  293. * @n None
  294. *
  295. * @b Example
  296. * @verbatim
  297. CSL_wdtGetCounter(hWdt); // Set the WDT reload value.
  298. @endverbatim
  299. * =============================================================================
  300. */
  301. static inline Uint32 CSL_wdtGetCounter(CSL_wdtHandle hWdt)
  302. {
  303. /* Read the WDT counter value. */
  304. return(hWdt->WCRR);
  305. }
  306. /** ============================================================================
  307. * @n@b CSL_wdtSetReloadVal
  308. *
  309. * @b Description
  310. * @n This function is used to enable the MMU.
  311. *
  312. * @b Arguments
  313. @verbatim
  314. hWdt The handle of the WDT module.
  315. reloadVal WDT reload value.
  316. @endverbatim
  317. *
  318. * <b> Return Value </b>
  319. * @n None
  320. *
  321. * <b> Pre Condition </b>
  322. * @n None
  323. *
  324. * <b> Post Condition </b>
  325. * @n None
  326. *
  327. * @b Example
  328. * @verbatim
  329. CSL_wdtSetReloadVal(hWdt, reloadVal); // Enable the MMU
  330. @endverbatim
  331. * =============================================================================
  332. */
  333. static inline void CSL_wdtSetReloadVal(CSL_wdtHandle hWdt, Uint32 reloadVal)
  334. {
  335. /* Wait for previous write to complete. */
  336. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WLDR);
  337. /* Program the WDT counter value. */
  338. hWdt->WLDR = reloadVal;
  339. }
  340. /** ============================================================================
  341. * @n@b CSL_wdtGetReloadVal
  342. *
  343. * @b Description
  344. * @n This API shall enable the user to read the WDT reload value.
  345. *
  346. * @b Arguments
  347. @verbatim
  348. hWdt The handle of the WDT module.
  349. @endverbatim
  350. *
  351. * <b> Return Value </b>
  352. * @n None
  353. *
  354. * <b> Pre Condition </b>
  355. * @n None
  356. *
  357. * <b> Post Condition </b>
  358. * @n None
  359. *
  360. * @b Example
  361. * @verbatim
  362. CSL_wdtGetReloadVal(hWdt); // Read the WDT reload value
  363. @endverbatim
  364. * =============================================================================
  365. */
  366. static inline Uint32 CSL_WDTGetReloadVal(CSL_wdtHandle hWdt)
  367. {
  368. /* Read the WDT reload value. */
  369. return(hWdt->WLDR);
  370. }
  371. /** ============================================================================
  372. * @n@b CSL_wdtTriggerReload
  373. *
  374. * @b Description
  375. * @n This API enables the trigger feature of WDT.
  376. *
  377. * @b Arguments
  378. @verbatim
  379. hWdt The handle of the WDT module.
  380. trigVal Trigger value to be programmed.
  381. @endverbatim
  382. *
  383. * <b> Return Value </b>
  384. * @n None
  385. *
  386. * <b> Pre Condition </b>
  387. * @n None
  388. *
  389. * <b> Post Condition </b>
  390. * @n None
  391. *
  392. * @b Example
  393. * @verbatim
  394. CSL_wdtTriggerReload(hWdt, trigVal); // Enable trigger
  395. @endverbatim
  396. * =============================================================================
  397. */
  398. static inline void CSL_wdtTriggerReload(CSL_wdtHandle hWdt, Uint32 trigVal)
  399. {
  400. /* Wait for previous write to complete. */
  401. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WTGR);
  402. /* Program the WDT trigger register. */
  403. hWdt->WTGR = trigVal;
  404. }
  405. /** ============================================================================
  406. * @n@b CSL_wdtSetDelayVal
  407. *
  408. * @b Description
  409. * @n This API sets the WDT delay value.
  410. *
  411. * @b Arguments
  412. @verbatim
  413. hWdt The handle of the WDT module.
  414. delayVal Delay value to be programmed.
  415. @endverbatim
  416. *
  417. * <b> Return Value </b>
  418. * @n None
  419. *
  420. * <b> Pre Condition </b>
  421. * @n None
  422. *
  423. * <b> Post Condition </b>
  424. * @n None
  425. *
  426. * @b Example
  427. * @verbatim
  428. CSL_wdtSetDelayVal(hWdt, delayVal); // Sets the WDT delay value
  429. @endverbatim
  430. * =============================================================================
  431. */
  432. static inline void CSL_wdtSetDelayVal(CSL_wdtHandle hWdt, Uint32 delayVal)
  433. {
  434. /* Wait for previous write to complete. */
  435. CSL_WDT_WAIT_FOR_WRITE(CSL_WDT_WRITE_POST_WDLY);
  436. /* Program the WDT delay register. */
  437. hWdt->WDLY = delayVal;
  438. }
  439. /** ============================================================================
  440. * @n@b CSL_wdtGetDelayVal
  441. *
  442. * @b Description
  443. * @n This API shall enable the user to read the Delay value.
  444. *
  445. * @b Arguments
  446. @verbatim
  447. hWdt The handle of the WDT module.
  448. @endverbatim
  449. *
  450. * <b> Return Value </b>
  451. * @n None
  452. *
  453. * <b> Pre Condition </b>
  454. * @n None
  455. *
  456. * <b> Post Condition </b>
  457. * @n None
  458. *
  459. * @b Example
  460. * @verbatim
  461. CSL_wdtGetDelayVal(hWdt); // Read the Delay value
  462. @endverbatim
  463. * =============================================================================
  464. */
  465. static inline Uint32 CSL_wdtGetDelayVal(CSL_wdtHandle hWdt)
  466. {
  467. /* Read the WDT delay register value. */
  468. return(hWdt->WDLY);
  469. }
  470. /** ============================================================================
  471. * @n@b CSL_wdtIntrTrigger
  472. *
  473. * @b Description
  474. * @n This API triggers an interrupt request for the specified event.
  475. *
  476. * @b Arguments
  477. @verbatim
  478. hWdt The handle of the WDT module.
  479. intrMask Interrupts to be triggered. intrMask will contain
  480. values from the following enum.
  481. -#CSL_wdtIntrMask
  482. @endverbatim
  483. *
  484. * <b> Return Value </b>
  485. * @n None
  486. *
  487. * <b> Pre Condition </b>
  488. * @n None
  489. *
  490. * <b> Post Condition </b>
  491. * @n None
  492. *
  493. * @b Example
  494. * @verbatim
  495. CSL_wdtIntrTrigger(hWdt, intrMask); // Triggers an interrupt request
  496. @endverbatim
  497. * =============================================================================
  498. */
  499. static inline void CSL_wdtIntrTrigger(CSL_wdtHandle hWdt,
  500. CSL_wdtIntrMask intrMask)
  501. {
  502. /* Trigger the raw interrupt. */
  503. hWdt->WIRQSTATRAW = intrMask;
  504. }
  505. /** ============================================================================
  506. * @n@b CSL_wdtIntrRawStatus
  507. *
  508. * @b Description
  509. * @n This API reads the raw interrupt status of WDT.
  510. *
  511. * @b Arguments
  512. @verbatim
  513. hWdt The handle of the WDT module.
  514. @endverbatim
  515. *
  516. * <b> Return Value </b>
  517. * @n None
  518. *
  519. * <b> Pre Condition </b>
  520. * @n None
  521. *
  522. * <b> Post Condition </b>
  523. * @n None
  524. *
  525. * @b Example
  526. * @verbatim
  527. CSL_wdtIntrRawStatus(hWdt); // Reads the raw interrupt status
  528. @endverbatim
  529. * =============================================================================
  530. */
  531. static inline Uint32 CSL_wdtIntrRawStatus(CSL_wdtHandle hWdt)
  532. {
  533. /* Read the interrupt raw status. */
  534. return(hWdt->WIRQSTATRAW);
  535. }
  536. /** ============================================================================
  537. * @n@b CSL_wdtIntrStatus
  538. *
  539. * @b Description
  540. * @n This API reads the interrupt status of WDT.
  541. *
  542. * @b Arguments
  543. @verbatim
  544. hWdt The handle of the WDT module.
  545. @endverbatim
  546. *
  547. * <b> Return Value </b>
  548. * @n None
  549. *
  550. * <b> Pre Condition </b>
  551. * @n None
  552. *
  553. * <b> Post Condition </b>
  554. * @n None
  555. *
  556. * @b Example
  557. * @verbatim
  558. CSL_wdtIntrStatus(hWdt); // Reads the raw interrupt status
  559. @endverbatim
  560. * =============================================================================
  561. */
  562. static inline Uint32 CSL_wdtIntrStatus(CSL_wdtHandle hWdt)
  563. {
  564. /* Read the interrupt status. */
  565. return(hWdt->WISR);
  566. }
  567. /** ============================================================================
  568. * @n@b CSL_wdtIntrClear
  569. *
  570. * @b Description
  571. * @n This API clears the WDT interrupts.
  572. *
  573. * @b Arguments
  574. @verbatim
  575. hWdt The handle of the WDT module.
  576. intrMask Interrupts to be triggered. intrMask will contain
  577. values from the following enum.
  578. -#CSL_wdtIntrMask
  579. @endverbatim
  580. *
  581. * <b> Return Value </b>
  582. * @n None
  583. *
  584. * <b> Pre Condition </b>
  585. * @n None
  586. *
  587. * <b> Post Condition </b>
  588. * @n None
  589. *
  590. * @b Example
  591. * @verbatim
  592. CSL_wdtIntrClear(hWdt, intrMask); // Clear interrupt status
  593. @endverbatim
  594. * =============================================================================
  595. */
  596. static inline void CSL_wdtIntrClear(CSL_wdtHandle hWdt,
  597. CSL_wdtIntrMask intrMask)
  598. {
  599. /* Clear the interrupt status. */
  600. hWdt->WIRQSTAT = intrMask;
  601. }
  602. /** ============================================================================
  603. * @n@b CSL_wdtIntrEnable
  604. *
  605. * @b Description
  606. * @n This API enables the WDT interrupts.
  607. *
  608. * @b Arguments
  609. @verbatim
  610. hWdt The handle of the WDT module.
  611. intrMask Interrupts to be triggered. intrMask will contain
  612. values from the following enum.
  613. -#CSL_wdtIntrMask
  614. @endverbatim
  615. *
  616. * <b> Return Value </b>
  617. * @n None
  618. *
  619. * <b> Pre Condition </b>
  620. * @n None
  621. *
  622. * <b> Post Condition </b>
  623. * @n None
  624. *
  625. * @b Example
  626. * @verbatim
  627. CSL_wdtIntrEnable(hWdt, intrMask); // Enable interrupt
  628. @endverbatim
  629. * =============================================================================
  630. */
  631. static inline void CSL_wdtIntrEnable(CSL_wdtHandle hWdt,
  632. CSL_wdtIntrMask intrMask)
  633. {
  634. /* Enable the WDT interrupts. */
  635. hWdt->WIRQENSET = intrMask;
  636. }
  637. /** ============================================================================
  638. * @n@b CSL_wdtIntrDisable
  639. *
  640. * @b Description
  641. * @n This API disables the WDT interrupts.
  642. *
  643. * @b Arguments
  644. @verbatim
  645. hWdt The handle of the WDT module.
  646. intrMask Interrupts to be triggered. intrMask will contain
  647. values from the following enum.
  648. -#CSL_wdtIntrMask
  649. @endverbatim
  650. *
  651. * <b> Return Value </b>
  652. * @n None
  653. *
  654. * <b> Pre Condition </b>
  655. * @n None
  656. *
  657. * <b> Post Condition </b>
  658. * @n None
  659. *
  660. * @b Example
  661. * @verbatim
  662. CSL_wdtIntrDisable(hWdt, intrMask); // Disable interrupt
  663. @endverbatim
  664. * =============================================================================
  665. */
  666. static inline void CSL_wdtIntrDisable(CSL_wdtHandle hWdt,
  667. CSL_wdtIntrMask intrMask)
  668. {
  669. /* Disable the WDT interrupts. */
  670. hWdt->WIRQENCLR = intrMask;
  671. }
  672. /** ============================================================================
  673. * @n@b CSL_wdtSetIdleMode
  674. *
  675. * @b Description
  676. * @n This API configures one of the idle modes.
  677. *
  678. * @b Arguments
  679. @verbatim
  680. hWdt The handle of the WDT module.
  681. idleMode Value to determine idle mode selection idleMode can
  682. take macros from the following enum
  683. - #CSL_wdtIdleMode
  684. @endverbatim
  685. *
  686. * <b> Return Value </b>
  687. * @n None
  688. *
  689. * <b> Pre Condition </b>
  690. * @n None
  691. *
  692. * <b> Post Condition </b>
  693. * @n None
  694. *
  695. * @b Example
  696. * @verbatim
  697. CSL_wdtSetIdleMode(hWdt, idleMode); // Configure idle mode
  698. @endverbatim
  699. * =============================================================================
  700. */
  701. static inline void CSL_wdtSetIdleMode(CSL_wdtHandle hWdt,
  702. CSL_wdtIdleMode idleMode)
  703. {
  704. /* Configure the Idle mode of WDT. */
  705. CSL_FINS(hWdt->WDSC, WDT_WDSC_IDLEMODE, idleMode);
  706. }
  707. /** ============================================================================
  708. * @n@b CSL_wdtEmuModeEnable
  709. *
  710. * @b Description
  711. * @n This API enable/disable emulation mode of WDT.
  712. *
  713. * @b Arguments
  714. @verbatim
  715. hWdt The handle of the WDT module.
  716. enableEmuMode Enable/disable the emulation mode.
  717. enableEmuMode will take the following values.
  718. -# TRUE - Enable emulation mode.
  719. -# FALSE - Disable emulation mode.
  720. @endverbatim
  721. *
  722. * <b> Return Value </b>
  723. * @n None
  724. *
  725. * <b> Pre Condition </b>
  726. * @n None
  727. *
  728. * <b> Post Condition </b>
  729. * @n None
  730. *
  731. * @b Example
  732. * @verbatim
  733. CSL_wdtEmuModeEnable(hWdt, enableEmuMode); // Enable/Disable emulation
  734. @endverbatim
  735. * =============================================================================
  736. */
  737. static inline void CSL_wdtEmuModeEnable(CSL_wdtHandle hWdt, Uint32 enableEmuMode)
  738. {
  739. if (TRUE == enableEmuMode)
  740. {
  741. /* Counter is frozen during emulation. */
  742. CSL_FINS(hWdt->WDSC, WDT_WDSC_EMUFREE, 0x0U);
  743. }
  744. else
  745. {
  746. /* Counter is free running during emulation. */
  747. CSL_FINS(hWdt->WDSC, WDT_WDSC_EMUFREE, 0x1U);
  748. }
  749. }
  750. /**
  751. @}
  752. */
  753. #ifdef __cplusplus
  754. }
  755. #endif
  756. #endif /*CSL_WDTAUX_H_*/