1
0

reg_eth.h 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. ////////////////////////////////////////////////////////////////////////////////
  2. /// @file reg_iwdg.h
  3. /// @author AE TEAM
  4. /// @brief THIS FILE CONTAINS ALL THE FUNCTIONS PROTOTYPES FOR THE SERIES OF
  5. /// MM32 FIRMWARE LIBRARY.
  6. ////////////////////////////////////////////////////////////////////////////////
  7. /// @attention
  8. ///
  9. /// THE EXISTING FIRMWARE IS ONLY FOR REFERENCE, WHICH IS DESIGNED TO PROVIDE
  10. /// CUSTOMERS WITH CODING INFORMATION ABOUT THEIR PRODUCTS SO THEY CAN SAVE
  11. /// TIME. THEREFORE, MINDMOTION SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT OR
  12. /// CONSEQUENTIAL DAMAGES ABOUT ANY CLAIMS ARISING OUT OF THE CONTENT OF SUCH
  13. /// HARDWARE AND/OR THE USE OF THE CODING INFORMATION CONTAINED HEREIN IN
  14. /// CONNECTION WITH PRODUCTS MADE BY CUSTOMERS.
  15. ///
  16. /// <H2><CENTER>&COPY; COPYRIGHT MINDMOTION </CENTER></H2>
  17. ////////////////////////////////////////////////////////////////////////////////
  18. // Define to prevent recursive inclusion
  19. #ifndef __REG_ETH_H
  20. #define __REG_ETH_H
  21. // Files includes
  22. #include <stdint.h>
  23. #include <stdbool.h>
  24. #include "types.h"
  25. #include "reg_common.h"
  26. #if defined ( __CC_ARM )
  27. #pragma anon_unions
  28. #endif
  29. ////////////////////////////////////////////////////////////////////////////////
  30. /// @brief IWDG Base Address Definition
  31. ////////////////////////////////////////////////////////////////////////////////
  32. #define ETH_BASE (AHBPERIPH_BASE + 0x8000) ///< Base Address: 0x40028000
  33. #define ETH ((ETH_TypeDef*) ETH_BASE)
  34. ////////////////////////////////////////////////////////////////////////////////
  35. /// @brief ETH Register Structure Definition
  36. ////////////////////////////////////////////////////////////////////////////////
  37. typedef struct {
  38. __IO u32 MACCR; ///< configuration register offset 0x0000
  39. __IO u32 MACFFR; ///< frame filter register offset 0x0004
  40. __IO u32 MACHTHR; ///< Hash list high register offset 0x0008
  41. __IO u32 MACHTLR; ///< Hash list low register offset 0x000C
  42. __IO u32 MACMIIAR; ///< MII address register offset 0x0010
  43. __IO u32 MACMIIDR; ///< MII data register offset 0x0014
  44. __IO u32 MACFCR; ///< flow control register offset 0x0018
  45. __IO u32 MACVLANTR; ///< VLAN label register offset 0x001C
  46. __IO u32 RESERVEDX0020[2]; /// 0x0020 ~ 0x0024
  47. __IO u32 MACRWUFFR; /// 0x0028
  48. __IO u32 MACPMTCSR; /// 0x002C
  49. __IO u32 RESERVEDX0030[4]; /// 0x0030 ~ 0x003C
  50. __IO u32 MACA0HR; ///< address 0 high register offset 0x0040
  51. __IO u32 MACA0LR; ///< address 0 low register offset 0x0044
  52. __IO u32 MACA1HR; ///< address 1 high register offset 0x0048
  53. __IO u32 MACA1LR; ///< address 1 low register offset 0x004C
  54. __IO u32 MACA2HR; ///< address 2 high register offset 0x0050
  55. __IO u32 MACA2LR; ///< address 2 low register offset 0x0054
  56. __IO u32 MACA3HR; ///< address 3 high register offset 0x0058
  57. __IO u32 MACA3LR; ///< address 3 low register offset 0x005C
  58. __IO u32 MACA4HR; ///< address 4 high register offset 0x0060
  59. __IO u32 MACA4LR; ///< address 4 low register offset 0x0064
  60. __IO u32 MACA5HR; ///< address 5 high register offset 0x0068
  61. __IO u32 MACA5LR; ///< address 5 low register offset 0x006C
  62. __IO u32 MACA6HR; ///< address 6 high register offset 0x0070
  63. __IO u32 MACA6LR; ///< address 6 low register offset 0x0074
  64. __IO u32 MACA7HR; ///< address 7 high register offset 0x0078
  65. __IO u32 MACA7LR; ///< address 7 low register offset 0x007C
  66. __IO u32 MACA8HR; ///< address 8 high register offset 0x0080
  67. __IO u32 MACA8LR; ///< address 8 low register offset 0x0084
  68. __IO u32 MACA9HR; ///< address 9 high register offset 0x0088
  69. __IO u32 MACA9LR; ///< address 9 low register offset 0x008C
  70. __IO u32 MACA10HR; ///< address 10 high register offset 0x0090
  71. __IO u32 MACA10LR; ///< address 10 low register offset 0x0094
  72. __IO u32 MACA11HR; ///< address 11 high register offset 0x0098
  73. __IO u32 MACA11LR; ///< address 11 low register offset 0x009C
  74. __IO u32 MACA12HR; ///< address 12 high register offset 0x00A0
  75. __IO u32 MACA12LR; ///< address 12 low register offset 0x00A4
  76. __IO u32 MACA13HR; ///< address 13 high register offset 0x00A8
  77. __IO u32 MACA13LR; ///< address 13 low register offset 0x00AC
  78. __IO u32 MACA14HR; ///< address 14 high register offset 0x00B0
  79. __IO u32 MACA14LR; ///< address 14 low register offset 0x00B4
  80. __IO u32 MACA15HR; ///< address 15 high register offset 0x00B8
  81. __IO u32 MACA15LR; ///< address 15 low register offset 0x00BC
  82. __IO u32 MACANCR; ///< Automatic negotiation control register offset 0x00C0
  83. __IO u32 MACANSR; ///< Automatic negotiation of the status register offset 0x00C4
  84. __IO u32 MACANAR; ///< Automatic negotiation of broadcast registers offset 0x00C8
  85. __IO u32 MACANLPAR; ///< Automatic negotiation of link partner capability register offset 0x00CC
  86. __IO u32 MACANER; ///< Automatic negotiation of extension registers offset 0x00D0
  87. __IO u32 MACTBIER; ///< Ten - place interface extension register offset 0x00D4
  88. __IO u32 MACMIISR; ///< MII status register offset 0x00D8
  89. __IO u32 RESERVEDX00DC[9]; ///< offset 0x00DC ~ 0x00FC
  90. __IO u32 MMCCR; ///< MMC controls registers offset 0x0100
  91. __IO u32 MMCRIR; ///< The MMC receives the interrupt register offset 0x0104
  92. __IO u32 MMCTIR; ///< The MMC sends the interrupt register offset 0x0108
  93. __IO u32 MMCRIMR; ///< The MMC receives the interrupt mask register offset 0x010C
  94. __IO u32 MMCTIMR; ///< MMC sends interrupt masking registers offset 0x0110
  95. __IO u32 RESERVEDX0114[14]; ///< offset 0x0114 ~ 0x0148
  96. __IO u32 MMCTGFSCCR; ///< A good frame counter register that MMC sends after a single conflict offset 0x014C
  97. __IO u32 MMCTGFMSCCR; ///< A good frame counter register that MMC sends after multiple collisions offset 0x0150
  98. __IO u32 RESERVEDX0154[5]; ///< offset 0x0154 ~ 0x0164
  99. __IO u32 MMCTGFCR; ///< Good frame counter register sent by MMC offset 0x0168
  100. __IO u32 RESERVEDX016C[10]; ///< offset 0x016C ~ 0x0190
  101. __IO u32 MMCRFCECR; ///< Ethernet MMC with CRC error counter register receives frame register offset 0x0194
  102. __IO u32 MMCRFAECR; ///< Ethernet MMC receives frames with alignment error counter registers offset 0x0198
  103. __IO u32 RESERVEDX019C[10]; ///< offset 0x019C ~ 0x01C0
  104. __IO u32 MMCRGUFCR; ///< Good unicast frame counter register received by MMC offset 0x01C4
  105. __IO u32 RESERVEDx01C8[910]; ///< offset 0x01C8 ~ 0x0FFC
  106. __IO u32 DMABMR; ///< Bus mode register offset 0x1000
  107. __IO u32 DMATPDR; ///< DMA sends the polling request register offset 0x1004
  108. __IO u32 DMARPDR; ///< DMA receives the polling request register offset 0x1008
  109. __IO u32 DMARDLAR; ///< DMA receives a list of descriptor addresses offset 0x100C
  110. __IO u32 DMATDLAR; ///< DMA sends the descriptor list address offset 0x1010
  111. __IO u32 DMASR; ///< DMA status register offset 0x1014
  112. __IO u32 DMAOMR; ///< DMA working mode register offset 0x1018
  113. __IO u32 DMAIER; ///< DMA interrupt enablement register offset 0x101C
  114. __IO u32 DMAMFBOCR; ///< DMA lost frames and cache overflow counter registers offset 0x1020
  115. __IO u32 DMARSWTR; /// 0x1024
  116. __IO u32 RESERVEDX1028[8]; /// 0x1028 ~ 0x1044
  117. __IO u32 DMACHTDR; /// 0x1048
  118. __IO u32 DMACHRDR; /// 0x104C
  119. __IO u32 DMACHTBAR; ///< DMA is currently sending the cache address register offset 0x1050
  120. __IO u32 DMACHRBAR; ///< DMA currently receives the cache address register offset 0x1054
  121. } ETH_TypeDef;
  122. ////////////////////////////////////////////////////////////////////////////////
  123. /// @brief ETH_MACCR Register Bit Definition
  124. ////////////////////////////////////////////////////////////////////////////////
  125. #define ETH_MACCR_WD_Pos (23)
  126. #define ETH_MACCR_WD (0x01U << ETH_MACCR_WD_Pos) ///< Watchdog disable
  127. #define ETH_MACCR_JD_Pos (22)
  128. #define ETH_MACCR_JD (0x01U << ETH_MACCR_JD_Pos) ///< Jabber disable
  129. #define ETH_MACCR_FBE_Pos (21)
  130. #define ETH_MACCR_FBE (0x01U << ETH_MACCR_FBE_Pos) ///< Frame Burst Enable
  131. #define ETH_MACCR_JE_Pos (20)
  132. #define ETH_MACCR_JE (0x01U << ETH_MACCR_JE_Pos) ///< Jumbo Frame Enable
  133. #define ETH_MACCR_IFG_Pos (17) ///< Inter-frame gap
  134. #define ETH_MACCR_IFG_96Bit (0x00U << ETH_MACCR_IFG_Pos) ///< Minimum IFG between frames during transmission is 96Bit
  135. #define ETH_MACCR_IFG_88Bit (0x01U << ETH_MACCR_IFG_Pos) ///< Minimum IFG between frames during transmission is 88Bit
  136. #define ETH_MACCR_IFG_80Bit (0x02U << ETH_MACCR_IFG_Pos) ///< Minimum IFG between frames during transmission is 80Bit
  137. #define ETH_MACCR_IFG_72Bit (0x03U << ETH_MACCR_IFG_Pos) ///< Minimum IFG between frames during transmission is 72Bit
  138. #define ETH_MACCR_IFG_64Bit (0x04U << ETH_MACCR_IFG_Pos) ///< Minimum IFG between frames during transmission is 64Bit
  139. #define ETH_MACCR_IFG_56Bit (0x05U << ETH_MACCR_IFG_Pos) ///< Minimum IFG between frames during transmission is 56Bit
  140. #define ETH_MACCR_IFG_48Bit (0x06U << ETH_MACCR_IFG_Pos) ///< Minimum IFG between frames during transmission is 48Bit
  141. #define ETH_MACCR_IFG_40Bit (0x07U << ETH_MACCR_IFG_Pos) ///< Minimum IFG between frames during transmission is 40Bit
  142. #define ETH_MACCR_FES_Pos (14)
  143. #define ETH_MACCR_FES (0x01U << ETH_MACCR_FES_Pos) ///< Fast ethernet speed
  144. #define ETH_MACCR_ROD_Pos (13)
  145. #define ETH_MACCR_ROD (0x01U << ETH_MACCR_ROD_Pos) ///< Receive own disable
  146. #define ETH_MACCR_LM_Pos (12)
  147. #define ETH_MACCR_LM (0x01U << ETH_MACCR_LM_Pos) ///< loopback mode
  148. #define ETH_MACCR_DM_Pos (11)
  149. #define ETH_MACCR_DM (0x01U << ETH_MACCR_DM_Pos) ///< Duplex mode
  150. #define ETH_MACCR_IPCO_Pos (10)
  151. #define ETH_MACCR_IPCO (0x01U << ETH_MACCR_IPCO_Pos) ///< IP Checksum offload
  152. #define ETH_MACCR_RD_Pos (9)
  153. #define ETH_MACCR_RD (0x01U << ETH_MACCR_RD_Pos) ///< Retry disable
  154. #define ETH_MACCR_APCS_Pos (8)
  155. #define ETH_MACCR_APCS (0x01U << ETH_MACCR_APCS_Pos) ///< Automatic Pad/CRC stripping
  156. #define ETH_MACCR_BL_Pos (5) ///< Back-off limit: random integer number (r) of slot time delays before rescheduling a transmission attempt during retries after a collision: 0 =< r <2^k
  157. #define ETH_MACCR_BL_10 (0x00U << ETH_MACCR_BL_Pos) ///< k = min (n, 10)
  158. #define ETH_MACCR_BL_8 (0x01U << ETH_MACCR_BL_Pos) ///< k = min (n, 8)
  159. #define ETH_MACCR_BL_4 (0x02U << ETH_MACCR_BL_Pos) ///< k = min (n, 4)
  160. #define ETH_MACCR_BL_1 (0x03U << ETH_MACCR_BL_Pos) ///< k = min (n, 1)
  161. #define ETH_MACCR_DC_Pos (4)
  162. #define ETH_MACCR_DC (0x01U << ETH_MACCR_DC_Pos) ///< Defferal check
  163. #define ETH_MACCR_TE_Pos (3)
  164. #define ETH_MACCR_TE (0x01U << ETH_MACCR_TE_Pos) ///< Transmitter enable
  165. #define ETH_MACCR_RE_Pos (2)
  166. #define ETH_MACCR_RE (0x01U << ETH_MACCR_RE_Pos) ///< Receiver enable
  167. ////////////////////////////////////////////////////////////////////////////////
  168. /// @brief ETH_MACFFR Register Bit Definition
  169. ////////////////////////////////////////////////////////////////////////////////
  170. #define ETH_MACFFR_RA_Pos (31)
  171. #define ETH_MACFFR_RA (0x01U << ETH_MACFFR_RA_Pos) ///< Receive all
  172. #define ETH_MACFFR_SAF_Pos (9)
  173. #define ETH_MACFFR_SAF (0x01U << ETH_MACFFR_SAF_Pos) ///< Source address filter enable
  174. #define ETH_MACFFR_SAIF_Pos (8)
  175. #define ETH_MACFFR_SAIF (0x01U << ETH_MACFFR_SAIF_Pos) ///< SA inverse filtering
  176. #define ETH_MACFFR_PCF_Pos (6)
  177. #define ETH_MACFFR_PCF (0x03U << ETH_MACFFR_PCF_Pos) ///< Pass control frames: 3 cases
  178. #define ETH_MACFFR_PCF_BlockAll (0x01U << ETH_MACFFR_PCF_Pos) ///< MAC filters all control frames from reaching the application
  179. #define ETH_MACFFR_PCF_ForwardAll (0x02U << ETH_MACFFR_PCF_Pos) ///< MAC forwards all control frames to application even if they fail the Address Filter
  180. #define ETH_MACFFR_PCF_ForwardPassedAddrFilter (0x03U << ETH_MACFFR_PCF_Pos) ///< MAC forwards control frames that pass the Address Filter.
  181. #define ETH_MACFFR_BFD_Pos (5)
  182. #define ETH_MACFFR_BFD (0x01U << ETH_MACFFR_BFD_Pos) ///< Broadcast frame disable
  183. #define ETH_MACFFR_PAM_Pos (4)
  184. #define ETH_MACFFR_PAM (0x01U << ETH_MACFFR_PAM_Pos) ///< Pass all mutlicast
  185. #define ETH_MACFFR_DAIF_Pos (3)
  186. #define ETH_MACFFR_DAIF (0x01U << ETH_MACFFR_DAIF_Pos) ///< DA Inverse filtering
  187. #define ETH_MACFFR_HM_Pos (2)
  188. #define ETH_MACFFR_HM (0x01U << ETH_MACFFR_HM_Pos) ///< Hash multicast
  189. #define ETH_MACFFR_HU_Pos (1)
  190. #define ETH_MACFFR_HU (0x01U << ETH_MACFFR_HU_Pos) ///< Hash unicast
  191. #define ETH_MACFFR_PM_Pos (0)
  192. #define ETH_MACFFR_PM (0x01U << ETH_MACFFR_PM_Pos) ///< Promiscuous mode
  193. ////////////////////////////////////////////////////////////////////////////////
  194. /// @brief ETH_MACHTHR Register Bit Definition
  195. ////////////////////////////////////////////////////////////////////////////////
  196. #define ETH_MACHTHR_HTH (0xFFFFFFFFU) ///< Hash table high
  197. ////////////////////////////////////////////////////////////////////////////////
  198. /// @brief ETH_MACHTLR Register Bit Definition
  199. ////////////////////////////////////////////////////////////////////////////////
  200. #define ETH_MACHTLR_HTL (0xFFFFFFFFU) ///< Hash table low
  201. ////////////////////////////////////////////////////////////////////////////////
  202. /// @brief ETH_MACMIIAR Register Bit Definition
  203. ////////////////////////////////////////////////////////////////////////////////
  204. #define ETH_MACMIIAR_PA_Pos (11)
  205. #define ETH_MACMIIAR_PA (0x1FU << ETH_MACMIIAR_PA_Pos) ///< Physical layer address
  206. #define ETH_MACMIIAR_MR_Pos (6)
  207. #define ETH_MACMIIAR_MR (0x1FU << ETH_MACMIIAR_MR_Pos) ///< MII register in the selected PHY
  208. #define ETH_MACMIIAR_CR_Pos (2)
  209. #define ETH_MACMIIAR_CR (0x07U << ETH_MACMIIAR_CR_Pos) ///< CR clock range: 6 cases
  210. #define ETH_MACMIIAR_CR_Div42 (0x00U << ETH_MACMIIAR_CR_Pos) ///< HCLK:60-100 MHz; MDC clock= HCLK/42
  211. #define ETH_MACMIIAR_CR_Div62 (0x01U << ETH_MACMIIAR_CR_Pos) ///< HCLK:100-150 MHz; MDC clock= HCLK/62
  212. #define ETH_MACMIIAR_CR_Div16 (0x02U << ETH_MACMIIAR_CR_Pos) ///< HCLK:20-35 MHz; MDC clock= HCLK/16
  213. #define ETH_MACMIIAR_CR_Div26 (0x03U << ETH_MACMIIAR_CR_Pos) ///< HCLK:35-60 MHz; MDC clock= HCLK/26
  214. #define ETH_MACMIIAR_CR_Div102 (0x04U << ETH_MACMIIAR_CR_Pos) ///< HCLK:150-168 MHz; MDC clock= HCLK/102
  215. #define ETH_MACMIIAR_MW_Pos (1)
  216. #define ETH_MACMIIAR_MW (0x01U << ETH_MACMIIAR_MW_Pos) ///< MII write
  217. #define ETH_MACMIIAR_MB_Pos (0)
  218. #define ETH_MACMIIAR_MB (0x01U << ETH_MACMIIAR_MB_Pos) ///< MII busy
  219. ////////////////////////////////////////////////////////////////////////////////
  220. /// @brief ETH_MACMIIDR Register Bit Definition
  221. ////////////////////////////////////////////////////////////////////////////////
  222. #define ETH_MACMIIDR_MD (0x0000FFFFU) ///< MII data: read/write data from/to PHY
  223. ////////////////////////////////////////////////////////////////////////////////
  224. /// @brief ETH_MACFCR Register Bit Definition
  225. ////////////////////////////////////////////////////////////////////////////////
  226. #define ETH_MACFCR_PT_Pos (16)
  227. #define ETH_MACFCR_PT ((u32)0xFFFF << ETH_MACFCR_PT_Pos) ///< Pause time
  228. #define ETH_MACFCR_PLT_Pos (4)
  229. #define ETH_MACFCR_PLT (0x03U << ETH_MACFCR_PLT_Pos) ///< Pause low threshold: 4 cases
  230. #define ETH_MACFCR_PLT_Minus4 (0x00U << ETH_MACFCR_PLT_Pos) ///< Pause time minus 4 slot times
  231. #define ETH_MACFCR_PLT_Minus28 (0x01U << ETH_MACFCR_PLT_Pos) ///< Pause time minus 28 slot times
  232. #define ETH_MACFCR_PLT_Minus144 (0x02U << ETH_MACFCR_PLT_Pos) ///< Pause time minus 144 slot times
  233. #define ETH_MACFCR_PLT_Minus256 (0x03U << ETH_MACFCR_PLT_Pos) ///< Pause time minus 256 slot times
  234. #define ETH_MACFCR_UPFD_Pos (3)
  235. #define ETH_MACFCR_UPFD (0x01U << ETH_MACFCR_UPFD_Pos) ///< Unicast pause frame detect
  236. #define ETH_MACFCR_RFCE_Pos (2)
  237. #define ETH_MACFCR_RFCE (0x01U << ETH_MACFCR_RFCE_Pos) ///< Receive flow control enable
  238. #define ETH_MACFCR_TFCE_Pos (1)
  239. #define ETH_MACFCR_TFCE (0x01U << ETH_MACFCR_TFCE_Pos) ///< Transmit flow control enable
  240. #define ETH_MACFCR_FCBBPA_Pos (0)
  241. #define ETH_MACFCR_FCBBPA (0x01U << ETH_MACFCR_FCBBPA_Pos) ///< Flow control busy/backpressure activate
  242. ////////////////////////////////////////////////////////////////////////////////
  243. /// @brief ETH_MACVLANTR Register Bit Definition
  244. ////////////////////////////////////////////////////////////////////////////////
  245. #define ETH_MACVLANTR_VLANTI (0x0000FFFFU) ///< VLAN tag identifier (for receive frames)
  246. ////////////////////////////////////////////////////////////////////////////////
  247. /// @brief ETH_MACRWUFFR Register Bit Definition
  248. ////////////////////////////////////////////////////////////////////////////////
  249. #define ETH_MACRWUFFR_D (0xFFFFFFFFU) ///< Wake-up frame filter register data
  250. ////////////////////////////////////////////////////////////////////////////////
  251. /// @brief ETH_MACPMTCSR Register Bit Definition
  252. ////////////////////////////////////////////////////////////////////////////////
  253. #define ETH_MACPMTCSR_WFFRPR_Pos (31) ///< Wake-Up Frame Filter Register Pointer Reset
  254. #define ETH_MACPMTCSR_WFFRPR (0x01U << ETH_MACPMTCSR_WFFRPR_Pos) ///< Wake-Up Frame Filter Register Pointer Reset
  255. #define ETH_MACPMTCSR_GU_Pos (9)
  256. #define ETH_MACPMTCSR_GU (0x01U << ETH_MACPMTCSR_GU_Pos) ///< Global Unicast
  257. #define ETH_MACPMTCSR_WFR_Pos (6)
  258. #define ETH_MACPMTCSR_WFR (0x01U << ETH_MACPMTCSR_WFR_Pos) ///< Wake-Up Frame Received
  259. #define ETH_MACPMTCSR_MPR_Pos (5)
  260. #define ETH_MACPMTCSR_MPR (0x01U << ETH_MACPMTCSR_MPR_Pos) ///< Magic Packet Received
  261. #define ETH_MACPMTCSR_WFE_Pos (2)
  262. #define ETH_MACPMTCSR_WFE (0x01U << ETH_MACPMTCSR_WFE_Pos) ///< Wake-Up Frame Enable
  263. #define ETH_MACPMTCSR_MPE_Pos (1)
  264. #define ETH_MACPMTCSR_MPE (0x01U << ETH_MACPMTCSR_MPE_Pos) ///< Magic Packet Enable
  265. #define ETH_MACPMTCSR_PD_Pos (0)
  266. #define ETH_MACPMTCSR_PD (0x01U << ETH_MACPMTCSR_PD_Pos) ///< Power Down
  267. ////////////////////////////////////////////////////////////////////////////////
  268. /// @brief ETH_MACA0HR Register Bit Definition
  269. ////////////////////////////////////////////////////////////////////////////////
  270. #define ETH_MACA0HR_MACA0H ((u32)0x0000FFFF) ///< MAC address0 high
  271. ////////////////////////////////////////////////////////////////////////////////
  272. /// @brief ETH_MACA0LR Register Bit Definition
  273. ////////////////////////////////////////////////////////////////////////////////
  274. #define ETH_MACA0LR_MACA0L ((u32)0xFFFFFFFF) ///< MAC address0 low
  275. ////////////////////////////////////////////////////////////////////////////////
  276. /// @brief ETH_MACA1HR Register Bit Definition
  277. ////////////////////////////////////////////////////////////////////////////////
  278. #define ETH_MACA1HR_AE_Pos (31)
  279. #define ETH_MACA1HR_AE (0x01U << ETH_MACA1HR_AE_Pos) ///< Address enable
  280. #define ETH_MACA1HR_SA_Pos (30)
  281. #define ETH_MACA1HR_SA (0x01U << ETH_MACA1HR_SA_Pos) ///< Source address
  282. #define ETH_MACA1HR_MBC_Pos (24)
  283. #define ETH_MACA1HR_MBC (0x3FU << ETH_MACA1HR_MBC_Pos) ///< Mask byte control: bits to mask for comparison of the MAC Address bytes
  284. #define ETH_MACA1HR_MBC_HBits15_8 (0x20U << ETH_MACA1HR_MBC_Pos) ///< Mask MAC Address high reg bits [15:8]
  285. #define ETH_MACA1HR_MBC_HBits7_0 (0x10U << ETH_MACA1HR_MBC_Pos) ///< Mask MAC Address high reg bits [7:0]
  286. #define ETH_MACA1HR_MBC_LBits31_24 (0x08U << ETH_MACA1HR_MBC_Pos) ///< Mask MAC Address low reg bits [31:24]
  287. #define ETH_MACA1HR_MBC_LBits23_16 (0x04U << ETH_MACA1HR_MBC_Pos) ///< Mask MAC Address low reg bits [23:16]
  288. #define ETH_MACA1HR_MBC_LBits15_8 (0x02U << ETH_MACA1HR_MBC_Pos) ///< Mask MAC Address low reg bits [15:8]
  289. #define ETH_MACA1HR_MBC_LBits7_0 (0x00U << ETH_MACA1HR_MBC_Pos) ///< Mask MAC Address low reg bits [7:0]
  290. #define ETH_MACA1HR_MACA1H_Pos (0)
  291. #define ETH_MACA1HR_MACA1H (0x0000FFFFU << ETH_MACA1HR_MACA1H_Pos) ///< MAC address1 high
  292. ////////////////////////////////////////////////////////////////////////////////
  293. /// @brief ETH_MACA1LR Register Bit Definition
  294. ////////////////////////////////////////////////////////////////////////////////
  295. #define ETH_MACA1LR_MACA1L (0xFFFFFFFFU) ///< MAC address1 low
  296. ////////////////////////////////////////////////////////////////////////////////
  297. /// @brief ETH_MACA2HR Register Bit Definition
  298. ////////////////////////////////////////////////////////////////////////////////
  299. #define ETH_MACA2HR_AE_Pos (31)
  300. #define ETH_MACA2HR_AE (0x01U << ETH_MACA2HR_AE_Pos) ///< Address enable
  301. #define ETH_MACA2HR_SA_Pos (30)
  302. #define ETH_MACA2HR_SA (0x01U << ETH_MACA2HR_SA_Pos) ///< Source address
  303. #define ETH_MACA2HR_MBC_Pos (24)
  304. #define ETH_MACA2HR_MBC (0x3FU << ETH_MACA2HR_MBC_Pos) ///< Mask byte control: bits to mask for comparison of the MAC Address bytes
  305. #define ETH_MACA2HR_MBC_HBits15_8 (0x20U << ETH_MACA2HR_MBC_Pos) ///< Mask MAC Address high reg bits [15:8]
  306. #define ETH_MACA2HR_MBC_HBits7_0 (0x10U << ETH_MACA2HR_MBC_Pos) ///< Mask MAC Address high reg bits [7:0]
  307. #define ETH_MACA2HR_MBC_LBits31_24 (0x08U << ETH_MACA2HR_MBC_Pos) ///< Mask MAC Address low reg bits [31:24]
  308. #define ETH_MACA2HR_MBC_LBits23_16 (0x04U << ETH_MACA2HR_MBC_Pos) ///< Mask MAC Address low reg bits [23:16]
  309. #define ETH_MACA2HR_MBC_LBits15_8 (0x02U << ETH_MACA2HR_MBC_Pos) ///< Mask MAC Address low reg bits [15:8]
  310. #define ETH_MACA2HR_MBC_LBits7_0 (0x00U << ETH_MACA2HR_MBC_Pos) ///< Mask MAC Address low reg bits [7:0]
  311. #define ETH_MACA2HR_MACA2H_Pos (0)
  312. #define ETH_MACA2HR_MACA2H (0x0000FFFFU << ETH_MACA2HR_MACA2H_Pos) ///< MAC address2 high
  313. ////////////////////////////////////////////////////////////////////////////////
  314. /// @brief ETH_MACA2LR Register Bit Definition
  315. ////////////////////////////////////////////////////////////////////////////////
  316. #define ETH_MACA2LR_MACA2L (0xFFFFFFFFU) ///< MAC address2 low
  317. ////////////////////////////////////////////////////////////////////////////////
  318. /// @brief ETH_MACANCR Register Bit Definition
  319. ////////////////////////////////////////////////////////////////////////////////
  320. #define ETH_MACANCR_LR_Pos (17)
  321. #define ETH_MACANCR_LR (0x01U << ETH_MACANCR_LR_Pos) ///< Lock to Reference
  322. #define ETH_MACANCR_ECD_Pos (16)
  323. #define ETH_MACANCR_ECD (0x01U << ETH_MACANCR_ECD_Pos) ///< Enable Comma Detect
  324. #define ETH_MACANCR_ELE_Pos (14)
  325. #define ETH_MACANCR_ELE (0x01U << ETH_MACANCR_ELE_Pos) ///< External Loopback Enable
  326. #define ETH_MACANCR_ANE_Pos (12)
  327. #define ETH_MACANCR_ANE (0x01U << ETH_MACANCR_ANE_Pos) ///< Auto-Negotiation Enable
  328. #define ETH_MACANCR_RAN_Pos (9)
  329. #define ETH_MACANCR_RAN (0x01U << ETH_MACANCR_RAN_Pos) ///< Restart Auto-Negotiation
  330. ////////////////////////////////////////////////////////////////////////////////
  331. /// @brief ETH_MACANSR Register Bit Definition
  332. ////////////////////////////////////////////////////////////////////////////////
  333. #define ETH_MACANSR_ES_Pos (8)
  334. #define ETH_MACANSR_ES (0x01U << ETH_MACANSR_ES_Pos) ///< Extended Status
  335. #define ETH_MACANSR_ANC_Pos (5)
  336. #define ETH_MACANSR_ANC (0x01U << ETH_MACANSR_ANC_Pos) ///< Auto-Negotiation Complete
  337. #define ETH_MACANSR_ANA_Pos (3)
  338. #define ETH_MACANSR_ANA (0x01U << ETH_MACANSR_ANA_Pos) ///< Auto-Negotiation Ability
  339. #define ETH_MACANSR_LS_Pos (2)
  340. #define ETH_MACANSR_LS (0x01U << ETH_MACANSR_LS_Pos) ///< Link Status
  341. ////////////////////////////////////////////////////////////////////////////////
  342. /// @brief ETH_MACANAR Register Bit Definition
  343. ////////////////////////////////////////////////////////////////////////////////
  344. #define ETH_MACANAR_NP_Pos (15)
  345. #define ETH_MACANAR_NP (0x01U << ETH_MACANAR_NP_Pos) ///< Next Page Support
  346. #define ETH_MACANAR_RFE_Pos (12)
  347. #define ETH_MACANAR_RFE (0x01U << ETH_MACANAR_RFE_Pos) ///< Remote Fault Encoding
  348. #define ETH_MACANAR_PSE_Pos (7)
  349. #define ETH_MACANAR_PSE (0x01U << ETH_MACANAR_PSE_Pos) ///< Pause Encoding
  350. #define ETH_MACANAR_HD_Pos (6)
  351. #define ETH_MACANAR_HD (0x01U << ETH_MACANAR_HD_Pos) ///< support Half-Duplex
  352. #define ETH_MACANAR_FD_Pos (5)
  353. #define ETH_MACANAR_FD (0x01U << ETH_MACANAR_FD_Pos) ///< support Full-Durplex
  354. ////////////////////////////////////////////////////////////////////////////////
  355. /// @brief ETH_MACANLPAR Register Bit Definition
  356. ////////////////////////////////////////////////////////////////////////////////
  357. #define ETH_MACANLPAR_NP_Pos (15)
  358. #define ETH_MACANLPAR_NP (0x01U << ETH_MACANLPAR_NP_Pos) ///< Next Page Support
  359. #define ETH_MACANLPAR_ACK_Pos (14)
  360. #define ETH_MACANLPAR_ACK (0x01U << ETH_MACANLPAR_ACK_Pos) ///< Acknowledge
  361. #define ETH_MACANLPAR_RFE_Pos (12)
  362. #define ETH_MACANLPAR_RFE (0x01U << ETH_MACANLPAR_RFE_Pos) ///< Remote Fault Encoding
  363. #define ETH_MACANLPAR_PSE_Pos (7)
  364. #define ETH_MACANLPAR_PSE (0x01U << ETH_MACANLPAR_PSE_Pos) ///< Pause Encoding
  365. #define ETH_MACANLPAR_HD_Pos (6)
  366. #define ETH_MACANLPAR_HD (0x01U << ETH_MACANLPAR_HD_Pos) ///< support Half-Duplex
  367. #define ETH_MACANLPAR_FD_Pos (5)
  368. #define ETH_MACANLPAR_FD (0x01U << ETH_MACANLPAR_FD_Pos) ///< support Full-Durplex
  369. ////////////////////////////////////////////////////////////////////////////////
  370. /// @brief ETH_MACANER Register Bit Definition
  371. ////////////////////////////////////////////////////////////////////////////////
  372. #define ETH_MACANER_NPA_Pos (2)
  373. #define ETH_MACANER_NPA (0x01U << ETH_MACANER_NPA_Pos) ///< Next Page Ability
  374. #define ETH_MACANER_NPR_Pos (1)
  375. #define ETH_MACANER_NPR (0x01U << ETH_MACANER_NPR_Pos) ///< New Page Received
  376. ////////////////////////////////////////////////////////////////////////////////
  377. /// @brief ETH_MACTBIER Register Bit Definition
  378. ////////////////////////////////////////////////////////////////////////////////
  379. #define ETH_MACTBIER_GFD_Pos (15)
  380. #define ETH_MACTBIER_GFD (0x01U << ETH_MACTBIER_GFD_Pos) ///< 1000BASE-X Full-Duplex Capable
  381. #define ETH_MACTBIER_GHD_Pos (14)
  382. #define ETH_MACTBIER_GHD (0x01U << ETH_MACTBIER_GHD_Pos) ///< 1000BASE-X Half-Duplex Capable
  383. ////////////////////////////////////////////////////////////////////////////////
  384. /// @brief ETH_MACMIISR Register Bit Definition
  385. ////////////////////////////////////////////////////////////////////////////////
  386. #define ETH_MACMIISR_LS_Pos (3)
  387. #define ETH_MACMIISR_LS (0x01U << ETH_MACMIISR_LS_Pos) ///< Link Status
  388. #define ETH_MACMIISR_LSP_Pos (1)
  389. #define ETH_MACMIISR_LSP_2_5 (0x00U << ETH_MACMIISR_LSP_Pos) ///< Link Speed 2.5 MHz
  390. #define ETH_MACMIISR_LSP_25 (0x01U << ETH_MACMIISR_LSP_Pos) ///< Link Speed 25 MHz
  391. #define ETH_MACMIISR_LSP_125 (0x02U << ETH_MACMIISR_LSP_Pos) ///< Link Speed 125 MHz
  392. #define ETH_MACMIISR_LM_Pos (0)
  393. #define ETH_MACMIISR_LM (0x01U << ETH_MACMIISR_LM_Pos) ///< Link Mode : Full-Duplex Capable
  394. ////////////////////////////////////////////////////////////////////////////////
  395. /// @brief ETH_MMCCR Registers bits definition
  396. ////////////////////////////////////////////////////////////////////////////////
  397. #define ETH_MMCCR_MCFHP ((u32)0x00000020) ///< MMC counter Full-Half preset
  398. #define ETH_MMCCR_MCP ((u32)0x00000010) ///< MMC counter preset
  399. #define ETH_MMCCR_MCF ((u32)0x00000008) ///< MMC Counter Freeze
  400. #define ETH_MMCCR_ROR_Pos (2)
  401. #define ETH_MMCCR_ROR (0x01U << ETH_MMCCR_ROR_Pos) ///< Reset on Read
  402. #define ETH_MMCCR_CSR_Pos (1)
  403. #define ETH_MMCCR_CSR (0x01U << ETH_MMCCR_CSR_Pos) ///< Counter Stop Rollover
  404. #define ETH_MMCCR_CR_Pos (0)
  405. #define ETH_MMCCR_CR (0x01U << ETH_MMCCR_CR_Pos) ///< Counters Reset
  406. ////////////////////////////////////////////////////////////////////////////////
  407. /// @brief ETH_MMCRIR Registers bits definition
  408. ////////////////////////////////////////////////////////////////////////////////
  409. #define ETH_MMCRIR_RGUF_Pos (17)
  410. #define ETH_MMCRIR_RGUFS (0x01U << ETH_MMCRIR_RGUF_Pos) ///< Set when Rx good unicast frames counter reaches half the maximum value
  411. #define ETH_MMCRIR_RFAES_Pos (6)
  412. #define ETH_MMCRIR_RFAES (0x01U << ETH_MMCRIR_RFAES_Pos) ///< Set when Rx alignment error counter reaches half the maximum value
  413. #define ETH_MMCRIR_RFCES_Pos (5)
  414. #define ETH_MMCRIR_RFCES (0x01U << ETH_MMCRIR_RFCES_Pos) ///< Set when Rx crc error counter reaches half the maximum value
  415. ////////////////////////////////////////////////////////////////////////////////
  416. /// @brief ETH_MMCTIR Registers bits definition
  417. ////////////////////////////////////////////////////////////////////////////////
  418. #define ETH_MMCTIR_TGFS_Pos (21)
  419. #define ETH_MMCTIR_TGFS (0x01U << ETH_MMCTIR_TGFS_Pos) ///< Set when Tx good frame count counter reaches half the maximum value
  420. #define ETH_MMCTIR_TGFMSCS_Pos (15)
  421. #define ETH_MMCTIR_TGFMSCS (0x01U << ETH_MMCTIR_TGFMSCS_Pos) ///< Set when Tx good multi col counter reaches half the maximum value
  422. #define ETH_MMCTIR_TGFSCS_Pos (14)
  423. #define ETH_MMCTIR_TGFSCS (0x01U << ETH_MMCTIR_TGFSCS_Pos) ///< Set when Tx good single col counter reaches half the maximum value
  424. ////////////////////////////////////////////////////////////////////////////////
  425. /// @brief ETH_MMCRIMR Registers bits definition
  426. ////////////////////////////////////////////////////////////////////////////////
  427. #define ETH_MMCRIMR_RGUFM_Pos (17)
  428. #define ETH_MMCRIMR_RGUFM (0x01U << ETH_MMCRIMR_RGUFM_Pos) ///< Mask the interrupt when Rx good unicast frames counter reaches half the maximum value
  429. #define ETH_MMCRIMR_RFAEM_Pos (6)
  430. #define ETH_MMCRIMR_RFAEM (0x01U << ETH_MMCRIMR_RFAEM_Pos) ///< Mask the interrupt when when Rx alignment error counter reaches half the maximum value
  431. #define ETH_MMCRIMR_RFCEM_Pos (5)
  432. #define ETH_MMCRIMR_RFCEM (0x01U << ETH_MMCRIMR_RFCEM_Pos) ///< Mask the interrupt when Rx crc error counter reaches half the maximum value
  433. ////////////////////////////////////////////////////////////////////////////////
  434. /// @brief ETH_MMCTIMR Registers bits definition
  435. ////////////////////////////////////////////////////////////////////////////////
  436. #define ETH_MMCTIMR_TGFM_Pos (21)
  437. #define ETH_MMCTIMR_TGFM (0x01U << ETH_MMCTIMR_TGFM_Pos) ///< Mask the interrupt when Tx good frame count counter reaches half the maximum value
  438. #define ETH_MMCTIMR_TGFMSCM_Pos (15)
  439. #define ETH_MMCTIMR_TGFMSCM (0x01U << ETH_MMCTIMR_TGFMSCM_Pos) ///< Mask the interrupt when Tx good multi col counter reaches half the maximum value
  440. #define ETH_MMCTIMR_TGFSCM_Pos (14)
  441. #define ETH_MMCTIMR_TGFSCM (0x01U << ETH_MMCTIMR_TGFSCM_Pos) ///< Mask the interrupt when Tx good single col counter reaches half the maximum value
  442. ////////////////////////////////////////////////////////////////////////////////
  443. /// @brief ETH_MMCTGFSCCR Registers bits definition
  444. ////////////////////////////////////////////////////////////////////////////////
  445. #define ETH_MMCTGFSCCR_TGFSCC (0xFFFFFFFFU) ///< Number of successfully transmitted frames after a single collision in Half-duplex mode.
  446. ////////////////////////////////////////////////////////////////////////////////
  447. /// @brief ETH_MMCTGFMSCCR Registers bits definition
  448. ////////////////////////////////////////////////////////////////////////////////
  449. #define ETH_MMCTGFMSCCR_TGFMSCC (0xFFFFFFFFU) ///< Number of successfully transmitted frames after more than a single collision in Half-duplex mode.
  450. ////////////////////////////////////////////////////////////////////////////////
  451. /// @brief ETH_MMCTGFCR Registers bits definition
  452. ////////////////////////////////////////////////////////////////////////////////
  453. #define ETH_MMCTGFCR_TGFC (0xFFFFFFFFU) ///< Number of good frames transmitted.
  454. ////////////////////////////////////////////////////////////////////////////////
  455. /// @brief ETH_MMCRFCECR Registers bits definition
  456. ////////////////////////////////////////////////////////////////////////////////
  457. #define ETH_MMCRFCECR_RFCEC (0xFFFFFFFFU) ///< Number of frames received with CRC error.
  458. ////////////////////////////////////////////////////////////////////////////////
  459. /// @brief ETH_MMCRFAECR Registers bits definition
  460. ////////////////////////////////////////////////////////////////////////////////
  461. #define ETH_MMCRFAECR_RFAEC (0xFFFFFFFFU) ///< Number of frames received with alignment (dribble) error
  462. ////////////////////////////////////////////////////////////////////////////////
  463. /// @brief ETH_MMCRGUFCR Registers bits definition
  464. ////////////////////////////////////////////////////////////////////////////////
  465. #define ETH_MMCRGUFCR_RGUFC (0xFFFFFFFFU) ///< Number of good unicast frames received.
  466. /// @brief ETH_DMABMR Registers bits definition
  467. ////////////////////////////////////////////////////////////////////////////////
  468. #define ETH_DMABMR_FB_Pos (16)
  469. #define ETH_DMABMR_FB (0x01U << ETH_DMABMR_FB_Pos) ///< Fixed Burst
  470. #define ETH_DMABMR_RTPR_Pos (14)
  471. #define ETH_DMABMR_RTPR (0x03U << ETH_DMABMR_RTPR_Pos) ///< Rx Tx priority ratio
  472. #define ETH_DMABMR_RTPR_1_1 (0x00U << ETH_DMABMR_RTPR_Pos) ///< Rx Tx priority ratio
  473. #define ETH_DMABMR_RTPR_2_1 (0x01U << ETH_DMABMR_RTPR_Pos) ///< Rx Tx priority ratio
  474. #define ETH_DMABMR_RTPR_3_1 (0x02U << ETH_DMABMR_RTPR_Pos) ///< Rx Tx priority ratio
  475. #define ETH_DMABMR_RTPR_4_1 (0x03U << ETH_DMABMR_RTPR_Pos) ///< Rx Tx priority ratio
  476. #define ETH_DMABMR_PBL_Pos (8)
  477. #define ETH_DMABMR_PBL (0x3FU<< ETH_DMABMR_PBL_Pos) //< Programmable burst length
  478. #define ETH_DMABMR_PBL_1Beat (0x01U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 1
  479. #define ETH_DMABMR_PBL_2Beat (0x02U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 2
  480. #define ETH_DMABMR_PBL_4Beat (0x04U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 4
  481. #define ETH_DMABMR_PBL_8Beat (0x08U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 8
  482. #define ETH_DMABMR_PBL_16Beat (0x10U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 16
  483. #define ETH_DMABMR_PBL_32Beat (0x20U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 32
  484. #define ETH_DMABMR_PBL_4xPBL_4Beat (0x10001U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 4
  485. #define ETH_DMABMR_PBL_4xPBL_8Beat (0x10002U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 8
  486. #define ETH_DMABMR_PBL_4xPBL_16Beat (0x10004U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 16
  487. #define ETH_DMABMR_PBL_4xPBL_32Beat (0x10008U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 32
  488. #define ETH_DMABMR_PBL_4xPBL_64Beat (0x10010U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 64
  489. #define ETH_DMABMR_PBL_4xPBL_128Beat (0x10020U << ETH_DMABMR_PBL_Pos) ///< maximum number of beats to be transferred in one TxDMA (or both) transaction is 128
  490. #define ETH_DMABMR_DSL_Pos (2)
  491. #define ETH_DMABMR_DSL (0x01U << ETH_DMABMR_DSL_Pos) ///< Descriptor Skip Length
  492. #define ETH_DMABMR_DA_Pos (1)
  493. #define ETH_DMABMR_DA (0x1FU << ETH_DMABMR_DA_Pos) ///< DMA arbitration scheme
  494. #define ETH_DMABMR_SR_Pos (0)
  495. #define ETH_DMABMR_SR (0x01U << ETH_DMABMR_SR_Pos) ///< Software reset
  496. ////////////////////////////////////////////////////////////////////////////////
  497. /// @brief ETH_DMATPDR Registers bits definition
  498. ////////////////////////////////////////////////////////////////////////////////
  499. #define ETH_DMATPDR_TPD (0xFFFFFFFFU) ///< Transmit poll demand
  500. ////////////////////////////////////////////////////////////////////////////////
  501. /// @brief ETH_DMARPDR Registers bits definition
  502. ////////////////////////////////////////////////////////////////////////////////
  503. #define ETH_DMARPDR_RPD (0xFFFFFFFFU) ///< Receive poll demand
  504. ////////////////////////////////////////////////////////////////////////////////
  505. /// @brief ETH_DMARDLAR Registers bits definition
  506. ////////////////////////////////////////////////////////////////////////////////
  507. #define ETH_DMARDLAR_SRL (0xFFFFFFFFU) ///< Start of receive list
  508. ////////////////////////////////////////////////////////////////////////////////
  509. /// @brief ETH_DMATDLAR Registers bits definition
  510. ////////////////////////////////////////////////////////////////////////////////
  511. #define ETH_DMATDLAR_STL (0xFFFFFFFFU) ///< Start of transmit list
  512. ////////////////////////////////////////////////////////////////////////////////
  513. /// @brief ETH_DMASR Registers bits definition
  514. ////////////////////////////////////////////////////////////////////////////////
  515. #define ETH_DMASR_PMTS_Pos (28)
  516. #define ETH_DMASR_PMTS (0x01U << ETH_DMASR_PMTS_Pos) ///< PMT status
  517. #define ETH_DMASR_MMCS_Pos (27)
  518. #define ETH_DMASR_MMCS (0x01U << ETH_DMASR_MMCS_Pos) ///< MMC status
  519. #define ETH_DMASR_LIS_Pos (26)
  520. #define ETH_DMASR_LIS (0x01U << ETH_DMASR_LIS_Pos) ///< GMAC Line interface Status
  521. #define ETH_DMASR_EBS_Pos (23)
  522. #define ETH_DMASR_EBS (0x07U << ETH_DMASR_EBS_Pos) ///< Error bits status
  523. #define ETH_DMASR_EBS_DescAccess (0x04U << ETH_DMASR_EBS_Pos) ///< Error bits 0-data buffer, 1-desc. access
  524. #define ETH_DMASR_EBS_ReadTransf (0x02U << ETH_DMASR_EBS_Pos) ///< Error bits 0-write trnsf, 1-read transfr
  525. #define ETH_DMASR_EBS_DataTransfTx (0x01U << ETH_DMASR_EBS_Pos) ///< Error bits 0-Rx DMA, 1-Tx DMA
  526. #define ETH_DMASR_TPS_Pos (20)
  527. #define ETH_DMASR_TPS (0x007U << ETH_DMASR_TPS_Pos) ///< Transmit process state
  528. #define ETH_DMASR_TPS_Stopped (0x000U << ETH_DMASR_TPS_Pos) ///< Stopped - Reset or Stop Tx Command issued
  529. #define ETH_DMASR_TPS_Fetching (0x001U << ETH_DMASR_TPS_Pos) ///< Running - fetching the Tx descriptor
  530. #define ETH_DMASR_TPS_Waiting (0x002U << ETH_DMASR_TPS_Pos) ///< Running - waiting for status
  531. #define ETH_DMASR_TPS_Reading (0x003U << ETH_DMASR_TPS_Pos) ///< Running - reading the data from host memory
  532. #define ETH_DMASR_TPS_Suspended (0x006U << ETH_DMASR_TPS_Pos) ///< Suspended - Tx Descriptor unavailabe
  533. #define ETH_DMASR_TPS_Closing (0x007U << ETH_DMASR_TPS_Pos) ///< Running - closing Rx descriptor
  534. #define ETH_DMASR_RPS_Pos (17)
  535. #define ETH_DMASR_RPS (0x07U << ETH_DMASR_RPS_Pos) ///< Receive process state
  536. #define ETH_DMASR_RPS_Stopped (0x00U << ETH_DMASR_RPS_Pos) ///< Stopped - Reset or Stop Rx Command issued
  537. #define ETH_DMASR_RPS_Fetching (0x01U << ETH_DMASR_RPS_Pos) ///< Running - fetching the Rx descriptor
  538. #define ETH_DMASR_RPS_Waiting (0x03U << ETH_DMASR_RPS_Pos) ///< Running - waiting for packet
  539. #define ETH_DMASR_RPS_Suspended (0x04U << ETH_DMASR_RPS_Pos) ///< Suspended - Rx Descriptor unavailable
  540. #define ETH_DMASR_RPS_Closing (0x05U << ETH_DMASR_RPS_Pos) ///< Running - closing descriptor
  541. #define ETH_DMASR_RPS_Queuing (0x07U << ETH_DMASR_RPS_Pos) ///< Running - queuing the recieve frame into host memory
  542. #define ETH_DMASR_NIS_Pos (16)
  543. #define ETH_DMASR_NIS (0x01U << ETH_DMASR_NIS_Pos ) ///< Normal interrupt summary
  544. #define ETH_DMASR_AIS_Pos (15)
  545. #define ETH_DMASR_AIS (0x01U << ETH_DMASR_AIS_Pos ) ///< Abnormal interrupt summary
  546. #define ETH_DMASR_ERS_Pos (14)
  547. #define ETH_DMASR_ERS (0x01U << ETH_DMASR_ERS_Pos ) ///< Early receive status
  548. #define ETH_DMASR_FBES_Pos (13)
  549. #define ETH_DMASR_FBES (0x01U << ETH_DMASR_FBES_Pos) ///< Fatal bus error status
  550. #define ETH_DMASR_ETS_Pos (10)
  551. #define ETH_DMASR_ETS (0x01U << ETH_DMASR_ETS_Pos ) ///< Early transmit status
  552. #define ETH_DMASR_RWTS_Pos (9)
  553. #define ETH_DMASR_RWTS (0x01U << ETH_DMASR_RWTS_Pos) ///< Receive watchdog timeout status
  554. #define ETH_DMASR_RPSS_Pos (8)
  555. #define ETH_DMASR_RPSS (0x01U << ETH_DMASR_RPSS_Pos) ///< Receive process stopped status
  556. #define ETH_DMASR_RBUS_Pos (7)
  557. #define ETH_DMASR_RBUS (0x01U << ETH_DMASR_RBUS_Pos) ///< Receive buffer unavailable status
  558. #define ETH_DMASR_RS_Pos (6)
  559. #define ETH_DMASR_RS (0x01U << ETH_DMASR_RS_Pos ) ///< Receive status
  560. #define ETH_DMASR_TUS_Pos (5)
  561. #define ETH_DMASR_TUS (0x01U << ETH_DMASR_TUS_Pos ) ///< Transmit underflow status
  562. #define ETH_DMASR_ROS_Pos (4)
  563. #define ETH_DMASR_ROS (0x01U << ETH_DMASR_ROS_Pos ) ///< Receive overflow status
  564. #define ETH_DMASR_TJTS_Pos (3)
  565. #define ETH_DMASR_TJTS (0x01U << ETH_DMASR_TJTS_Pos) ///< Transmit jabber timeout status
  566. #define ETH_DMASR_TBUS_Pos (2)
  567. #define ETH_DMASR_TBUS (0x01U << ETH_DMASR_TBUS_Pos) ///< Transmit buffer unavailable status
  568. #define ETH_DMASR_TPSS_Pos (1)
  569. #define ETH_DMASR_TPSS (0x01U << ETH_DMASR_TPSS_Pos) ///< Transmit process stopped status
  570. #define ETH_DMASR_TS_Pos (0)
  571. #define ETH_DMASR_TS (0x01U << ETH_DMASR_TS_Pos ) ///< Transmit status
  572. ////////////////////////////////////////////////////////////////////////////////
  573. /// @brief ETH_DMAOMR Registers bits definition
  574. ////////////////////////////////////////////////////////////////////////////////
  575. #define ETH_DMAOMR_TSF_Pos (21)
  576. #define ETH_DMAOMR_TSF (0x01U << ETH_DMAOMR_TSF_Pos) ///< Transmit store and forward
  577. #define ETH_DMAOMR_FTF_Pos (20)
  578. #define ETH_DMAOMR_FTF (0x01U << ETH_DMAOMR_FTF_Pos) ///< Flush transmit FIFO
  579. #define ETH_DMAOMR_TTC_Pos (14)
  580. #define ETH_DMAOMR_TTC (0x07U << ETH_DMAOMR_TTC_Pos) ///< Transmit threshold control
  581. #define ETH_DMAOMR_TTC_64Bytes (0x00U << ETH_DMAOMR_TTC_Pos) ///< threshold level of the MTL Transmit FIFO is 64 Bytes
  582. #define ETH_DMAOMR_TTC_128Bytes (0x01U << ETH_DMAOMR_TTC_Pos) ///< threshold level of the MTL Transmit FIFO is 128 Bytes
  583. #define ETH_DMAOMR_TTC_192Bytes (0x02U << ETH_DMAOMR_TTC_Pos) ///< threshold level of the MTL Transmit FIFO is 192 Bytes
  584. #define ETH_DMAOMR_TTC_256Bytes (0x03U << ETH_DMAOMR_TTC_Pos) ///< threshold level of the MTL Transmit FIFO is 256 Bytes
  585. #define ETH_DMAOMR_TTC_40Bytes (0x04U << ETH_DMAOMR_TTC_Pos) ///< threshold level of the MTL Transmit FIFO is 40 Bytes
  586. #define ETH_DMAOMR_TTC_32Bytes (0x05U << ETH_DMAOMR_TTC_Pos) ///< threshold level of the MTL Transmit FIFO is 32 Bytes
  587. #define ETH_DMAOMR_TTC_24Bytes (0x06U << ETH_DMAOMR_TTC_Pos) ///< threshold level of the MTL Transmit FIFO is 24 Bytes
  588. #define ETH_DMAOMR_TTC_16Bytes (0x07U << ETH_DMAOMR_TTC_Pos) ///< threshold level of the MTL Transmit FIFO is 16 Bytes
  589. #define ETH_DMAOMR_ST_Pos (13)
  590. #define ETH_DMAOMR_ST (0x01U << ETH_DMAOMR_ST_Pos ) ///< Start/stop transmission command
  591. #define ETH_DMAOMR_RFD_Pos (11)
  592. #define ETH_DMAOMR_RFD1 (0x00U << ETH_DMAOMR_RFD_Pos ) ///< Threshold for failure flow control 1 byte
  593. #define ETH_DMAOMR_RFD2 (0x01U << ETH_DMAOMR_RFD_Pos ) ///< Threshold for failure flow control 2 byte
  594. #define ETH_DMAOMR_RFD3 (0x02U << ETH_DMAOMR_RFD_Pos ) ///< Threshold for failure flow control 3 byte
  595. #define ETH_DMAOMR_RFD4 (0x03U << ETH_DMAOMR_RFD_Pos ) ///< Threshold for failure flow control 4 byte
  596. #define ETH_DMAOMR_RFA_Pos (9)
  597. #define ETH_DMAOMR_RFA1 (0x00U << ETH_DMAOMR_RFA_Pos ) ///< Activate the threshold for flow control 1 byte
  598. #define ETH_DMAOMR_RFA2 (0x01U << ETH_DMAOMR_RFA_Pos ) ///< Activate the threshold for flow control 2 byte
  599. #define ETH_DMAOMR_RFA3 (0x02U << ETH_DMAOMR_RFA_Pos ) ///< Activate the threshold for flow control 3 byte
  600. #define ETH_DMAOMR_RFA4 (0x03U << ETH_DMAOMR_RFA_Pos ) ///< Activate the threshold for flow control 4 byte
  601. #define ETH_DMAOMR_EFC_Pos (8)
  602. #define ETH_DMAOMR_EFC (0x01U << ETH_DMAOMR_EFC_Pos ) ///< Enable HW Flow Control
  603. #define ETH_DMAOMR_FEF_Pos (7)
  604. #define ETH_DMAOMR_FEF (0x01U << ETH_DMAOMR_FEF_Pos ) ///< Forward error frames
  605. #define ETH_DMAOMR_FUGF_Pos (6)
  606. #define ETH_DMAOMR_FUGF (0x01U << ETH_DMAOMR_FUGF_Pos) ///< Forward undersized good frames
  607. #define ETH_DMAOMR_RTC_Pos (3)
  608. #define ETH_DMAOMR_RTC (0x03U << ETH_DMAOMR_RTC_Pos) ///< receive threshold control
  609. #define ETH_DMAOMR_RTC_64Bytes (0x00U << ETH_DMAOMR_RTC_Pos) ///< threshold level of the MTL Receive FIFO is 64 Bytes
  610. #define ETH_DMAOMR_RTC_32Bytes (0x01U << ETH_DMAOMR_RTC_Pos) ///< threshold level of the MTL Receive FIFO is 32 Bytes
  611. #define ETH_DMAOMR_RTC_96Bytes (0x02U << ETH_DMAOMR_RTC_Pos) ///< threshold level of the MTL Receive FIFO is 96 Bytes
  612. #define ETH_DMAOMR_RTC_128Bytes (0x03U << ETH_DMAOMR_RTC_Pos) ///< threshold level of the MTL Receive FIFO is 128 Bytes
  613. #define ETH_DMAOMR_OSF_Pos (2)
  614. #define ETH_DMAOMR_OSF (0x01U << ETH_DMAOMR_OSF_Pos) ///< operate on second frame
  615. #define ETH_DMAOMR_SR_Pos (1)
  616. #define ETH_DMAOMR_SR (0x01U << ETH_DMAOMR_SR_Pos ) ///< Start/stop receive
  617. ////////////////////////////////////////////////////////////////////////////////
  618. /// @brief ETH_DMAIER Registers bits definition
  619. ////////////////////////////////////////////////////////////////////////////////
  620. #define ETH_DMAIER_NISE_Pos (16)
  621. #define ETH_DMAIER_NISE (0x01U << ETH_DMAIER_NISE_Pos ) ///< Normal interrupt summary enable
  622. #define ETH_DMAIER_AISE_Pos (15)
  623. #define ETH_DMAIER_AISE (0x01U << ETH_DMAIER_AISE_Pos ) ///< Abnormal interrupt summary enable
  624. #define ETH_DMAIER_ERIE_Pos (14)
  625. #define ETH_DMAIER_ERIE (0x01U << ETH_DMAIER_ERIE_Pos ) ///< Early receive interrupt enable
  626. #define ETH_DMAIER_FBEIE_Pos (13)
  627. #define ETH_DMAIER_FBEIE (0x01U << ETH_DMAIER_FBEIE_Pos) ///< Fatal bus error interrupt enable
  628. #define ETH_DMAIER_ETIE_Pos (10)
  629. #define ETH_DMAIER_ETIE (0x01U << ETH_DMAIER_ETIE_Pos ) ///< Early transmit interrupt enable
  630. #define ETH_DMAIER_RWTIE_Pos (9)
  631. #define ETH_DMAIER_RWTIE (0x01U << ETH_DMAIER_RWTIE_Pos) ///< Receive watchdog timeout interrupt enable
  632. #define ETH_DMAIER_RPSIE_Pos (8)
  633. #define ETH_DMAIER_RPSIE (0x01U << ETH_DMAIER_RPSIE_Pos) ///< Receive process stopped interrupt enable
  634. #define ETH_DMAIER_RBUIE_Pos (7)
  635. #define ETH_DMAIER_RBUIE (0x01U << ETH_DMAIER_RBUIE_Pos) ///< Receive buffer unavailable interrupt enable
  636. #define ETH_DMAIER_RIE_Pos (6)
  637. #define ETH_DMAIER_RIE (0x01U << ETH_DMAIER_RIE_Pos ) ///< Receive interrupt enable
  638. #define ETH_DMAIER_TUIE_Pos (5)
  639. #define ETH_DMAIER_TUIE (0x01U << ETH_DMAIER_TUIE_Pos ) ///< Transmit Underflow interrupt enable
  640. #define ETH_DMAIER_ROIE_Pos (4)
  641. #define ETH_DMAIER_ROIE (0x01U << ETH_DMAIER_ROIE_Pos ) ///< Receive Overflow interrupt enable
  642. #define ETH_DMAIER_TJTIE_Pos (3)
  643. #define ETH_DMAIER_TJTIE (0x01U << ETH_DMAIER_TJTIE_Pos) ///< Transmit jabber timeout interrupt enable
  644. #define ETH_DMAIER_TBUIE_Pos (2)
  645. #define ETH_DMAIER_TBUIE (0x01U << ETH_DMAIER_TBUIE_Pos) ///< Transmit buffer unavailable interrupt enable
  646. #define ETH_DMAIER_TPSIE_Pos (1)
  647. #define ETH_DMAIER_TPSIE (0x01U << ETH_DMAIER_TPSIE_Pos) ///< Transmit process stopped interrupt enable
  648. #define ETH_DMAIER_TIE_Pos (0)
  649. #define ETH_DMAIER_TIE (0x01U << ETH_DMAIER_TIE_Pos ) ///< Transmit interrupt enable
  650. ////////////////////////////////////////////////////////////////////////////////
  651. /// @brief ETH_DMAMFBOCR Registers bits definition
  652. ////////////////////////////////////////////////////////////////////////////////
  653. #define ETH_DMAMFBOCR_OFOC_Pos (28)
  654. #define ETH_DMAMFBOCR_OFOC (0x01U << ETH_DMAMFBOCR_OFOC_Pos) ///< Overflow bit for FIFO overflow counter
  655. #define ETH_DMAMFBOCR_MFA_Pos (17)
  656. #define ETH_DMAMFBOCR_MFA (0x7FFU << ETH_DMAMFBOCR_MFA_Pos ) ///< Number of frames missed by the application
  657. #define ETH_DMAMFBOCR_OMFC_Pos (16)
  658. #define ETH_DMAMFBOCR_OMFC (0x01U << ETH_DMAMFBOCR_OMFC_Pos) ///< Overflow bit for missed frame counter
  659. #define ETH_DMAMFBOCR_MFC_Pos (0)
  660. #define ETH_DMAMFBOCR_MFC (0xFFFFU << ETH_DMAMFBOCR_MFC_Pos ) ///< Number of frames missed by the controller
  661. ////////////////////////////////////////////////////////////////////////////////
  662. /// @brief ETH_DMACHTDR Registers bits definition
  663. ////////////////////////////////////////////////////////////////////////////////
  664. #define ETH_DMACHTDR_HTDAP (0xFFFFFFFFU) ///< Host transmit descriptor address pointer
  665. ////////////////////////////////////////////////////////////////////////////////
  666. /// @brief ETH_DMACHRDR Registers bits definition
  667. ////////////////////////////////////////////////////////////////////////////////
  668. #define ETH_DMACHRDR_HRDAP (0xFFFFFFFFU) ///< Host receive descriptor address pointer
  669. ////////////////////////////////////////////////////////////////////////////////
  670. /// @brief ETH_DMACHTBAR Registers bits definition
  671. ////////////////////////////////////////////////////////////////////////////////
  672. #define ETH_DMACHTBAR_HTBAP (0xFFFFFFFFU) ///< Host transmit buffer address pointer
  673. ////////////////////////////////////////////////////////////////////////////////
  674. /// @brief ETH_DMACHRBAR Registers bits definition
  675. ////////////////////////////////////////////////////////////////////////////////
  676. #define ETH_DMACHRBAR_HRBAP (0xFFFFFFFFU) ///< Host receive buffer address pointer
  677. /// @}
  678. /// @}
  679. /// @}
  680. ////////////////////////////////////////////////////////////////////////////////
  681. #endif
  682. ////////////////////////////////////////////////////////////////////////////////