sct_001.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * @brief State Configurable Timer registers and control functions
  3. *
  4. * @note
  5. * Copyright(C) NXP Semiconductors, 2012
  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 licensor 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_001_H_
  32. #define __SCT_001_H_
  33. #include "sys_config.h"
  34. #include "cmsis.h"
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. /** @defgroup IP_SCT_001 IP: SCT register block and driver
  39. * @ingroup IP_Drivers
  40. * State Configurable Timer
  41. * @{
  42. */
  43. #define CONFIG_SCT_nEV (16) /* Number of events */
  44. #define CONFIG_SCT_nRG (16) /* Number of match/compare registers */
  45. #define CONFIG_SCT_nOU (16) /* Number of outputs */
  46. /**
  47. * @brief State Configurable Timer register block structure
  48. */
  49. typedef struct
  50. {
  51. __IO uint32_t CONFIG; /* Configuration Register */
  52. union {
  53. __IO uint32_t CTRL_U; /* Control Register */
  54. struct {
  55. __IO uint16_t CTRL_L; /* low control register */
  56. __IO uint16_t CTRL_H; /* high control register */
  57. };
  58. };
  59. __IO uint16_t LIMIT_L; /* limit register for counter L */
  60. __IO uint16_t LIMIT_H; /* limit register for counter H */
  61. __IO uint16_t HALT_L; /* halt register for counter L */
  62. __IO uint16_t HALT_H; /* halt register for counter H */
  63. __IO uint16_t STOP_L; /* stop register for counter L */
  64. __IO uint16_t STOP_H; /* stop register for counter H */
  65. __IO uint16_t START_L; /* start register for counter L */
  66. __IO uint16_t START_H; /* start register for counter H */
  67. uint32_t RESERVED1[10]; /* 0x03C reserved */
  68. union {
  69. __IO uint32_t COUNT_U; /* counter register */
  70. struct {
  71. __IO uint16_t COUNT_L; /* counter register for counter L */
  72. __IO uint16_t COUNT_H; /* counter register for counter H */
  73. };
  74. };
  75. __IO uint16_t STATE_L; /* state register for counter L */
  76. __IO uint16_t STATE_H; /* state register for counter H */
  77. __I uint32_t INPUT; /* input register */
  78. __IO uint16_t REGMODE_L; /* match - capture registers mode register L */
  79. __IO uint16_t REGMODE_H; /* match - capture registers mode register H */
  80. __IO uint32_t OUTPUT; /* output register */
  81. __IO uint32_t OUTPUTDIRCTRL; /* output counter direction Control Register */
  82. __IO uint32_t RES; /* conflict resolution register */
  83. __IO uint32_t DMA0REQUEST; /* DMA0 Request Register */
  84. __IO uint32_t DMA1REQUEST; /* DMA1 Request Register */
  85. uint32_t RESERVED2[35];
  86. __IO uint32_t EVEN; /* event enable register */
  87. __IO uint32_t EVFLAG; /* event flag register */
  88. __IO uint32_t CONEN; /* conflict enable register */
  89. __IO uint32_t CONFLAG; /* conflict flag register */
  90. union {
  91. __IO union { /* ... Match / Capture value */
  92. uint32_t U; /* SCTMATCH[i].U Unified 32-bit register */
  93. struct {
  94. uint16_t L; /* SCTMATCH[i].L Access to L value */
  95. uint16_t H; /* SCTMATCH[i].H Access to H value */
  96. };
  97. } MATCH[CONFIG_SCT_nRG];
  98. __I union {
  99. uint32_t U; /* SCTCAP[i].U Unified 32-bit register */
  100. struct {
  101. uint16_t L; /* SCTCAP[i].L Access to H value */
  102. uint16_t H; /* SCTCAP[i].H Access to H value */
  103. };
  104. } CAP[CONFIG_SCT_nRG];
  105. };
  106. uint32_t RESERVED3[32-CONFIG_SCT_nRG]; /* ...-0x17C reserved */
  107. union {
  108. __IO uint16_t MATCH_L[CONFIG_SCT_nRG]; /* 0x180-... Match Value L counter */
  109. __I uint16_t CAP_L[CONFIG_SCT_nRG]; /* 0x180-... Capture Value L counter */
  110. };
  111. uint16_t RESERVED4[32-CONFIG_SCT_nRG]; /* ...-0x1BE reserved */
  112. union {
  113. __IO uint16_t MATCH_H[CONFIG_SCT_nRG]; /* 0x1C0-... Match Value H counter */
  114. __I uint16_t CAP_H[CONFIG_SCT_nRG]; /* 0x1C0-... Capture Value H counter */
  115. };
  116. uint16_t RESERVED5[32-CONFIG_SCT_nRG]; /* ...-0x1FE reserved */
  117. union {
  118. __IO union { /* 0x200-... Match Reload / Capture Control value */
  119. uint32_t U; /* SCTMATCHREL[i].U Unified 32-bit register */
  120. struct {
  121. uint16_t L; /* SCTMATCHREL[i].L Access to L value */
  122. uint16_t H; /* SCTMATCHREL[i].H Access to H value */
  123. };
  124. } MATCHREL[CONFIG_SCT_nRG];
  125. __IO union {
  126. uint32_t U; /* SCTCAPCTRL[i].U Unified 32-bit register */
  127. struct {
  128. uint16_t L; /* SCTCAPCTRL[i].L Access to H value */
  129. uint16_t H; /* SCTCAPCTRL[i].H Access to H value */
  130. };
  131. } CAPCTRL[CONFIG_SCT_nRG];
  132. };
  133. uint32_t RESERVED6[32-CONFIG_SCT_nRG]; /* ...-0x27C reserved */
  134. union {
  135. __IO uint16_t MATCHREL_L[CONFIG_SCT_nRG]; /* 0x280-... Match Reload value L counter */
  136. __IO uint16_t CAPCTRL_L[CONFIG_SCT_nRG]; /* 0x280-... Capture Control value L counter */
  137. };
  138. uint16_t RESERVED7[32-CONFIG_SCT_nRG]; /* ...-0x2BE reserved */
  139. union {
  140. __IO uint16_t MATCHREL_H[CONFIG_SCT_nRG]; /* 0x2C0-... Match Reload value H counter */
  141. __IO uint16_t CAPCTRL_H[CONFIG_SCT_nRG]; /* 0x2C0-... Capture Control value H counter */
  142. };
  143. uint16_t RESERVED8[32-CONFIG_SCT_nRG]; /* ...-0x2FE reserved */
  144. __IO struct { /* 0x300-0x3FC SCTEVENT[i].STATE / SCTEVENT[i].CTRL*/
  145. uint32_t STATE; /* Event State Register */
  146. uint32_t CTRL; /* Event Control Register */
  147. } EVENT[CONFIG_SCT_nEV];
  148. uint32_t RESERVED9[128-2*CONFIG_SCT_nEV]; /* ...-0x4FC reserved */
  149. __IO struct { /* 0x500-0x57C SCTOUT[i].SET / SCTOUT[i].CLR */
  150. uint32_t SET; /* Output n Set Register */
  151. uint32_t CLR; /* Output n Clear Register */
  152. } OUT[CONFIG_SCT_nOU];
  153. uint32_t RESERVED10[191-2*CONFIG_SCT_nOU]; /* ...-0x7F8 reserved */
  154. __I uint32_t MODULECONTENT; /* 0x7FC Module Content */
  155. } IP_SCT_001_Type;
  156. /**
  157. * @}
  158. */
  159. #ifdef __cplusplus
  160. }
  161. #endif
  162. #endif /* __SCT_001_H_ */