sct_5410x.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. /*
  2. * @brief LPC5410X State Configurable Timer (SCT) Chip driver
  3. *
  4. * @note
  5. * Copyright(C) NXP Semiconductors, 2014
  6. * All rights reserved.
  7. *
  8. * @par
  9. * Software that is described herein is for illustrative purposes only
  10. * which provides customers with programming information regarding the
  11. * LPC products. This software is supplied "AS IS" without any warranties of
  12. * any kind, and NXP Semiconductors and its licenser disclaim any and
  13. * all warranties, express or implied, including all implied warranties of
  14. * merchantability, fitness for a particular purpose and non-infringement of
  15. * intellectual property rights. NXP Semiconductors assumes no responsibility
  16. * or liability for the use of the software, conveys no license or rights under any
  17. * patent, copyright, mask work right, or any other intellectual property rights in
  18. * or to any products. NXP Semiconductors reserves the right to make changes
  19. * in the software without notification. NXP Semiconductors also makes no
  20. * representation or warranty that such application will be suitable for the
  21. * specified use without further testing or modification.
  22. *
  23. * @par
  24. * Permission to use, copy, modify, and distribute this software and its
  25. * documentation is hereby granted, under NXP Semiconductors' and its
  26. * licensor's relevant copyrights in the software, without fee, provided that it
  27. * is used in conjunction with NXP Semiconductors microcontrollers. This
  28. * copyright, permission, and disclaimer notice must appear in all copies of
  29. * this code.
  30. */
  31. #ifndef __SCT_5410X_H_
  32. #define __SCT_5410X_H_
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /** @defgroup SCT_5410X CHIP: LPC5410X State Configurable Timer driver
  37. * @ingroup CHIP_5410X_DRIVERS
  38. * @{
  39. */
  40. /* match/cap registers, events, states, inputs, outputs
  41. *
  42. * @brief SCT Module configuration
  43. */
  44. #define CONFIG_SCT_nEV (13) /*!< Number of events */
  45. #define CONFIG_SCT_nRG (13) /*!< Number of match/compare registers */
  46. #define CONFIG_SCT_nOU (8) /*!< Number of outputs */
  47. #define CONFIG_SCT_nIN (8) /*!< Number of outputs */
  48. /**
  49. * @brief State Configurable Timer register block structure
  50. */
  51. typedef struct {
  52. __IO uint32_t CONFIG; /*!< Configuration Register */
  53. union {
  54. __IO uint32_t CTRL_U; /*!< Control Register */
  55. struct {
  56. __IO uint16_t CTRL_L; /*!< Low control register */
  57. __IO uint16_t CTRL_H; /*!< High control register */
  58. };
  59. };
  60. __IO uint16_t LIMIT_L; /*!< limit register for counter L */
  61. __IO uint16_t LIMIT_H; /*!< limit register for counter H */
  62. __IO uint16_t HALT_L; /*!< halt register for counter L */
  63. __IO uint16_t HALT_H; /*!< halt register for counter H */
  64. __IO uint16_t STOP_L; /*!< stop register for counter L */
  65. __IO uint16_t STOP_H; /*!< stop register for counter H */
  66. __IO uint16_t START_L; /*!< start register for counter L */
  67. __IO uint16_t START_H; /*!< start register for counter H */
  68. uint32_t RESERVED1[10]; /*!< 0x03C reserved */
  69. union {
  70. __IO uint32_t COUNT_U; /*!< counter register */
  71. struct {
  72. __IO uint16_t COUNT_L; /*!< counter register for counter L */
  73. __IO uint16_t COUNT_H; /*!< counter register for counter H */
  74. };
  75. };
  76. __IO uint16_t STATE_L; /*!< state register for counter L */
  77. __IO uint16_t STATE_H; /*!< state register for counter H */
  78. __I uint32_t INPUT; /*!< input register */
  79. __IO uint16_t REGMODE_L; /*!< match - capture registers mode register L */
  80. __IO uint16_t REGMODE_H; /*!< match - capture registers mode register H */
  81. __IO uint32_t OUTPUT; /*!< output register */
  82. __IO uint32_t OUTPUTDIRCTRL; /*!< output counter direction Control Register */
  83. __IO uint32_t RES; /*!< conflict resolution register */
  84. __IO uint32_t DMA0REQUEST; /*!< DMA0 Request Register */
  85. __IO uint32_t DMA1REQUEST; /*!< DMA1 Request Register */
  86. uint32_t RESERVED2[35];
  87. __IO uint32_t EVEN; /*!< event enable register */
  88. __IO uint32_t EVFLAG; /*!< event flag register */
  89. __IO uint32_t CONEN; /*!< conflict enable register */
  90. __IO uint32_t CONFLAG; /*!< conflict flag register */
  91. union {
  92. __IO union { /*!< ... Match / Capture value */
  93. uint32_t U; /*!< SCTMATCH[i].U Unified 32-bit register */
  94. struct {
  95. uint16_t L; /*!< SCTMATCH[i].L Access to L value */
  96. uint16_t H; /*!< SCTMATCH[i].H Access to H value */
  97. };
  98. } MATCH[CONFIG_SCT_nRG];
  99. __I union {
  100. uint32_t U; /*!< SCTCAP[i].U Unified 32-bit register */
  101. struct {
  102. uint16_t L; /*!< SCTCAP[i].L Access to L value */
  103. uint16_t H; /*!< SCTCAP[i].H Access to H value */
  104. };
  105. } CAP[CONFIG_SCT_nRG];
  106. };
  107. uint32_t RESERVED3[48 + (16 - CONFIG_SCT_nRG)];
  108. union {
  109. __IO union { /* 0x200-... Match Reload / Capture Control value */
  110. uint32_t U; /* SCTMATCHREL[i].U Unified 32-bit register */
  111. struct {
  112. uint16_t L; /* SCTMATCHREL[i].L Access to L value */
  113. uint16_t H; /* SCTMATCHREL[i].H Access to H value */
  114. };
  115. } MATCHREL[CONFIG_SCT_nRG];
  116. __IO union {
  117. uint32_t U; /* SCTCAPCTRL[i].U Unified 32-bit register */
  118. struct {
  119. uint16_t L; /* SCTCAPCTRL[i].L Access to H value */
  120. uint16_t H; /* SCTCAPCTRL[i].H Access to H value */
  121. };
  122. } CAPCTRL[CONFIG_SCT_nRG];
  123. };
  124. uint32_t RESERVED6[48 + (16 - CONFIG_SCT_nRG)];
  125. __IO struct { /* 0x300-0x3FC SCTEVENT[i].STATE / SCTEVENT[i].CTRL*/
  126. uint32_t STATE; /* Event State Register */
  127. uint32_t CTRL; /* Event Control Register */
  128. } EVENT[CONFIG_SCT_nEV];
  129. uint32_t RESERVED9[128 - 2 * CONFIG_SCT_nEV]; /*!< ...-0x4FC reserved */
  130. __IO struct { /*!< 0x500-0x57C SCTOUT[i].SET / SCTOUT[i].CLR */
  131. uint32_t SET; /*!< Output n Set Register */
  132. uint32_t CLR; /*!< Output n Clear Register */
  133. } OUT[CONFIG_SCT_nOU];
  134. uint32_t RESERVED10[191 - 2 * CONFIG_SCT_nOU]; /*!< ...-0x7F8 reserved */
  135. __I uint32_t MODULECONTENT; /*!< 0x7FC Module Content */
  136. } LPC_SCT_T;
  137. /**
  138. * @brief Macro defines for SCT configuration register
  139. */
  140. #define SCT_CONFIG_16BIT_COUNTER 0x00000000 /*!< Operate as 2 16-bit counters */
  141. #define SCT_CONFIG_32BIT_COUNTER 0x00000001 /*!< Operate as 1 32-bit counter */
  142. #define SCT_CONFIG_CLKMODE_BUSCLK (0x0 << 1) /*!< Bus clock */
  143. #define SCT_CONFIG_CLKMODE_SCTCLK (0x1 << 1) /*!< SCT clock */
  144. #define SCT_CONFIG_CLKMODE_INCLK (0x2 << 1) /*!< Input clock selected in CLKSEL field */
  145. #define SCT_CONFIG_CLKMODE_INEDGECLK (0x3 << 1) /*!< Input clock edge selected in CLKSEL field */
  146. #define SCT_CONFIG_CLKMODE_SYSCLK (0x0 << 1) /*!< System clock */
  147. #define SCT_CONFIG_CLKMODE_PRESCALED_SYSCLK (0x1 << 1) /*!< Prescaled system clock */
  148. #define SCT_CONFIG_CLKMODE_SCT_INPUT (0x2 << 1) /*!< Input clock/edge selected in CKSEL field */
  149. #define SCT_CONFIG_CLKMODE_PRESCALED_SCT_INPUT (0x3 << 1) /*!< Prescaled input clock/edge selected in CKSEL field */
  150. #define SCT_CONFIG_CKSEL_RISING_IN_0 (0x0UL << 3)
  151. #define SCT_CONFIG_CKSEL_FALLING_IN_0 (0x1UL << 3)
  152. #define SCT_CONFIG_CKSEL_RISING_IN_1 (0x2UL << 3)
  153. #define SCT_CONFIG_CKSEL_FALLING_IN_1 (0x3UL << 3)
  154. #define SCT_CONFIG_CKSEL_RISING_IN_2 (0x4UL << 3)
  155. #define SCT_CONFIG_CKSEL_FALLING_IN_2 (0x5UL << 3)
  156. #define SCT_CONFIG_CKSEL_RISING_IN_3 (0x6UL << 3)
  157. #define SCT_CONFIG_CKSEL_FALLING_IN_3 (0x7UL << 3)
  158. #define SCT_CONFIG_CKSEL_RISING_IN_4 (0x8UL << 3)
  159. #define SCT_CONFIG_CKSEL_FALLING_IN_4 (0x9UL << 3)
  160. #define SCT_CONFIG_CKSEL_RISING_IN_5 (0xAUL << 3)
  161. #define SCT_CONFIG_CKSEL_FALLING_IN_5 (0xBUL << 3)
  162. #define SCT_CONFIG_CKSEL_RISING_IN_6 (0xCUL << 3)
  163. #define SCT_CONFIG_CKSEL_FALLING_IN_6 (0xDUL << 3)
  164. #define SCT_CONFIG_CKSEL_RISING_IN_7 (0xEUL << 3)
  165. #define SCT_CONFIG_CKSEL_FALLING_IN_7 (0xFUL << 3)
  166. #define SCT_CONFIG_NORELOADL_U (0x1 << 7) /*!< Operate as 1 32-bit counter */
  167. #define SCT_CONFIG_NORELOADH (0x1 << 8) /*!< Operate as 1 32-bit counter */
  168. #define SCT_CONFIG_AUTOLIMIT_U (0x1UL << 17)
  169. #define SCT_CONFIG_AUTOLIMIT_L (0x1UL << 17)
  170. #define SCT_CONFIG_AUTOLIMIT_H (0x1UL << 18)
  171. /**
  172. * @brief Macro defines for SCT control register
  173. */
  174. #define COUNTUP_TO_LIMIT_THEN_CLEAR_TO_ZERO 0 /*!< Direction for low or unified counter */
  175. #define COUNTUP_TO LIMIT_THEN_COUNTDOWN_TO_ZERO 1
  176. #define SCT_CTRL_STOP_L (1 << 1) /*!< Stop low counter */
  177. #define SCT_CTRL_HALT_L (1 << 2) /*!< Halt low counter */
  178. #define SCT_CTRL_CLRCTR_L (1 << 3) /*!< Clear low or unified counter */
  179. #define SCT_CTRL_BIDIR_L(x) (((x) & 0x01) << 4) /*!< Bidirectional bit */
  180. #define SCT_CTRL_PRE_L(x) (((x) & 0xFF) << 5) /*!< Prescale clock for low or unified counter */
  181. #define COUNTUP_TO_LIMIT_THEN_CLEAR_TO_ZERO 0 /*!< Direction for high counter */
  182. #define COUNTUP_TO LIMIT_THEN_COUNTDOWN_TO_ZERO 1
  183. #define SCT_CTRL_STOP_H (1 << 17) /*!< Stop high counter */
  184. #define SCT_CTRL_HALT_H (1 << 18) /*!< Halt high counter */
  185. #define SCT_CTRL_CLRCTR_H (1 << 19) /*!< Clear high counter */
  186. #define SCT_CTRL_BIDIR_H(x) (((x) & 0x01) << 20)
  187. #define SCT_CTRL_PRE_H(x) (((x) & 0xFF) << 21) /*!< Prescale clock for high counter */
  188. #define SCT_EV_CTRL_MATCHSEL(reg) (reg << 0)
  189. #define SCT_EV_CTRL_HEVENT_L (0UL << 4)
  190. #define SCT_EV_CTRL_HEVENT_H (1UL << 4)
  191. #define SCT_EV_CTRL_OUTSEL_INPUT (0UL << 5)
  192. #define SCT_EV_CTRL_OUTSEL_OUTPUT (0UL << 5)
  193. #define SCT_EV_CTRL_IOSEL(signal) (signal << 6)
  194. #define SCT_EV_CTRL_IOCOND_LOW (0UL << 10)
  195. #define SCT_EV_CTRL_IOCOND_RISE (0x1UL << 10)
  196. #define SCT_EV_CTRL_IOCOND_FALL (0x2UL << 10)
  197. #define SCT_EV_CTRL_IOCOND_HIGH (0x3UL << 10)
  198. #define SCT_EV_CTRL_COMBMODE_OR (0x0UL << 12)
  199. #define SCT_EV_CTRL_COMBMODE_MATCH (0x1UL << 12)
  200. #define SCT_EV_CTRL_COMBMODE_IO (0x2UL << 12)
  201. #define SCT_EV_CTRL_COMBMODE_AND (0x3UL << 12)
  202. #define SCT_EV_CTRL_STATELD (0x1UL << 14)
  203. #define SCT_EV_CTRL_STATEV(x) (x << 15)
  204. #define SCT_EV_CTRL_MATCHMEM (0x1UL << 20)
  205. #define SCT_EV_CTRL_DIRECTION_INDEPENDENT (0x0UL << 21)
  206. #define SCT_EV_CTRL_DIRECTION_UP (0x1UL << 21)
  207. #define SCT_EV_CTRL_DIRECTION_DOWN (0x2UL << 21)
  208. /**
  209. * @brief Macro defines for SCT Conflict resolution register
  210. */
  211. #define SCT_RES_NOCHANGE (0)
  212. #define SCT_RES_SET_OUTPUT (1)
  213. #define SCT_RES_CLEAR_OUTPUT (2)
  214. #define SCT_RES_TOGGLE_OUTPUT (3)
  215. /**
  216. * SCT Match register values enum
  217. */
  218. typedef enum CHIP_SCT_MATCH_REG {
  219. SCT_MATCH_0 = 0, /*!< SCT Match register 0 */
  220. SCT_MATCH_1,
  221. SCT_MATCH_2,
  222. SCT_MATCH_3,
  223. SCT_MATCH_4,
  224. SCT_MATCH_5,
  225. SCT_MATCH_6,
  226. SCT_MATCH_7,
  227. SCT_MATCH_8,
  228. SCT_MATCH_9,
  229. SCT_MATCH_10,
  230. SCT_MATCH_11,
  231. SCT_MATCH_12,
  232. SCT_MATCH_13,
  233. SCT_MATCH_14,
  234. SCT_MATCH_15
  235. } CHIP_SCT_MATCH_REG_T;
  236. /**
  237. * SCT Event values enum
  238. */
  239. typedef enum CHIP_SCT_EVENT {
  240. SCT_EVT_0 = (1 << 0), /*!< Event 0 */
  241. SCT_EVT_1 = (1 << 1), /*!< Event 1 */
  242. SCT_EVT_2 = (1 << 2), /*!< Event 2 */
  243. SCT_EVT_3 = (1 << 3), /*!< Event 3 */
  244. SCT_EVT_4 = (1 << 4), /*!< Event 4 */
  245. SCT_EVT_5 = (1 << 5), /*!< Event 5 */
  246. SCT_EVT_6 = (1 << 6), /*!< Event 6 */
  247. SCT_EVT_7 = (1 << 7), /*!< Event 7 */
  248. SCT_EVT_8 = (1 << 8), /*!< Event 8 */
  249. SCT_EVT_9 = (1 << 9), /*!< Event 9 */
  250. SCT_EVT_10 = (1 << 10), /*!< Event 10 */
  251. SCT_EVT_11 = (1 << 11), /*!< Event 11 */
  252. SCT_EVT_12 = (1 << 12), /*!< Event 12 */
  253. SCT_EVT_13 = (1 << 13), /*!< Event 13 */
  254. SCT_EVT_14 = (1 << 14), /*!< Event 14 */
  255. SCT_EVT_15 = (1 << 15) /*!< Event 15 */
  256. } CHIP_SCT_EVENT_T;
  257. /**
  258. * @brief Set event control register
  259. * @param pSCT : The base of SCT peripheral on the chip
  260. * @param event_number
  261. * @param value : The 32-bit event control setting
  262. * @return Nothing
  263. */
  264. STATIC INLINE void Chip_SCT_EventControl(LPC_SCT_T *pSCT, uint32_t event_number,
  265. uint32_t value) {
  266. pSCT->EVENT[event_number].CTRL = value;
  267. }
  268. /**
  269. * @brief Set event state mask register
  270. * @param pSCT : The base of SCT peripheral on the chip
  271. * @param event_number
  272. * @param event_state_mask : The 32-bit event state mask setting
  273. * @return Nothing
  274. */
  275. STATIC INLINE void Chip_SCT_EventStateMask(LPC_SCT_T *pSCT, uint32_t event_number,
  276. uint32_t event_state_mask) {
  277. pSCT->EVENT[event_number].STATE = event_state_mask;
  278. }
  279. /**
  280. * @brief Set configuration register
  281. * @param pSCT : The base of SCT peripheral on the chip
  282. * @param cfg : The 32-bit configuration setting
  283. * @return Nothing
  284. */
  285. STATIC INLINE void Chip_SCT_Config(LPC_SCT_T *pSCT, uint32_t cfg) {
  286. pSCT->CONFIG = cfg;
  287. }
  288. /**
  289. * @brief Configures the Limit register
  290. * @param pSCT : The base of SCT peripheral on the chip
  291. * @param value : The 32-bit Limit register value
  292. * @return Nothing
  293. */
  294. STATIC INLINE void Chip_SCT_Limit(LPC_SCT_T *pSCT, uint32_t value) {
  295. pSCT->LIMIT_L = value;
  296. }
  297. /**
  298. * @brief Set or Clear the Control register
  299. * @param pSCT : Pointer to SCT register block
  300. * @param value : SCT Control register value
  301. * @param ena : ENABLE - To set the fields specified by value
  302. * : DISABLE - To clear the field specified by value
  303. * @return Nothing
  304. * Set or clear the control register bits as specified by the \a value
  305. * parameter. If \a ena is set to ENABLE, the mentioned register fields
  306. * will be set. If \a ena is set to DISABLE, the mentioned register
  307. * fields will be cleared
  308. */
  309. void Chip_SCT_SetClrControl(LPC_SCT_T *pSCT, uint32_t value, FunctionalState ena);
  310. /**
  311. * @brief Set the conflict resolution
  312. * @param pSCT : Pointer to SCT register block
  313. * @param outnum : Output number
  314. * @param value : Output value
  315. * - SCT_RES_NOCHANGE :No change
  316. * - SCT_RES_SET_OUTPUT :Set output
  317. * - SCT_RES_CLEAR_OUTPUT :Clear output
  318. * - SCT_RES_TOGGLE_OUTPUT :Toggle output
  319. * : SCT_RES_NOCHANGE
  320. * : DISABLE - To clear the field specified by value
  321. * @return Nothing
  322. * Set conflict resolution for the output \a outnum
  323. */
  324. void Chip_SCT_SetConflictResolution(LPC_SCT_T *pSCT, uint8_t outnum, uint8_t value);
  325. /**
  326. * @brief Set unified count value in State Configurable Timer
  327. * @param pSCT : The base of SCT peripheral on the chip
  328. * @param count : The 32-bit count value
  329. * @return Nothing
  330. */
  331. STATIC INLINE void Chip_SCT_SetCount(LPC_SCT_T *pSCT, uint32_t count) {
  332. pSCT->COUNT_U = count;
  333. }
  334. /**
  335. * @brief Set lower count value in State Configurable Timer
  336. * @param pSCT : The base of SCT peripheral on the chip
  337. * @param count : The 16-bit count value
  338. * @return Nothing
  339. */
  340. STATIC INLINE void Chip_SCT_SetCountL(LPC_SCT_T *pSCT, uint16_t count) {
  341. pSCT->COUNT_L = count;
  342. }
  343. /**
  344. * @brief Set higher count value in State Configurable Timer
  345. * @param pSCT : The base of SCT peripheral on the chip
  346. * @param count : The 16-bit count value
  347. * @return Nothing
  348. */
  349. STATIC INLINE void Chip_SCT_SetCountH(LPC_SCT_T *pSCT, uint16_t count) {
  350. pSCT->COUNT_H = count;
  351. }
  352. /**
  353. * @brief Set unified match count value in State Configurable Timer
  354. * @param pSCT : The base of SCT peripheral on the chip
  355. * @param n : Match register value
  356. * @param value : The 32-bit match count value
  357. * @return Nothing
  358. */
  359. STATIC INLINE void Chip_SCT_SetMatchCount(LPC_SCT_T *pSCT, CHIP_SCT_MATCH_REG_T n, uint32_t value) {
  360. pSCT->MATCH[n].U = value;
  361. }
  362. /**
  363. * @brief Set unified match reload count value in State Configurable Timer
  364. * @param pSCT : The base of SCT peripheral on the chip
  365. * @param n : Match register value
  366. * @param value : The 32-bit match count reload value
  367. * @return Nothing
  368. */
  369. STATIC INLINE void Chip_SCT_SetMatchReload(LPC_SCT_T *pSCT, CHIP_SCT_MATCH_REG_T n, uint32_t value) {
  370. pSCT->MATCHREL[n].U = value;
  371. }
  372. /**
  373. * @brief Enable the interrupt for the specified event in State Configurable Timer
  374. * @param pSCT : The base of SCT peripheral on the chip
  375. * @param evt : Event value
  376. * @return Nothing
  377. */
  378. STATIC INLINE void Chip_SCT_EnableEventInt(LPC_SCT_T *pSCT, CHIP_SCT_EVENT_T evt) {
  379. pSCT->EVEN |= evt;
  380. }
  381. /**
  382. * @brief Disable the interrupt for the specified event in State Configurable Timer
  383. * @param pSCT : The base of SCT peripheral on the chip
  384. * @param evt : Event value
  385. * @return Nothing
  386. */
  387. STATIC INLINE void Chip_SCT_DisableEventInt(LPC_SCT_T *pSCT, CHIP_SCT_EVENT_T evt) {
  388. pSCT->EVEN &= ~(evt);
  389. }
  390. /**
  391. * @brief Clear the specified event flag in State Configurable Timer
  392. * @param pSCT : The base of SCT peripheral on the chip
  393. * @param evt : Event value
  394. * @return Nothing
  395. */
  396. STATIC INLINE void Chip_SCT_ClearEventFlag(LPC_SCT_T *pSCT, CHIP_SCT_EVENT_T evt) {
  397. pSCT->EVFLAG |= evt;
  398. }
  399. /**
  400. * @brief Set control register in State Configurable Timer
  401. * @param pSCT : The base of SCT peripheral on the chip
  402. * @param value : Value (ORed value of SCT_CTRL_* bits)
  403. * @return Nothing
  404. */
  405. STATIC INLINE void Chip_SCT_SetControl(LPC_SCT_T *pSCT, uint32_t value) {
  406. pSCT->CTRL_U |= value;
  407. }
  408. /**
  409. * @brief Clear control register in State Configurable Timer
  410. * @param pSCT : The base of SCT peripheral on the chip
  411. * @param value : Value (ORed value of SCT_CTRL_* bits)
  412. * @return Nothing
  413. */
  414. STATIC INLINE void Chip_SCT_ClearControl(LPC_SCT_T *pSCT, uint32_t value) {
  415. pSCT->CTRL_U &= ~(value);
  416. }
  417. /**
  418. * @brief Initializes the State Configurable Timer
  419. * @param pSCT : The base of SCT peripheral on the chip
  420. * @return Nothing
  421. */
  422. void Chip_SCT_Init(LPC_SCT_T *pSCT);
  423. /**
  424. * @brief Deinitializes the State Configurable Timer
  425. * @param pSCT : The base of SCT peripheral on the chip
  426. * @return Nothing
  427. */
  428. void Chip_SCT_DeInit(LPC_SCT_T *pSCT);
  429. /**
  430. * @}
  431. */
  432. #ifdef __cplusplus
  433. }
  434. #endif
  435. #endif /* __SCT_5410X_H_ */