HPM SDK
HPMicro Software Development Kit
hpm_esc_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2024 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 
9 #ifndef HPM_ESC_H
10 #define HPM_ESC_H
11 
12 typedef struct {
13  __R uint8_t TYPE; /* 0x0: Type of EtherCAT controller */
14  __R uint8_t REVISION; /* 0x1: Revision of EtherCAT controller */
15  __R uint16_t BUILD; /* 0x2: Build of EtherCAT controller */
16  __R uint8_t FMMU_NUM; /* 0x4: FMMU supported */
17  __R uint8_t SYNCM_NUM; /* 0x5: SyncManagers supported */
18  __R uint8_t RAM_SIZE; /* 0x6: RAM Size */
19  __R uint8_t PORT_DESC; /* 0x7: Port Descriptor */
20  __R uint16_t FEATURE; /* 0x8: ESC Feature supported */
21  __R uint8_t RESERVED0[6]; /* 0xA - 0xF: Reserved */
22  __R uint16_t STATION_ADDR; /* 0x10: Configured Station Address */
23  __RW uint16_t STATION_ALS; /* 0x12: Configured Station Alias */
24  __R uint8_t RESERVED1[12]; /* 0x14 - 0x1F: Reserved */
25  __R uint8_t REG_WEN; /* 0x20: Register Write Enable */
26  __R uint8_t REG_WP; /* 0x21: Register Write Protection */
27  __R uint8_t RESERVED2[14]; /* 0x22 - 0x2F: Reserved */
28  __R uint8_t ESC_WEN; /* 0x30: ESC Write Enable */
29  __R uint8_t ESC_WP; /* 0x31: ESC Write Protection */
30  __R uint8_t RESERVED3[14]; /* 0x32 - 0x3F: Reserved */
31  __R uint8_t ESC_RST_ECAT; /* 0x40: ESC Reset ECAT */
32  __RW uint8_t ESC_RST_PDI; /* 0x41: ESC Reset PDI */
33  __R uint8_t RESERVED4[190]; /* 0x42 - 0xFF: Reserved */
34  __R uint32_t ESC_DL_CTRL; /* 0x100: ESC DL Control */
35  __R uint8_t RESERVED5[4]; /* 0x104 - 0x107: Reserved */
36  __R uint16_t PHYSICAL_RW_OFFSET; /* 0x108: Physical Read/Write Offset */
37  __R uint8_t RESERVED6[6]; /* 0x10A - 0x10F: Reserved */
38  __R uint16_t ESC_DL_STAT; /* 0x110: ESC DL Status */
39  __R uint8_t RESERVED7[14]; /* 0x112 - 0x11F: Reserved */
40  __RW uint16_t AL_CTRL; /* 0x120: AL Control */
41  __R uint8_t RESERVED8[14]; /* 0x122 - 0x12F: Reserved */
42  __RW uint16_t AL_STAT; /* 0x130: AL Status */
43  __R uint8_t RESERVED9[2]; /* 0x132 - 0x133: Reserved */
44  __RW uint16_t AL_STAT_CODE; /* 0x134: AL Status Code */
45  __R uint8_t RESERVED10[2]; /* 0x136 - 0x137: Reserved */
46  __RW uint8_t RUN_LED_OVRD; /* 0x138: RUN LED Override */
47  __RW uint8_t ERR_LED_OVRD; /* 0x139: ERR LED Override */
48  __R uint8_t RESERVED11[6]; /* 0x13A - 0x13F: Reserved */
49  __R uint8_t PDI_CTRL; /* 0x140: PDI Control */
50  __R uint8_t ESC_CFG; /* 0x141: ESC Configuration */
51  __R uint8_t RESERVED12[12]; /* 0x142 - 0x14D: Reserved */
52  __R uint16_t PDI_INFO; /* 0x14E: PDI Information */
53  __R uint8_t PDI_CFG; /* 0x150: PDI Configuration */
54  __R uint8_t PDI_SL_CFG; /* 0x151: PDI Sync/Latch[1:0] Configuration */
55  __RW uint16_t PDI_EXT_CFG; /* 0x152: PDI Extended Configuration */
56  __R uint8_t RESERVED13[172]; /* 0x154 - 0x1FF: Reserved */
57  __R uint16_t ECAT_EVT_MSK; /* 0x200: ECAT Event Mask */
58  __R uint8_t RESERVED14[2]; /* 0x202 - 0x203: Reserved */
59  __RW uint32_t PDI_AL_EVT_MSK; /* 0x204: PDI AL Event Mask */
60  __R uint8_t RESERVED15[8]; /* 0x208 - 0x20F: Reserved */
61  __R uint16_t ECAT_EVT_REQ; /* 0x210: ECAT Event Request */
62  __R uint8_t RESERVED16[14]; /* 0x212 - 0x21F: Reserved */
63  __R uint32_t AL_EVT_REQ; /* 0x220: AL Event Request */
64  __R uint8_t RESERVED17[220]; /* 0x224 - 0x2FF: Reserved */
65  __R uint16_t RX_ERR_CNT[4]; /* 0x300 - 0x306: RX Error Counter */
66  __R uint8_t FWD_RX_ERR_CNT[4]; /* 0x308 - 0x30B: Forwarded RX Error Counter */
67  __R uint8_t ECAT_PU_ERR_CNT; /* 0x30C: ECAT Processing Unit Error Counter */
68  __R uint8_t PDI_ERR_CNT; /* 0x30D: PDI Error Counter */
69  __R uint8_t RESERVED18[2]; /* 0x30E - 0x30F: Reserved */
70  __R uint8_t LOST_LINK_CNT[4]; /* 0x310 - 0x313: Lost Link Counter */
71  __R uint8_t RESERVED19[236]; /* 0x314 - 0x3FF: Reserved */
72  __R uint16_t WDG_DIV; /* 0x400: Watchdog Divider */
73  __R uint8_t RESERVED20[14]; /* 0x402 - 0x40F: Reserved */
74  __R uint16_t WDG_TIME_PDI; /* 0x410: Watchdog Time PDI */
75  __R uint8_t RESERVED21[14]; /* 0x412 - 0x41F: Reserved */
76  __R uint16_t WDG_TIME_PDAT; /* 0x420: Watchdog Time Process Data */
77  __R uint8_t RESERVED22[30]; /* 0x422 - 0x43F: Reserved */
78  __RW uint16_t WDG_STAT_PDAT; /* 0x440: Watchdog Status Process Data */
79  __R uint8_t WDG_CNT_PDAT; /* 0x442: Watchdog Counter Process Data */
80  __R uint8_t WDG_CNT_PDI; /* 0x443: Watchdog Counter PDI */
81  __R uint8_t RESERVED23[188]; /* 0x444 - 0x4FF: Reserved */
82  __R uint8_t EEPROM_CFG; /* 0x500: EEPROM Configuration */
83  __RW uint8_t EEPROM_PDI_ACC_STAT; /* 0x501: EEPROM PDI Access State */
84  __RW uint16_t EEPROM_CTRL_STAT; /* 0x502: EEPROM Control/Status */
85  __RW uint32_t EEPROM_ADDR; /* 0x504: EEPROM Address */
86  __RW uint64_t EEPROM_DATA; /* 0x508: EEPROM Data */
87  __RW uint16_t MII_MNG_CS; /* 0x510: MII Management Control/Status */
88  __RW uint8_t PHY_ADDR; /* 0x512: PHY Address */
89  __RW uint8_t PHY_REG_ADDR; /* 0x513: PHY Register Address */
90  __RW uint16_t PHY_DATA; /* 0x514: PHY Data */
91  __R uint8_t MIIM_ECAT_ACC_STAT; /* 0x516: MII Management ECAT Access State */
92  __RW uint8_t MIIM_PDI_ACC_STAT; /* 0x517: MII Management PDI Access State */
93  __RW uint8_t PHY_STAT[4]; /* 0x518 - 0x51B: PHY Port */
94  __R uint8_t RESERVED24[228]; /* 0x51C - 0x5FF: Reserved */
95  struct {
96  __R uint32_t LOGIC_START_ADDR; /* 0x600: Logical Start Address */
97  __R uint16_t LENGTH; /* 0x604: Length */
98  __R uint8_t LOGIC_START_BIT; /* 0x606: Logical Start Bit */
99  __R uint8_t LOGIC_STOP_BIT; /* 0x607: Logical Stop Bit */
100  __R uint16_t PHYSICAL_START_ADDR; /* 0x608: Physical Start Address */
101  __R uint8_t PHYSICAL_START_BIT; /* 0x60A: Physical Start Bit */
102  __R uint8_t TYPE; /* 0x60B: Type */
103  __R uint8_t ACTIVATE; /* 0x60C: Activate */
104  __R uint8_t RESERVED0[3]; /* 0x60D - 0x60F: Reserved */
105  } FMMU[8];
106  __R uint8_t RESERVED25[384]; /* 0x680 - 0x7FF: Reserved */
107  struct {
108  __R uint16_t PHYSICAL_START_ADDR; /* 0x800: Physical Start Address */
109  __R uint16_t LENGTH; /* 0x802: Length */
110  __R uint8_t CONTROL; /* 0x804: Control */
111  __R uint8_t STATUS; /* 0x805: Status */
112  __RW uint8_t ACTIVATE; /* 0x806: Activate */
113  __RW uint8_t PDI_CTRL; /* 0x807: PDI Control */
114  } SYNCM[8];
115  __R uint8_t RESERVED26[192]; /* 0x840 - 0x8FF: Reserved */
116  __R uint32_t RCV_TIME[4]; /* 0x900 - 0x90C: Receive Time */
117  __RW uint64_t SYS_TIME; /* 0x910: System Time */
118  __R uint64_t RCVT_ECAT_PU; /* 0x918: Receive Time ECAT Processing Unit */
119  __RW uint64_t SYS_TIME_OFFSET; /* 0x920: System Time Offset */
120  __RW uint32_t SYS_TIME_DELAY; /* 0x928: System Time Delay */
121  __R uint32_t SYS_TIME_DIFF; /* 0x92C: System Time Difference */
122  __RW uint16_t SPD_CNT_START; /* 0x930: Speed Counter Start */
123  __R uint16_t SPD_CNT_DIFF; /* 0x932: Speed Counter Diff */
124  __RW uint8_t SYS_TIME_DIFF_FD; /* 0x934: System Time Difference Filter Depth */
125  __RW uint8_t SPD_CNT_FD; /* 0x935: Speed Counter Filter Depth */
126  __R uint8_t RCV_TIME_LM; /* 0x936: Receive Time Latch Mode */
127  __R uint8_t RESERVED27[73]; /* 0x937 - 0x97F: Reserved */
128  __R uint8_t CYC_UNIT_CTRL; /* 0x980: Cyclic Unit Control */
129  __RW uint8_t SYNCO_ACT; /* 0x981: SYNC Out Unit Activation */
130  __R uint16_t PULSE_LEN; /* 0x982: Pulse Length of SyncSignals */
131  __R uint8_t ACT_STAT; /* 0x984: Activation Status */
132  __R uint8_t RESERVED28[9]; /* 0x985 - 0x98D: Reserved */
133  __RW uint8_t SYNC0_STAT; /* 0x98E: SYNC0 Status */
134  __RW uint8_t SYNC1_STAT; /* 0x98F: SYNC1 Status */
135  __RW uint64_t START_TIME_CO; /* 0x990: Start Time Cyclic Operation */
136  __R uint64_t NXT_SYNC1_PULSE; /* 0x998: Next SYNC1 Pulse */
137  __RW uint32_t SYNC0_CYC_TIME; /* 0x9A0: SYNC0 Cycle Time */
138  __RW uint32_t SYNC1_CYC_TIME; /* 0x9A4: SYNC1 Cycle Time */
139  __RW uint8_t LATCH0_CTRL; /* 0x9A8: Latch0 Control */
140  __RW uint8_t LATCH1_CTRL; /* 0x9A9: Latch1 Control */
141  __R uint8_t RESERVED29[4]; /* 0x9AA - 0x9AD: Reserved */
142  __R uint8_t LATCH0_STAT; /* 0x9AE: Latch0 Status */
143  __R uint8_t LATCH1_STAT; /* 0x9AF: Latch1 Status */
144  __RW uint64_t LATCH0_TIME_PE; /* 0x9B0: Latch0 Time Positive Edge */
145  __RW uint64_t LATCH0_TIME_NE; /* 0x9B8: Latch0 Time Negative Edge */
146  __RW uint64_t LATCH1_TIME_PE; /* 0x9C0: Latch1 Time Positive Edge */
147  __RW uint64_t LATCH1_TIME_NE; /* 0x9C8: Latch1 Time Negative Edge */
148  __R uint8_t RESERVED30[32]; /* 0x9D0 - 0x9EF: Reserved */
149  __R uint32_t ECAT_BUF_CET; /* 0x9F0: EtherCAT Buffer Change Event Time */
150  __R uint8_t RESERVED31[4]; /* 0x9F4 - 0x9F7: Reserved */
151  __R uint32_t PDI_BUF_SET; /* 0x9F8: PDI Buffer Start Event Time */
152  __R uint32_t PDI_BUF_CET; /* 0x9FC: PDI Buffer Change Event Time */
153  __R uint8_t RESERVED32[1024]; /* 0xA00 - 0xDFF: Reserved */
154  __R uint64_t PID; /* 0xE00: Product ID */
155  __R uint64_t VID; /* 0xE08: Vendor ID */
156  __R uint8_t RESERVED33[240]; /* 0xE10 - 0xEFF: Reserved */
157  __R uint32_t DIO_OUT_DATA; /* 0xF00: Digital I/O Output Data */
158  __R uint8_t RESERVED34[12]; /* 0xF04 - 0xF0F: Reserved */
159  __RW uint64_t GPO; /* 0xF10: General Purpose Outputs */
160  __R uint64_t GPI; /* 0xF18: General Purpose Inputs */
161  __R uint8_t RESERVED35[96]; /* 0xF20 - 0xF7F: Reserved */
162  __RW uint8_t USER_RAM_BYTE0; /* 0xF80: User Ram Byte 0 */
163  __RW uint8_t USER_RAM_BYTE1; /* 0xF81: User Ram Byte 1 */
164  __RW uint8_t USER_RAM_BYTE2; /* 0xF82: User Ram Byte 2 */
165  __RW uint8_t USER_RAM_BYTE3; /* 0xF83: User Ram Byte 3 */
166  __RW uint8_t USER_RAM_BYTE4; /* 0xF84: User Ram Byte 4 */
167  __RW uint8_t USER_RAM_BYTE5; /* 0xF85: User Ram Byte 5 */
168  __RW uint8_t USER_RAM_BYTE6; /* 0xF86: User Ram Byte 6 */
169  __RW uint8_t USER_RAM_BYTE7; /* 0xF87: User Ram Byte 7 */
170  __RW uint8_t USER_RAM_BYTE8; /* 0xF88: User Ram Byte 8 */
171  __RW uint8_t USER_RAM_BYTE9; /* 0xF89: User Ram Byte 9 */
172  __RW uint8_t USER_RAM_BYTE10; /* 0xF8A: User Ram Byte 10 */
173  __RW uint8_t USER_RAM_BYTE11; /* 0xF8B: User Ram Byte 11 */
174  __R uint8_t RESERVED36[2]; /* 0xF8C - 0xF8D: Reserved */
175  __RW uint8_t USER_RAM_BYTE14; /* 0xF8E: User Ram Byte 14 */
176  __RW uint8_t USER_RAM_BYTE15; /* 0xF8F: User Ram Byte 15 */
177  __R uint8_t RESERVED37[3]; /* 0xF90 - 0xF92: Reserved */
178  __RW uint8_t USER_RAM_BYTE19; /* 0xF93: User Ram Byte 19 */
179  __R uint8_t RESERVED38[108]; /* 0xF94 - 0xFFF: Reserved */
180  __RW uint32_t PDRAM; /* 0x1000: Process Data Ram */
181  __R uint8_t RESERVED39[61436]; /* 0x1004 - 0xFFFF: Reserved */
182  __RW uint32_t PDRAM_ALS; /* 0x10000: Process Data Ram Alias */
183  __R uint8_t RESERVED40[61436]; /* 0x10004 - 0x1EFFF: Reserved */
184  __RW uint32_t GPR_CFG0; /* 0x1F000: General Purpose Configure 0 */
185  __RW uint32_t GPR_CFG1; /* 0x1F004: General Purpose Configure 1 */
186  __RW uint32_t GPR_CFG2; /* 0x1F008: General Purpose Configure 2 */
187  __R uint8_t RESERVED41[4]; /* 0x1F00C - 0x1F00F: Reserved */
188  __RW uint32_t PHY_CFG0; /* 0x1F010: PHY Configure 0 */
189  __RW uint32_t PHY_CFG1; /* 0x1F014: PHY Configure 1 */
190  __R uint8_t RESERVED42[8]; /* 0x1F018 - 0x1F01F: Reserved */
191  __RW uint32_t GPIO_CTRL; /* 0x1F020: GPIO Output Enable */
192  __R uint8_t RESERVED43[12]; /* 0x1F024 - 0x1F02F: Reserved */
193  __RW uint32_t GPI_OVERRIDE0; /* 0x1F030: GPI low word Override value */
194  __RW uint32_t GPI_OVERRIDE1; /* 0x1F034: GPI high word Override value */
195  __R uint32_t GPO_REG0; /* 0x1F038: GPO low word read value */
196  __R uint32_t GPO_REG1; /* 0x1F03C: GPO high word read value */
197  __R uint32_t GPI_REG0; /* 0x1F040: GPI low word read value */
198  __R uint32_t GPI_REG1; /* 0x1F044: GPI high word read value */
199  __R uint8_t RESERVED44[24]; /* 0x1F048 - 0x1F05F: Reserved */
200  __R uint32_t GPR_STATUS; /* 0x1F060: global status register */
201  __R uint8_t RESERVED45[28]; /* 0x1F064 - 0x1F07F: Reserved */
202  __RW uint32_t IO_CFG[9]; /* 0x1F080 - 0x1F0A0: CTR IO Configure */
203 } ESC_Type;
204 
205 
206 /* Bitfield definition for register: TYPE */
207 /*
208  * TYPE (RO)
209  *
210  * Controller type
211  */
212 #define ESC_TYPE_TYPE_MASK (0xFFU)
213 #define ESC_TYPE_TYPE_SHIFT (0U)
214 #define ESC_TYPE_TYPE_GET(x) (((uint8_t)(x) & ESC_TYPE_TYPE_MASK) >> ESC_TYPE_TYPE_SHIFT)
215 
216 /* Bitfield definition for register: REVISION */
217 /*
218  * X (RO)
219  *
220  * major version X
221  */
222 #define ESC_REVISION_X_MASK (0xFFU)
223 #define ESC_REVISION_X_SHIFT (0U)
224 #define ESC_REVISION_X_GET(x) (((uint8_t)(x) & ESC_REVISION_X_MASK) >> ESC_REVISION_X_SHIFT)
225 
226 /* Bitfield definition for register: BUILD */
227 /*
228  * BUILD (RO)
229  *
230  */
231 #define ESC_BUILD_BUILD_MASK (0xFF00U)
232 #define ESC_BUILD_BUILD_SHIFT (8U)
233 #define ESC_BUILD_BUILD_GET(x) (((uint16_t)(x) & ESC_BUILD_BUILD_MASK) >> ESC_BUILD_BUILD_SHIFT)
234 
235 /*
236  * Y (RO)
237  *
238  * minor version Y
239  */
240 #define ESC_BUILD_Y_MASK (0xF0U)
241 #define ESC_BUILD_Y_SHIFT (4U)
242 #define ESC_BUILD_Y_GET(x) (((uint16_t)(x) & ESC_BUILD_Y_MASK) >> ESC_BUILD_Y_SHIFT)
243 
244 /*
245  * Z (RO)
246  *
247  * maintenance version Z
248  */
249 #define ESC_BUILD_Z_MASK (0xFU)
250 #define ESC_BUILD_Z_SHIFT (0U)
251 #define ESC_BUILD_Z_GET(x) (((uint16_t)(x) & ESC_BUILD_Z_MASK) >> ESC_BUILD_Z_SHIFT)
252 
253 /* Bitfield definition for register: FMMU_NUM */
254 /*
255  * NUM (RO)
256  *
257  * Number of supported FMMU channels (or entities)
258  */
259 #define ESC_FMMU_NUM_NUM_MASK (0xFFU)
260 #define ESC_FMMU_NUM_NUM_SHIFT (0U)
261 #define ESC_FMMU_NUM_NUM_GET(x) (((uint8_t)(x) & ESC_FMMU_NUM_NUM_MASK) >> ESC_FMMU_NUM_NUM_SHIFT)
262 
263 /* Bitfield definition for register: SYNCM_NUM */
264 /*
265  * NUM (RO)
266  *
267  * Number of supported SyncManager channels (or entities)
268  */
269 #define ESC_SYNCM_NUM_NUM_MASK (0xFFU)
270 #define ESC_SYNCM_NUM_NUM_SHIFT (0U)
271 #define ESC_SYNCM_NUM_NUM_GET(x) (((uint8_t)(x) & ESC_SYNCM_NUM_NUM_MASK) >> ESC_SYNCM_NUM_NUM_SHIFT)
272 
273 /* Bitfield definition for register: RAM_SIZE */
274 /*
275  * SIZE (RO)
276  *
277  * Process Data RAM size supported in KByte
278  */
279 #define ESC_RAM_SIZE_SIZE_MASK (0xFFU)
280 #define ESC_RAM_SIZE_SIZE_SHIFT (0U)
281 #define ESC_RAM_SIZE_SIZE_GET(x) (((uint8_t)(x) & ESC_RAM_SIZE_SIZE_MASK) >> ESC_RAM_SIZE_SIZE_SHIFT)
282 
283 /* Bitfield definition for register: PORT_DESC */
284 /*
285  * PORT3 (RO)
286  *
287  * Port configuration:
288  * 00:Not implemented
289  * 01:Not configured (SII EEPROM)
290  * 10:EBUS
291  * 11:MII/RMII/RGMII
292  */
293 #define ESC_PORT_DESC_PORT3_MASK (0xC0U)
294 #define ESC_PORT_DESC_PORT3_SHIFT (6U)
295 #define ESC_PORT_DESC_PORT3_GET(x) (((uint8_t)(x) & ESC_PORT_DESC_PORT3_MASK) >> ESC_PORT_DESC_PORT3_SHIFT)
296 
297 /*
298  * PORT2 (RO)
299  *
300  * Port configuration:
301  * 00:Not implemented
302  * 01:Not configured (SII EEPROM)
303  * 10:EBUS
304  * 11:MII/RMII/RGMII
305  */
306 #define ESC_PORT_DESC_PORT2_MASK (0x30U)
307 #define ESC_PORT_DESC_PORT2_SHIFT (4U)
308 #define ESC_PORT_DESC_PORT2_GET(x) (((uint8_t)(x) & ESC_PORT_DESC_PORT2_MASK) >> ESC_PORT_DESC_PORT2_SHIFT)
309 
310 /*
311  * PORT1 (RO)
312  *
313  * Port configuration:
314  * 00:Not implemented
315  * 01:Not configured (SII EEPROM)
316  * 10:EBUS
317  * 11:MII/RMII/RGMII
318  */
319 #define ESC_PORT_DESC_PORT1_MASK (0xCU)
320 #define ESC_PORT_DESC_PORT1_SHIFT (2U)
321 #define ESC_PORT_DESC_PORT1_GET(x) (((uint8_t)(x) & ESC_PORT_DESC_PORT1_MASK) >> ESC_PORT_DESC_PORT1_SHIFT)
322 
323 /*
324  * PORT0 (RO)
325  *
326  * Port configuration:
327  * 00:Not implemented
328  * 01:Not configured (SII EEPROM)
329  * 10:EBUS
330  * 11:MII/RMII/RGMII
331  */
332 #define ESC_PORT_DESC_PORT0_MASK (0x3U)
333 #define ESC_PORT_DESC_PORT0_SHIFT (0U)
334 #define ESC_PORT_DESC_PORT0_GET(x) (((uint8_t)(x) & ESC_PORT_DESC_PORT0_MASK) >> ESC_PORT_DESC_PORT0_SHIFT)
335 
336 /* Bitfield definition for register: FEATURE */
337 /*
338  * FFSC (RO)
339  *
340  * Fixed FMMU/SyncManager configuration:
341  * 0:Variable configuration
342  * 1:Fixed configuration (refer to documentation of supporting ESCs)
343  */
344 #define ESC_FEATURE_FFSC_MASK (0x800U)
345 #define ESC_FEATURE_FFSC_SHIFT (11U)
346 #define ESC_FEATURE_FFSC_GET(x) (((uint16_t)(x) & ESC_FEATURE_FFSC_MASK) >> ESC_FEATURE_FFSC_SHIFT)
347 
348 /*
349  * RWC (RO)
350  *
351  * EtherCAT read/write command support(BRW,APRW,FPRW):
352  * 0:Supported
353  * 1:Not supported
354  */
355 #define ESC_FEATURE_RWC_MASK (0x400U)
356 #define ESC_FEATURE_RWC_SHIFT (10U)
357 #define ESC_FEATURE_RWC_GET(x) (((uint16_t)(x) & ESC_FEATURE_RWC_MASK) >> ESC_FEATURE_RWC_SHIFT)
358 
359 /*
360  * LRW (RO)
361  *
362  * EtherCAT LRW command support:
363  * 0:Supported
364  * 1:Not supported
365  */
366 #define ESC_FEATURE_LRW_MASK (0x200U)
367 #define ESC_FEATURE_LRW_SHIFT (9U)
368 #define ESC_FEATURE_LRW_GET(x) (((uint16_t)(x) & ESC_FEATURE_LRW_MASK) >> ESC_FEATURE_LRW_SHIFT)
369 
370 /*
371  * EDSA (RO)
372  *
373  * Enhanced DC SYNC Activation:
374  * 0:Not available
375  * 1:Available
376  * Note:This feature refers to registers 0x981[7:3] and 0x0984
377  */
378 #define ESC_FEATURE_EDSA_MASK (0x100U)
379 #define ESC_FEATURE_EDSA_SHIFT (8U)
380 #define ESC_FEATURE_EDSA_GET(x) (((uint16_t)(x) & ESC_FEATURE_EDSA_MASK) >> ESC_FEATURE_EDSA_SHIFT)
381 
382 /*
383  * SHFE (RO)
384  *
385  * Seperate Handling of FCS Errors:
386  * 0:Not supported
387  * 1:Supported, frames with wrong FCS and additional nibble will be counted separately in Forwarded RX Error Counter
388  */
389 #define ESC_FEATURE_SHFE_MASK (0x80U)
390 #define ESC_FEATURE_SHFE_SHIFT (7U)
391 #define ESC_FEATURE_SHFE_GET(x) (((uint16_t)(x) & ESC_FEATURE_SHFE_MASK) >> ESC_FEATURE_SHFE_SHIFT)
392 
393 /*
394  * ELDM (RO)
395  *
396  * Enhanced Link Detection MII:
397  * 0:Not available
398  * 1:Available
399  */
400 #define ESC_FEATURE_ELDM_MASK (0x40U)
401 #define ESC_FEATURE_ELDM_SHIFT (6U)
402 #define ESC_FEATURE_ELDM_GET(x) (((uint16_t)(x) & ESC_FEATURE_ELDM_MASK) >> ESC_FEATURE_ELDM_SHIFT)
403 
404 /*
405  * DCW (RO)
406  *
407  * Distributed Clocks width:
408  * 0:32 bit
409  * 1:64 bit
410  */
411 #define ESC_FEATURE_DCW_MASK (0x8U)
412 #define ESC_FEATURE_DCW_SHIFT (3U)
413 #define ESC_FEATURE_DCW_GET(x) (((uint16_t)(x) & ESC_FEATURE_DCW_MASK) >> ESC_FEATURE_DCW_SHIFT)
414 
415 /*
416  * DC (RO)
417  *
418  * Distributed Clocks:
419  * 0:Not available
420  * 1:Available
421  */
422 #define ESC_FEATURE_DC_MASK (0x4U)
423 #define ESC_FEATURE_DC_SHIFT (2U)
424 #define ESC_FEATURE_DC_GET(x) (((uint16_t)(x) & ESC_FEATURE_DC_MASK) >> ESC_FEATURE_DC_SHIFT)
425 
426 /*
427  * FMMU (RO)
428  *
429  * FMMU Operation:
430  * 0:Bit oriented
431  * 1:Byte oriented
432  */
433 #define ESC_FEATURE_FMMU_MASK (0x1U)
434 #define ESC_FEATURE_FMMU_SHIFT (0U)
435 #define ESC_FEATURE_FMMU_GET(x) (((uint16_t)(x) & ESC_FEATURE_FMMU_MASK) >> ESC_FEATURE_FMMU_SHIFT)
436 
437 /* Bitfield definition for register: STATION_ADDR */
438 /*
439  * ADDR (RO)
440  *
441  * Address used for node addressing
442  * (FPRD/FPWR/FPRW/FRMW commands)
443  */
444 #define ESC_STATION_ADDR_ADDR_MASK (0xFFFFU)
445 #define ESC_STATION_ADDR_ADDR_SHIFT (0U)
446 #define ESC_STATION_ADDR_ADDR_GET(x) (((uint16_t)(x) & ESC_STATION_ADDR_ADDR_MASK) >> ESC_STATION_ADDR_ADDR_SHIFT)
447 
448 /* Bitfield definition for register: STATION_ALS */
449 /*
450  * ADDR (RW)
451  *
452  * Alias Address used for node addressing
453  * (FPRD/FPWR/FPRW/FRMW commands).
454  * The use of this alias is activated by Register
455  * DL Control Bit 0x0100[24].
456  * NOTE:EEPROM value is only transferred into this
457  * register at first EEPROM load after power-on or
458  * reset.
459  * ESC20 exception:EEPROM value is transferred
460  * into this register after each EEPROM reload
461  * command.
462  */
463 #define ESC_STATION_ALS_ADDR_MASK (0xFFFFU)
464 #define ESC_STATION_ALS_ADDR_SHIFT (0U)
465 #define ESC_STATION_ALS_ADDR_SET(x) (((uint16_t)(x) << ESC_STATION_ALS_ADDR_SHIFT) & ESC_STATION_ALS_ADDR_MASK)
466 #define ESC_STATION_ALS_ADDR_GET(x) (((uint16_t)(x) & ESC_STATION_ALS_ADDR_MASK) >> ESC_STATION_ALS_ADDR_SHIFT)
467 
468 /* Bitfield definition for register: REG_WEN */
469 /*
470  * EN (RO)
471  *
472  * If register write protection is enabled, this
473  * register has to be written in the same
474  * Ethernet frame (value does not matter)
475  * before other writes to this station are allowed.
476  * This bit is self-clearing at the beginning of the
477  * next frame (SOF), or if Register Write
478  * Protection is disabled.
479  */
480 #define ESC_REG_WEN_EN_MASK (0x1U)
481 #define ESC_REG_WEN_EN_SHIFT (0U)
482 #define ESC_REG_WEN_EN_GET(x) (((uint8_t)(x) & ESC_REG_WEN_EN_MASK) >> ESC_REG_WEN_EN_SHIFT)
483 
484 /* Bitfield definition for register: REG_WP */
485 /*
486  * WP (RO)
487  *
488  * Register write protection:
489  * 0:Protection disabled
490  * 1:Protection enabled
491  * Registers 0x0000:0x0F7F are write-protected,
492  * except for 0x0020 and 0x0030
493  */
494 #define ESC_REG_WP_WP_MASK (0x1U)
495 #define ESC_REG_WP_WP_SHIFT (0U)
496 #define ESC_REG_WP_WP_GET(x) (((uint8_t)(x) & ESC_REG_WP_WP_MASK) >> ESC_REG_WP_WP_SHIFT)
497 
498 /* Bitfield definition for register: ESC_WEN */
499 /*
500  * EN (RO)
501  *
502  * If ESC write protection is enabled, this
503  * register has to be written in the same
504  * Ethernet frame (value does not matter)
505  * before other writes to this station are allowed.
506  * This bit is self-clearing at the beginning of the
507  * next frame (SOF), or if ESC Write Protection
508  * is disabled.
509  */
510 #define ESC_ESC_WEN_EN_MASK (0x1U)
511 #define ESC_ESC_WEN_EN_SHIFT (0U)
512 #define ESC_ESC_WEN_EN_GET(x) (((uint8_t)(x) & ESC_ESC_WEN_EN_MASK) >> ESC_ESC_WEN_EN_SHIFT)
513 
514 /* Bitfield definition for register: ESC_WP */
515 /*
516  * WP (RO)
517  *
518  * Write protect:
519  * 0:Protection disabled
520  * 1:Protection enabled
521  * All areas are write-protected, except for 0x0030.
522  */
523 #define ESC_ESC_WP_WP_MASK (0x1U)
524 #define ESC_ESC_WP_WP_SHIFT (0U)
525 #define ESC_ESC_WP_WP_GET(x) (((uint8_t)(x) & ESC_ESC_WP_WP_MASK) >> ESC_ESC_WP_WP_SHIFT)
526 
527 /* Bitfield definition for register: ESC_RST_ECAT */
528 /*
529  * PR (RO)
530  *
531  * Progress of the reset procedure:
532  * 00:initial/reset state
533  * 01:after writing 0x52 ('R'), when previous
534  * state was 00
535  * 10:after writing 0x45 ('E'), when previous
536  * state was 01
537  * 11:after writing 0x53 ('S'), when previous
538  * state was 10.
539  * This value must not be observed
540  * because the ESC enters reset when this
541  * state is reached, resulting in state 00
542  */
543 #define ESC_ESC_RST_ECAT_PR_MASK (0x3U)
544 #define ESC_ESC_RST_ECAT_PR_SHIFT (0U)
545 #define ESC_ESC_RST_ECAT_PR_GET(x) (((uint8_t)(x) & ESC_ESC_RST_ECAT_PR_MASK) >> ESC_ESC_RST_ECAT_PR_SHIFT)
546 
547 /* Bitfield definition for register: ESC_RST_PDI */
548 /*
549  * RST (RW)
550  *
551  * A reset is asserted after writing the reset
552  * sequence 0x52 ('R'), 0x45 ('E') and 0x53 ('S')
553  * in this register with 3 consecutive commands.
554  * Any other command which does not continue
555  * the sequence by writing the next expected
556  * value will cancel the reset procedure
557  */
558 #define ESC_ESC_RST_PDI_RST_MASK (0xFFU)
559 #define ESC_ESC_RST_PDI_RST_SHIFT (0U)
560 #define ESC_ESC_RST_PDI_RST_SET(x) (((uint8_t)(x) << ESC_ESC_RST_PDI_RST_SHIFT) & ESC_ESC_RST_PDI_RST_MASK)
561 #define ESC_ESC_RST_PDI_RST_GET(x) (((uint8_t)(x) & ESC_ESC_RST_PDI_RST_MASK) >> ESC_ESC_RST_PDI_RST_SHIFT)
562 
563 /* Bitfield definition for register: ESC_DL_CTRL */
564 /*
565  * SA (RO)
566  *
567  * Station alias:
568  * 0:Ignore Station Alias
569  * 1:Alias can be used for all configured
570  * address comm
571  */
572 #define ESC_ESC_DL_CTRL_SA_MASK (0x1000000UL)
573 #define ESC_ESC_DL_CTRL_SA_SHIFT (24U)
574 #define ESC_ESC_DL_CTRL_SA_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_SA_MASK) >> ESC_ESC_DL_CTRL_SA_SHIFT)
575 
576 /*
577  * RFS (RO)
578  *
579  * RX FIFO Size (ESC delays start of
580  * forwarding until FIFO is at least half full).
581  * RX FIFO Size/RX delay reduction** :
582  * Value:EBUS:MII:
583  * 0:-50 ns -40 ns (-80 ns***)
584  * 1:-40 ns -40 ns (-80 ns***)
585  * 2:-30 ns -40 ns
586  * 3:-20 ns -40 ns
587  * 4:-10 ns no change
588  * 5:no change no change
589  * 6:no change no change
590  * 7:default default
591  * NOTE:EEPROM value is only taken over at first
592  * EEPROM load after power-on or reset
593  */
594 #define ESC_ESC_DL_CTRL_RFS_MASK (0x70000UL)
595 #define ESC_ESC_DL_CTRL_RFS_SHIFT (16U)
596 #define ESC_ESC_DL_CTRL_RFS_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_RFS_MASK) >> ESC_ESC_DL_CTRL_RFS_SHIFT)
597 
598 /*
599  * LP3 (RO)
600  *
601  * Loop Port 3:
602  * 00:Auto
603  * 01:Auto Close
604  * 10:Open
605  * 11:Closed
606  */
607 #define ESC_ESC_DL_CTRL_LP3_MASK (0xC000U)
608 #define ESC_ESC_DL_CTRL_LP3_SHIFT (14U)
609 #define ESC_ESC_DL_CTRL_LP3_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_LP3_MASK) >> ESC_ESC_DL_CTRL_LP3_SHIFT)
610 
611 /*
612  * LP2 (RO)
613  *
614  * Loop Port 2:
615  * 00:Auto
616  * 01:Auto Close
617  * 10:Open
618  * 11:Closed
619  */
620 #define ESC_ESC_DL_CTRL_LP2_MASK (0x3000U)
621 #define ESC_ESC_DL_CTRL_LP2_SHIFT (12U)
622 #define ESC_ESC_DL_CTRL_LP2_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_LP2_MASK) >> ESC_ESC_DL_CTRL_LP2_SHIFT)
623 
624 /*
625  * LP1 (RO)
626  *
627  * Loop Port 1:
628  * 00:Auto
629  * 01:Auto Close
630  * 10:Open
631  * 11:Closed
632  */
633 #define ESC_ESC_DL_CTRL_LP1_MASK (0xC00U)
634 #define ESC_ESC_DL_CTRL_LP1_SHIFT (10U)
635 #define ESC_ESC_DL_CTRL_LP1_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_LP1_MASK) >> ESC_ESC_DL_CTRL_LP1_SHIFT)
636 
637 /*
638  * LP0 (RO)
639  *
640  * Loop Port 0:
641  * 00:Auto
642  * 01:Auto Close
643  * 10:Open
644  * 11:Closed
645  * NOTE:
646  * Loop open means sending/receiving over this port
647  * is enabled, loop closed means sending/receiving
648  * is disabled and frames are forwarded to the next
649  * open port internally.
650  * Auto:loop closed at link down, opened at link up
651  * Auto Close:loop closed at link down, opened with
652  * writing 01 again after link up (or receiving a valid
653  * Ethernet frame at the closed port)
654  * Open:loop open regardless of link state
655  * Closed:loop closed regardless of link state
656  */
657 #define ESC_ESC_DL_CTRL_LP0_MASK (0x300U)
658 #define ESC_ESC_DL_CTRL_LP0_SHIFT (8U)
659 #define ESC_ESC_DL_CTRL_LP0_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_LP0_MASK) >> ESC_ESC_DL_CTRL_LP0_SHIFT)
660 
661 /*
662  * TU (RO)
663  *
664  * Temporary use of settings in
665  * 0x0100:0x0103[8:15]:
666  * 0:permanent use
667  * 1:use for about 1 second, then revert to
668  * previous settings
669  */
670 #define ESC_ESC_DL_CTRL_TU_MASK (0x2U)
671 #define ESC_ESC_DL_CTRL_TU_SHIFT (1U)
672 #define ESC_ESC_DL_CTRL_TU_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_TU_MASK) >> ESC_ESC_DL_CTRL_TU_SHIFT)
673 
674 /*
675  * FR (RO)
676  *
677  * Forwarding rule:
678  * 0:Forward non-EtherCAT frames:
679  * EtherCAT frames are processed,
680  * non-EtherCAT frames are forwarded
681  * without processing or modification.
682  * The source MAC address is not
683  * changed for any frame.
684  * 1:Destroy non-EtherCAT frames:
685  * EtherCAT frames are processed, non-EtherCAT frames are destroyed.
686  * The source MAC address is changed by
687  * the Processing Unit for every frame
688  * (SOURCE_MAC[1] is set
689  */
690 #define ESC_ESC_DL_CTRL_FR_MASK (0x1U)
691 #define ESC_ESC_DL_CTRL_FR_SHIFT (0U)
692 #define ESC_ESC_DL_CTRL_FR_GET(x) (((uint32_t)(x) & ESC_ESC_DL_CTRL_FR_MASK) >> ESC_ESC_DL_CTRL_FR_SHIFT)
693 
694 /* Bitfield definition for register: PHYSICAL_RW_OFFSET */
695 /*
696  * OFFSET (RO)
697  *
698  * This register is used for ReadWrite
699  * commands in Device Addressing mode
700  * (FPRW, APRW, BRW).
701  * The internal read address is directly taken
702  * from the offset address field of the EtherCAT
703  * datagram header, while the internal write
704  * address is calculated by adding the Physical
705  * Read/Write Offset value to the offset address
706  * field.
707  * Internal read address = ADR,
708  * internal write address = ADR + R/W-Offset
709  */
710 #define ESC_PHYSICAL_RW_OFFSET_OFFSET_MASK (0xFFFFU)
711 #define ESC_PHYSICAL_RW_OFFSET_OFFSET_SHIFT (0U)
712 #define ESC_PHYSICAL_RW_OFFSET_OFFSET_GET(x) (((uint16_t)(x) & ESC_PHYSICAL_RW_OFFSET_OFFSET_MASK) >> ESC_PHYSICAL_RW_OFFSET_OFFSET_SHIFT)
713 
714 /* Bitfield definition for register: ESC_DL_STAT */
715 /*
716  * CP3 (RO)
717  *
718  * Communication on Port 3:
719  * 0:No stable communication
720  * 1:Communication established
721  */
722 #define ESC_ESC_DL_STAT_CP3_MASK (0x8000U)
723 #define ESC_ESC_DL_STAT_CP3_SHIFT (15U)
724 #define ESC_ESC_DL_STAT_CP3_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_CP3_MASK) >> ESC_ESC_DL_STAT_CP3_SHIFT)
725 
726 /*
727  * LP3 (RO)
728  *
729  * Loop Port 3:
730  * 0:Open
731  * 1:Closed
732  */
733 #define ESC_ESC_DL_STAT_LP3_MASK (0x4000U)
734 #define ESC_ESC_DL_STAT_LP3_SHIFT (14U)
735 #define ESC_ESC_DL_STAT_LP3_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_LP3_MASK) >> ESC_ESC_DL_STAT_LP3_SHIFT)
736 
737 /*
738  * CP2 (RO)
739  *
740  * Communication on Port 2:
741  * 0:No stable communication
742  * 1:Communication established
743  */
744 #define ESC_ESC_DL_STAT_CP2_MASK (0x2000U)
745 #define ESC_ESC_DL_STAT_CP2_SHIFT (13U)
746 #define ESC_ESC_DL_STAT_CP2_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_CP2_MASK) >> ESC_ESC_DL_STAT_CP2_SHIFT)
747 
748 /*
749  * LP2 (RO)
750  *
751  * Loop Port 2:
752  * 0:Open
753  * 1:Closed
754  */
755 #define ESC_ESC_DL_STAT_LP2_MASK (0x1000U)
756 #define ESC_ESC_DL_STAT_LP2_SHIFT (12U)
757 #define ESC_ESC_DL_STAT_LP2_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_LP2_MASK) >> ESC_ESC_DL_STAT_LP2_SHIFT)
758 
759 /*
760  * CP1 (RO)
761  *
762  * Communication on Port 1:
763  * 0:No stable communication
764  * 1:Communication established
765  */
766 #define ESC_ESC_DL_STAT_CP1_MASK (0x800U)
767 #define ESC_ESC_DL_STAT_CP1_SHIFT (11U)
768 #define ESC_ESC_DL_STAT_CP1_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_CP1_MASK) >> ESC_ESC_DL_STAT_CP1_SHIFT)
769 
770 /*
771  * LP1 (RO)
772  *
773  * Loop Port 1:
774  * 0:Open
775  * 1:Closed
776  */
777 #define ESC_ESC_DL_STAT_LP1_MASK (0x400U)
778 #define ESC_ESC_DL_STAT_LP1_SHIFT (10U)
779 #define ESC_ESC_DL_STAT_LP1_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_LP1_MASK) >> ESC_ESC_DL_STAT_LP1_SHIFT)
780 
781 /*
782  * CP0 (RO)
783  *
784  * Communication on Port 0:
785  * 0:No stable communication
786  * 1:Communication established
787  */
788 #define ESC_ESC_DL_STAT_CP0_MASK (0x200U)
789 #define ESC_ESC_DL_STAT_CP0_SHIFT (9U)
790 #define ESC_ESC_DL_STAT_CP0_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_CP0_MASK) >> ESC_ESC_DL_STAT_CP0_SHIFT)
791 
792 /*
793  * LP0 (RO)
794  *
795  * Loop Port 0:
796  * 0:Open
797  * 1:Closed
798  */
799 #define ESC_ESC_DL_STAT_LP0_MASK (0x100U)
800 #define ESC_ESC_DL_STAT_LP0_SHIFT (8U)
801 #define ESC_ESC_DL_STAT_LP0_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_LP0_MASK) >> ESC_ESC_DL_STAT_LP0_SHIFT)
802 
803 /*
804  * PLP3 (RO)
805  *
806  * Physical link on Port 3:
807  * 0:No link
808  * 1:Link detected
809  */
810 #define ESC_ESC_DL_STAT_PLP3_MASK (0x80U)
811 #define ESC_ESC_DL_STAT_PLP3_SHIFT (7U)
812 #define ESC_ESC_DL_STAT_PLP3_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_PLP3_MASK) >> ESC_ESC_DL_STAT_PLP3_SHIFT)
813 
814 /*
815  * PLP2 (RO)
816  *
817  * Physical link on Port 2:
818  * 0:No link
819  * 1:Link detected
820  */
821 #define ESC_ESC_DL_STAT_PLP2_MASK (0x40U)
822 #define ESC_ESC_DL_STAT_PLP2_SHIFT (6U)
823 #define ESC_ESC_DL_STAT_PLP2_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_PLP2_MASK) >> ESC_ESC_DL_STAT_PLP2_SHIFT)
824 
825 /*
826  * PLP1 (RO)
827  *
828  * Physical link on Port 1:
829  * 0:No link
830  * 1:Link detected
831  */
832 #define ESC_ESC_DL_STAT_PLP1_MASK (0x20U)
833 #define ESC_ESC_DL_STAT_PLP1_SHIFT (5U)
834 #define ESC_ESC_DL_STAT_PLP1_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_PLP1_MASK) >> ESC_ESC_DL_STAT_PLP1_SHIFT)
835 
836 /*
837  * PLP0 (RO)
838  *
839  * Physical link on Port 0:
840  * 0:No link
841  * 1:Link detected
842  */
843 #define ESC_ESC_DL_STAT_PLP0_MASK (0x10U)
844 #define ESC_ESC_DL_STAT_PLP0_SHIFT (4U)
845 #define ESC_ESC_DL_STAT_PLP0_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_PLP0_MASK) >> ESC_ESC_DL_STAT_PLP0_SHIFT)
846 
847 /*
848  * ELD (RO)
849  *
850  * Enhanced Link detection:
851  * 0:Deactivated for all ports
852  * 1:Activated for at least one port
853  * NOTE:EEPROM value is only transferred into this
854  * register at first EEPROM load after power-on or
855  * reset
856  */
857 #define ESC_ESC_DL_STAT_ELD_MASK (0x4U)
858 #define ESC_ESC_DL_STAT_ELD_SHIFT (2U)
859 #define ESC_ESC_DL_STAT_ELD_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_ELD_MASK) >> ESC_ESC_DL_STAT_ELD_SHIFT)
860 
861 /*
862  * WDS (RO)
863  *
864  * PDI Watchdog Status:
865  * 0:Watchdog expired
866  * 1:Watchdog reloaded
867  */
868 #define ESC_ESC_DL_STAT_WDS_MASK (0x2U)
869 #define ESC_ESC_DL_STAT_WDS_SHIFT (1U)
870 #define ESC_ESC_DL_STAT_WDS_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_WDS_MASK) >> ESC_ESC_DL_STAT_WDS_SHIFT)
871 
872 /*
873  * EPLC (RO)
874  *
875  * PDI operational/EEPROM loaded correctly:
876  * 0:EEPROM not loaded, PDI not
877  * operational (no access to Process Data
878  * RAM)
879  * 1:EEPROM loaded correctly, PDI
880  * operational (access to Process Data
881  * RAM)
882  */
883 #define ESC_ESC_DL_STAT_EPLC_MASK (0x1U)
884 #define ESC_ESC_DL_STAT_EPLC_SHIFT (0U)
885 #define ESC_ESC_DL_STAT_EPLC_GET(x) (((uint16_t)(x) & ESC_ESC_DL_STAT_EPLC_MASK) >> ESC_ESC_DL_STAT_EPLC_SHIFT)
886 
887 /* Bitfield definition for register: AL_CTRL */
888 /*
889  * DI (RW)
890  *
891  * Device Identification:
892  * 0:No request
893  * 1:Device Identification request
894  */
895 #define ESC_AL_CTRL_DI_MASK (0x20U)
896 #define ESC_AL_CTRL_DI_SHIFT (5U)
897 #define ESC_AL_CTRL_DI_SET(x) (((uint16_t)(x) << ESC_AL_CTRL_DI_SHIFT) & ESC_AL_CTRL_DI_MASK)
898 #define ESC_AL_CTRL_DI_GET(x) (((uint16_t)(x) & ESC_AL_CTRL_DI_MASK) >> ESC_AL_CTRL_DI_SHIFT)
899 
900 /*
901  * EIA (RW)
902  *
903  * Error Ind Ack:
904  * 0:No Ack of Error Ind in AL status register
905  * 1:Ack of Error Ind in AL status register
906  */
907 #define ESC_AL_CTRL_EIA_MASK (0x10U)
908 #define ESC_AL_CTRL_EIA_SHIFT (4U)
909 #define ESC_AL_CTRL_EIA_SET(x) (((uint16_t)(x) << ESC_AL_CTRL_EIA_SHIFT) & ESC_AL_CTRL_EIA_MASK)
910 #define ESC_AL_CTRL_EIA_GET(x) (((uint16_t)(x) & ESC_AL_CTRL_EIA_MASK) >> ESC_AL_CTRL_EIA_SHIFT)
911 
912 /*
913  * IST (RW)
914  *
915  * Initiate State Transition of the Device State
916  * Machine:
917  * 1:Request Init State
918  * 3:Request Bootstrap State
919  * 2:Request Pre-Operational State
920  * 4:Request Safe-Operational State
921  * 8:Request Operational State
922  */
923 #define ESC_AL_CTRL_IST_MASK (0xFU)
924 #define ESC_AL_CTRL_IST_SHIFT (0U)
925 #define ESC_AL_CTRL_IST_SET(x) (((uint16_t)(x) << ESC_AL_CTRL_IST_SHIFT) & ESC_AL_CTRL_IST_MASK)
926 #define ESC_AL_CTRL_IST_GET(x) (((uint16_t)(x) & ESC_AL_CTRL_IST_MASK) >> ESC_AL_CTRL_IST_SHIFT)
927 
928 /* Bitfield definition for register: AL_STAT */
929 /*
930  * DI (RW)
931  *
932  * Device Identification:
933  * 0:Device Identification not valid
934  * 1:Device Identification loaded
935  */
936 #define ESC_AL_STAT_DI_MASK (0x20U)
937 #define ESC_AL_STAT_DI_SHIFT (5U)
938 #define ESC_AL_STAT_DI_SET(x) (((uint16_t)(x) << ESC_AL_STAT_DI_SHIFT) & ESC_AL_STAT_DI_MASK)
939 #define ESC_AL_STAT_DI_GET(x) (((uint16_t)(x) & ESC_AL_STAT_DI_MASK) >> ESC_AL_STAT_DI_SHIFT)
940 
941 /*
942  * EI (RW)
943  *
944  * Error Ind:
945  * 0:Device is in State as requested or Flag
946  * cleared by command
947  * 1:Device has not entered requested State
948  * or changed State as result of a local
949  * action
950  */
951 #define ESC_AL_STAT_EI_MASK (0x10U)
952 #define ESC_AL_STAT_EI_SHIFT (4U)
953 #define ESC_AL_STAT_EI_SET(x) (((uint16_t)(x) << ESC_AL_STAT_EI_SHIFT) & ESC_AL_STAT_EI_MASK)
954 #define ESC_AL_STAT_EI_GET(x) (((uint16_t)(x) & ESC_AL_STAT_EI_MASK) >> ESC_AL_STAT_EI_SHIFT)
955 
956 /*
957  * AS (RW)
958  *
959  * Actual State of the Device State Machine:
960  * 1:Init State
961  * 3:Bootstrap State
962  * 2:Pre-Operational State
963  * 4:Safe-Operational State
964  * 8:Operational State
965  */
966 #define ESC_AL_STAT_AS_MASK (0xFU)
967 #define ESC_AL_STAT_AS_SHIFT (0U)
968 #define ESC_AL_STAT_AS_SET(x) (((uint16_t)(x) << ESC_AL_STAT_AS_SHIFT) & ESC_AL_STAT_AS_MASK)
969 #define ESC_AL_STAT_AS_GET(x) (((uint16_t)(x) & ESC_AL_STAT_AS_MASK) >> ESC_AL_STAT_AS_SHIFT)
970 
971 /* Bitfield definition for register: AL_STAT_CODE */
972 /*
973  * CODE (RW)
974  *
975  * AL Status Code
976  */
977 #define ESC_AL_STAT_CODE_CODE_MASK (0xFFFFU)
978 #define ESC_AL_STAT_CODE_CODE_SHIFT (0U)
979 #define ESC_AL_STAT_CODE_CODE_SET(x) (((uint16_t)(x) << ESC_AL_STAT_CODE_CODE_SHIFT) & ESC_AL_STAT_CODE_CODE_MASK)
980 #define ESC_AL_STAT_CODE_CODE_GET(x) (((uint16_t)(x) & ESC_AL_STAT_CODE_CODE_MASK) >> ESC_AL_STAT_CODE_CODE_SHIFT)
981 
982 /* Bitfield definition for register: RUN_LED_OVRD */
983 /*
984  * EN_OVRD (RW)
985  *
986  * Enable Override:
987  * 0:Override disabled
988  * 1:Override enabled
989  */
990 #define ESC_RUN_LED_OVRD_EN_OVRD_MASK (0x10U)
991 #define ESC_RUN_LED_OVRD_EN_OVRD_SHIFT (4U)
992 #define ESC_RUN_LED_OVRD_EN_OVRD_SET(x) (((uint8_t)(x) << ESC_RUN_LED_OVRD_EN_OVRD_SHIFT) & ESC_RUN_LED_OVRD_EN_OVRD_MASK)
993 #define ESC_RUN_LED_OVRD_EN_OVRD_GET(x) (((uint8_t)(x) & ESC_RUN_LED_OVRD_EN_OVRD_MASK) >> ESC_RUN_LED_OVRD_EN_OVRD_SHIFT)
994 
995 /*
996  * LED_CODE (RW)
997  *
998  * LED code:
999  * 0x0:Off
1000  * 0x1:Flash 1x
1001  * 0x2-0xC:Flash 2x – 12x
1002  * 0xD:Blinking
1003  * 0xE:Flickering
1004  * 0xF:On
1005  */
1006 #define ESC_RUN_LED_OVRD_LED_CODE_MASK (0xFU)
1007 #define ESC_RUN_LED_OVRD_LED_CODE_SHIFT (0U)
1008 #define ESC_RUN_LED_OVRD_LED_CODE_SET(x) (((uint8_t)(x) << ESC_RUN_LED_OVRD_LED_CODE_SHIFT) & ESC_RUN_LED_OVRD_LED_CODE_MASK)
1009 #define ESC_RUN_LED_OVRD_LED_CODE_GET(x) (((uint8_t)(x) & ESC_RUN_LED_OVRD_LED_CODE_MASK) >> ESC_RUN_LED_OVRD_LED_CODE_SHIFT)
1010 
1011 /* Bitfield definition for register: ERR_LED_OVRD */
1012 /*
1013  * EN_OVRD (RW)
1014  *
1015  * Enable Override:
1016  * 0:Override disabled
1017  * 1:Override enabled
1018  */
1019 #define ESC_ERR_LED_OVRD_EN_OVRD_MASK (0x10U)
1020 #define ESC_ERR_LED_OVRD_EN_OVRD_SHIFT (4U)
1021 #define ESC_ERR_LED_OVRD_EN_OVRD_SET(x) (((uint8_t)(x) << ESC_ERR_LED_OVRD_EN_OVRD_SHIFT) & ESC_ERR_LED_OVRD_EN_OVRD_MASK)
1022 #define ESC_ERR_LED_OVRD_EN_OVRD_GET(x) (((uint8_t)(x) & ESC_ERR_LED_OVRD_EN_OVRD_MASK) >> ESC_ERR_LED_OVRD_EN_OVRD_SHIFT)
1023 
1024 /*
1025  * LED_CODE (RW)
1026  *
1027  * LED code:
1028  * 0x0:Off
1029  * 0x1-0xC:Flash 1x – 12x
1030  * 0xD:Blinking
1031  * 0xE:Flickering
1032  * 0xF:On
1033  */
1034 #define ESC_ERR_LED_OVRD_LED_CODE_MASK (0xFU)
1035 #define ESC_ERR_LED_OVRD_LED_CODE_SHIFT (0U)
1036 #define ESC_ERR_LED_OVRD_LED_CODE_SET(x) (((uint8_t)(x) << ESC_ERR_LED_OVRD_LED_CODE_SHIFT) & ESC_ERR_LED_OVRD_LED_CODE_MASK)
1037 #define ESC_ERR_LED_OVRD_LED_CODE_GET(x) (((uint8_t)(x) & ESC_ERR_LED_OVRD_LED_CODE_MASK) >> ESC_ERR_LED_OVRD_LED_CODE_SHIFT)
1038 
1039 /* Bitfield definition for register: PDI_CTRL */
1040 /*
1041  * PDI (RO)
1042  *
1043  * Process data interface:
1044  * 0x00:Interface deactivated (no PDI)
1045  * 0x01:4 Digital Input
1046  * 0x02:4 Digital Output
1047  * 0x03:2 Digital Input and 2 Digital Output
1048  * 0x04:Digital I/O
1049  * 0x05:SPI Slave
1050  * 0x06:Oversampling I/O
1051  * 0x07:EtherCAT Bridge (port 3)
1052  * 0x08:16 Bit asynchronous Microcontroller
1053  * interface
1054  * 0x09:8 Bit asynchronous Microcontroller
1055  * interface
1056  * 0x0A:16 Bit synchronous Microcontroller
1057  * interface
1058  * 0x0B:8 Bit synchronous Microcontroller
1059  * interface
1060  * 0x10:32 Digital Input and 0 Digital Output
1061  * 0x11:24 Digital Input and 8 Digital Output
1062  * 0x12:16 Digital Input and 16 Digital Output
1063  * 0x13:8 Digital Input and 24 Digital Output
1064  * 0x14:0 Digital Input and 32 Digital Output
1065  * 0x80:On-chip bus
1066  * Others:Reserved
1067  */
1068 #define ESC_PDI_CTRL_PDI_MASK (0xFFU)
1069 #define ESC_PDI_CTRL_PDI_SHIFT (0U)
1070 #define ESC_PDI_CTRL_PDI_GET(x) (((uint8_t)(x) & ESC_PDI_CTRL_PDI_MASK) >> ESC_PDI_CTRL_PDI_SHIFT)
1071 
1072 /* Bitfield definition for register: ESC_CFG */
1073 /*
1074  * ELP3 (RO)
1075  *
1076  * Enhanced Link port 3:
1077  * 0:disabled (if bit 1=0)
1078  * 1:enabled
1079  */
1080 #define ESC_ESC_CFG_ELP3_MASK (0x80U)
1081 #define ESC_ESC_CFG_ELP3_SHIFT (7U)
1082 #define ESC_ESC_CFG_ELP3_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELP3_MASK) >> ESC_ESC_CFG_ELP3_SHIFT)
1083 
1084 /*
1085  * ELP2 (RO)
1086  *
1087  * Enhanced Link port 2:
1088  * 0:disabled (if bit 1=0)
1089  * 1:enabled
1090  */
1091 #define ESC_ESC_CFG_ELP2_MASK (0x40U)
1092 #define ESC_ESC_CFG_ELP2_SHIFT (6U)
1093 #define ESC_ESC_CFG_ELP2_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELP2_MASK) >> ESC_ESC_CFG_ELP2_SHIFT)
1094 
1095 /*
1096  * ELP1 (RO)
1097  *
1098  * Enhanced Link port 1:
1099  * 0:disabled (if bit 1=0)
1100  * 1:enabled
1101  */
1102 #define ESC_ESC_CFG_ELP1_MASK (0x20U)
1103 #define ESC_ESC_CFG_ELP1_SHIFT (5U)
1104 #define ESC_ESC_CFG_ELP1_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELP1_MASK) >> ESC_ESC_CFG_ELP1_SHIFT)
1105 
1106 /*
1107  * ELP0 (RO)
1108  *
1109  * Enhanced Link port 0:
1110  * 0:disabled (if bit 1=0)
1111  * 1:enabled
1112  */
1113 #define ESC_ESC_CFG_ELP0_MASK (0x10U)
1114 #define ESC_ESC_CFG_ELP0_SHIFT (4U)
1115 #define ESC_ESC_CFG_ELP0_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELP0_MASK) >> ESC_ESC_CFG_ELP0_SHIFT)
1116 
1117 /*
1118  * CDLIU (RO)
1119  *
1120  * Distributed Clocks Latch In Unit:
1121  * 0:disabled (power saving)
1122  * 1:enabled
1123  */
1124 #define ESC_ESC_CFG_CDLIU_MASK (0x8U)
1125 #define ESC_ESC_CFG_CDLIU_SHIFT (3U)
1126 #define ESC_ESC_CFG_CDLIU_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_CDLIU_MASK) >> ESC_ESC_CFG_CDLIU_SHIFT)
1127 
1128 /*
1129  * DCSOU (RO)
1130  *
1131  * Distributed Clocks SYNC Out Unit:
1132  * 0:disabled (power saving)
1133  * 1:enabled
1134  */
1135 #define ESC_ESC_CFG_DCSOU_MASK (0x4U)
1136 #define ESC_ESC_CFG_DCSOU_SHIFT (2U)
1137 #define ESC_ESC_CFG_DCSOU_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_DCSOU_MASK) >> ESC_ESC_CFG_DCSOU_SHIFT)
1138 
1139 /*
1140  * ELDAP (RO)
1141  *
1142  * Enhanced Link detection all ports:
1143  * 0:disabled (if bits [7:4]=0)
1144  * 1:enabled at all ports (overrides bits [7:4])
1145  */
1146 #define ESC_ESC_CFG_ELDAP_MASK (0x2U)
1147 #define ESC_ESC_CFG_ELDAP_SHIFT (1U)
1148 #define ESC_ESC_CFG_ELDAP_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_ELDAP_MASK) >> ESC_ESC_CFG_ELDAP_SHIFT)
1149 
1150 /*
1151  * DEV_EMU (RO)
1152  *
1153  * Device emulation (control of AL status):
1154  * 0:AL status register has to be set by PDI
1155  * 1:AL status register will be set to value
1156  * written to AL control register
1157  */
1158 #define ESC_ESC_CFG_DEV_EMU_MASK (0x1U)
1159 #define ESC_ESC_CFG_DEV_EMU_SHIFT (0U)
1160 #define ESC_ESC_CFG_DEV_EMU_GET(x) (((uint8_t)(x) & ESC_ESC_CFG_DEV_EMU_MASK) >> ESC_ESC_CFG_DEV_EMU_SHIFT)
1161 
1162 /* Bitfield definition for register: PDI_INFO */
1163 /*
1164  * PDICN (RO)
1165  *
1166  * PDI configuration invalid:
1167  * 0:PDI configuration ok
1168  * 1:PDI configuration invalid
1169  */
1170 #define ESC_PDI_INFO_PDICN_MASK (0x8U)
1171 #define ESC_PDI_INFO_PDICN_SHIFT (3U)
1172 #define ESC_PDI_INFO_PDICN_GET(x) (((uint16_t)(x) & ESC_PDI_INFO_PDICN_MASK) >> ESC_PDI_INFO_PDICN_SHIFT)
1173 
1174 /*
1175  * PDIA (RO)
1176  *
1177  * PDI active:
1178  * 0:PDI not active
1179  * 1:PDI active
1180  */
1181 #define ESC_PDI_INFO_PDIA_MASK (0x4U)
1182 #define ESC_PDI_INFO_PDIA_SHIFT (2U)
1183 #define ESC_PDI_INFO_PDIA_GET(x) (((uint16_t)(x) & ESC_PDI_INFO_PDIA_MASK) >> ESC_PDI_INFO_PDIA_SHIFT)
1184 
1185 /*
1186  * ECLFE (RO)
1187  *
1188  * ESC configuration area loaded from
1189  * EEPROM:
1190  * 0:not loaded
1191  * 1:loaded
1192  */
1193 #define ESC_PDI_INFO_ECLFE_MASK (0x2U)
1194 #define ESC_PDI_INFO_ECLFE_SHIFT (1U)
1195 #define ESC_PDI_INFO_ECLFE_GET(x) (((uint16_t)(x) & ESC_PDI_INFO_ECLFE_MASK) >> ESC_PDI_INFO_ECLFE_SHIFT)
1196 
1197 /*
1198  * PFABW (RO)
1199  *
1200  * DI function acknowledge by write:
1201  * 0:Disabled
1202  * 1:Enabled
1203  */
1204 #define ESC_PDI_INFO_PFABW_MASK (0x1U)
1205 #define ESC_PDI_INFO_PFABW_SHIFT (0U)
1206 #define ESC_PDI_INFO_PFABW_GET(x) (((uint16_t)(x) & ESC_PDI_INFO_PFABW_MASK) >> ESC_PDI_INFO_PFABW_SHIFT)
1207 
1208 /* Bitfield definition for register: PDI_CFG */
1209 /*
1210  * BUS (RO)
1211  *
1212  * On-chip bus:
1213  * 000:Intel® Avalon®
1214  * 001:AXI®
1215  * 010:Xilinx® PLB v4.6
1216  * 100:Xilinx OPB
1217  * others:reserved
1218  */
1219 #define ESC_PDI_CFG_BUS_MASK (0xE0U)
1220 #define ESC_PDI_CFG_BUS_SHIFT (5U)
1221 #define ESC_PDI_CFG_BUS_GET(x) (((uint8_t)(x) & ESC_PDI_CFG_BUS_MASK) >> ESC_PDI_CFG_BUS_SHIFT)
1222 
1223 /*
1224  * CLK (RO)
1225  *
1226  * On-chip bus clock:
1227  * 0:asynchronous
1228  * 1-31:synchronous multiplication factor
1229  * (N * 25 MHz)
1230  */
1231 #define ESC_PDI_CFG_CLK_MASK (0x1FU)
1232 #define ESC_PDI_CFG_CLK_SHIFT (0U)
1233 #define ESC_PDI_CFG_CLK_GET(x) (((uint8_t)(x) & ESC_PDI_CFG_CLK_MASK) >> ESC_PDI_CFG_CLK_SHIFT)
1234 
1235 /* Bitfield definition for register: PDI_SL_CFG */
1236 /*
1237  * SYNC1_MAER (RO)
1238  *
1239  * SYNC1 mapped to AL Event Request
1240  * register 0x0220[3]:
1241  * 0:Disabled
1242  * 1:Enabled
1243  */
1244 #define ESC_PDI_SL_CFG_SYNC1_MAER_MASK (0x80U)
1245 #define ESC_PDI_SL_CFG_SYNC1_MAER_SHIFT (7U)
1246 #define ESC_PDI_SL_CFG_SYNC1_MAER_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC1_MAER_MASK) >> ESC_PDI_SL_CFG_SYNC1_MAER_SHIFT)
1247 
1248 /*
1249  * SYNC1_CFG (RO)
1250  *
1251  * SYNC1/LATCH1 configuration*:
1252  * 0:LATCH1 input
1253  * 1:SYNC1 output
1254  */
1255 #define ESC_PDI_SL_CFG_SYNC1_CFG_MASK (0x40U)
1256 #define ESC_PDI_SL_CFG_SYNC1_CFG_SHIFT (6U)
1257 #define ESC_PDI_SL_CFG_SYNC1_CFG_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC1_CFG_MASK) >> ESC_PDI_SL_CFG_SYNC1_CFG_SHIFT)
1258 
1259 /*
1260  * SYNC1_ODP (RO)
1261  *
1262  * SYNC1 output driver/polarity:
1263  * 00:Push-Pull active low
1264  * 01:Open Drain (active low)
1265  * 10:Push-Pull active high
1266  * 11:Open Source (active high)
1267  */
1268 #define ESC_PDI_SL_CFG_SYNC1_ODP_MASK (0x30U)
1269 #define ESC_PDI_SL_CFG_SYNC1_ODP_SHIFT (4U)
1270 #define ESC_PDI_SL_CFG_SYNC1_ODP_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC1_ODP_MASK) >> ESC_PDI_SL_CFG_SYNC1_ODP_SHIFT)
1271 
1272 /*
1273  * SYNC0_MAER (RO)
1274  *
1275  * SYNC0 mapped to AL Event Request
1276  * register 0x0220[2]:
1277  * 0:Disabled
1278  * 1:Enabled
1279  */
1280 #define ESC_PDI_SL_CFG_SYNC0_MAER_MASK (0x8U)
1281 #define ESC_PDI_SL_CFG_SYNC0_MAER_SHIFT (3U)
1282 #define ESC_PDI_SL_CFG_SYNC0_MAER_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC0_MAER_MASK) >> ESC_PDI_SL_CFG_SYNC0_MAER_SHIFT)
1283 
1284 /*
1285  * SYNC0_CFG (RO)
1286  *
1287  * SYNC0/LATCH0 configuration*:
1288  * 0:LATCH0 Input
1289  * 1:SYNC0 Output
1290  */
1291 #define ESC_PDI_SL_CFG_SYNC0_CFG_MASK (0x4U)
1292 #define ESC_PDI_SL_CFG_SYNC0_CFG_SHIFT (2U)
1293 #define ESC_PDI_SL_CFG_SYNC0_CFG_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC0_CFG_MASK) >> ESC_PDI_SL_CFG_SYNC0_CFG_SHIFT)
1294 
1295 /*
1296  * SYNC0_ODP (RO)
1297  *
1298  * SYNC0 output driver/polarity:
1299  * 00:Push-Pull active low
1300  * 01:Open Drain (active low)
1301  * 10:Push-Pull active high
1302  * 11:Open Source (active high)
1303  */
1304 #define ESC_PDI_SL_CFG_SYNC0_ODP_MASK (0x3U)
1305 #define ESC_PDI_SL_CFG_SYNC0_ODP_SHIFT (0U)
1306 #define ESC_PDI_SL_CFG_SYNC0_ODP_GET(x) (((uint8_t)(x) & ESC_PDI_SL_CFG_SYNC0_ODP_MASK) >> ESC_PDI_SL_CFG_SYNC0_ODP_SHIFT)
1307 
1308 /* Bitfield definition for register: PDI_EXT_CFG */
1309 /*
1310  * OCBST (RW)
1311  *
1312  * On-chip bus sub-type for AXI:
1313  * 000:AXI3
1314  * 001:AXI4
1315  * 010:AXI4 LITE
1316  * others:reserved
1317  */
1318 #define ESC_PDI_EXT_CFG_OCBST_MASK (0x700U)
1319 #define ESC_PDI_EXT_CFG_OCBST_SHIFT (8U)
1320 #define ESC_PDI_EXT_CFG_OCBST_SET(x) (((uint16_t)(x) << ESC_PDI_EXT_CFG_OCBST_SHIFT) & ESC_PDI_EXT_CFG_OCBST_MASK)
1321 #define ESC_PDI_EXT_CFG_OCBST_GET(x) (((uint16_t)(x) & ESC_PDI_EXT_CFG_OCBST_MASK) >> ESC_PDI_EXT_CFG_OCBST_SHIFT)
1322 
1323 /*
1324  * RPS (RO)
1325  *
1326  * Read prefetch size (in cycles of PDI width):
1327  * 0:4 cycles
1328  * 1:1 cycle (typical)
1329  * 2:2 cycles
1330  * 3:Reserved
1331  */
1332 #define ESC_PDI_EXT_CFG_RPS_MASK (0x3U)
1333 #define ESC_PDI_EXT_CFG_RPS_SHIFT (0U)
1334 #define ESC_PDI_EXT_CFG_RPS_GET(x) (((uint16_t)(x) & ESC_PDI_EXT_CFG_RPS_MASK) >> ESC_PDI_EXT_CFG_RPS_SHIFT)
1335 
1336 /* Bitfield definition for register: ECAT_EVT_MSK */
1337 /*
1338  * MASK (RO)
1339  *
1340  * ECAT Event masking of the ECAT Event
1341  * Request Events for mapping into ECAT event
1342  * field of EtherCAT frames:
1343  * 0:Corresponding ECAT Event Request
1344  * register bit is not mapped
1345  * 1:Corresponding ECAT Event Request
1346  * register bit is mapped
1347  */
1348 #define ESC_ECAT_EVT_MSK_MASK_MASK (0xFFFFU)
1349 #define ESC_ECAT_EVT_MSK_MASK_SHIFT (0U)
1350 #define ESC_ECAT_EVT_MSK_MASK_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_MSK_MASK_MASK) >> ESC_ECAT_EVT_MSK_MASK_SHIFT)
1351 
1352 /* Bitfield definition for register: PDI_AL_EVT_MSK */
1353 /*
1354  * MASK (RW)
1355  *
1356  * AL Event masking of the AL Event Request
1357  * register Events for mapping to PDI IRQ
1358  * signal:
1359  * 0:Corresponding AL Event Request
1360  * register bit is not mapped
1361  * 1:Corresponding AL Event Request
1362  * register bit is mapped
1363  */
1364 #define ESC_PDI_AL_EVT_MSK_MASK_MASK (0xFFFFFFFFUL)
1365 #define ESC_PDI_AL_EVT_MSK_MASK_SHIFT (0U)
1366 #define ESC_PDI_AL_EVT_MSK_MASK_SET(x) (((uint32_t)(x) << ESC_PDI_AL_EVT_MSK_MASK_SHIFT) & ESC_PDI_AL_EVT_MSK_MASK_MASK)
1367 #define ESC_PDI_AL_EVT_MSK_MASK_GET(x) (((uint32_t)(x) & ESC_PDI_AL_EVT_MSK_MASK_MASK) >> ESC_PDI_AL_EVT_MSK_MASK_SHIFT)
1368 
1369 /* Bitfield definition for register: ECAT_EVT_REQ */
1370 /*
1371  * MV (RO)
1372  *
1373  * Mirrors values of each SyncManager Status:
1374  * 0:No Sync Channel 0 event
1375  * 1:Sync Channel 0 event pending
1376  * 0:No Sync Channel 1 event
1377  * 1:Sync Channel 1 event pending
1378  * …
1379  * 0:No Sync Channel 7 event
1380  * 1:Sync Channel 7 event pending
1381  */
1382 #define ESC_ECAT_EVT_REQ_MV_MASK (0xFF0U)
1383 #define ESC_ECAT_EVT_REQ_MV_SHIFT (4U)
1384 #define ESC_ECAT_EVT_REQ_MV_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_REQ_MV_MASK) >> ESC_ECAT_EVT_REQ_MV_SHIFT)
1385 
1386 /*
1387  * ALS_EVT (RO)
1388  *
1389  * AL Status event:
1390  * 0:No change in AL Status
1391  * 1:AL Status change
1392  * (Bit is cleared by reading out AL Status
1393  * 0x0130:0x0131 from ECAT)
1394  */
1395 #define ESC_ECAT_EVT_REQ_ALS_EVT_MASK (0x8U)
1396 #define ESC_ECAT_EVT_REQ_ALS_EVT_SHIFT (3U)
1397 #define ESC_ECAT_EVT_REQ_ALS_EVT_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_REQ_ALS_EVT_MASK) >> ESC_ECAT_EVT_REQ_ALS_EVT_SHIFT)
1398 
1399 /*
1400  * DLS_EVT (RO)
1401  *
1402  * DL Status event:
1403  * 0:No change in DL Status
1404  * 1:DL Status change
1405  * (Bit is cleared by reading out DL Status
1406  * 0x0110:0x0111 from ECAT)
1407  */
1408 #define ESC_ECAT_EVT_REQ_DLS_EVT_MASK (0x4U)
1409 #define ESC_ECAT_EVT_REQ_DLS_EVT_SHIFT (2U)
1410 #define ESC_ECAT_EVT_REQ_DLS_EVT_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_REQ_DLS_EVT_MASK) >> ESC_ECAT_EVT_REQ_DLS_EVT_SHIFT)
1411 
1412 /*
1413  * DCL_EVT (RO)
1414  *
1415  * DC Latch event:
1416  * 0:No change on DC Latch Inputs
1417  * 1:At least one change on DC Latch Inputs
1418  * (Bit is cleared by reading DC Latch event
1419  * times from ECAT for ECAT-controlled Latch
1420  * Units, so that Latch 0/1 Status
1421  * 0x09AE:0x09AF indicates no event)
1422  */
1423 #define ESC_ECAT_EVT_REQ_DCL_EVT_MASK (0x1U)
1424 #define ESC_ECAT_EVT_REQ_DCL_EVT_SHIFT (0U)
1425 #define ESC_ECAT_EVT_REQ_DCL_EVT_GET(x) (((uint16_t)(x) & ESC_ECAT_EVT_REQ_DCL_EVT_MASK) >> ESC_ECAT_EVT_REQ_DCL_EVT_SHIFT)
1426 
1427 /* Bitfield definition for register: AL_EVT_REQ */
1428 /*
1429  * SM_INT (RO)
1430  *
1431  * SyncManager interrupts (SyncManager
1432  * register offset 0x5, bit [0] or [1]):
1433  * 0:No SyncManager 0 interrupt
1434  * 1:SyncManager 0 interrupt pending
1435  * 0:No SyncManager 1 interrupt
1436  * 1:SyncManager 1 interrupt pending
1437  * …
1438  * 0:No SyncManager 15 interrupt
1439  * 1:SyncManager 15 interrupt pending
1440  */
1441 #define ESC_AL_EVT_REQ_SM_INT_MASK (0xFFFF00UL)
1442 #define ESC_AL_EVT_REQ_SM_INT_SHIFT (8U)
1443 #define ESC_AL_EVT_REQ_SM_INT_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_SM_INT_MASK) >> ESC_AL_EVT_REQ_SM_INT_SHIFT)
1444 
1445 /*
1446  * WDG_PD (RO)
1447  *
1448  * Watchdog Process Data:
1449  * 0:Has not expired
1450  * 1:Has expired
1451  * (Bit is cleared by reading Watchdog Status
1452  * Process Data 0x0440 from PDI)
1453  */
1454 #define ESC_AL_EVT_REQ_WDG_PD_MASK (0x40U)
1455 #define ESC_AL_EVT_REQ_WDG_PD_SHIFT (6U)
1456 #define ESC_AL_EVT_REQ_WDG_PD_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_WDG_PD_MASK) >> ESC_AL_EVT_REQ_WDG_PD_SHIFT)
1457 
1458 /*
1459  * EE_EMU (RO)
1460  *
1461  * EEPROM Emulation:
1462  * 0:No command pending
1463  * 1:EEPROM command pending
1464  * (Bit is cleared by acknowledging the
1465  * command in EEPROM Control/Status
1466  * register 0x0502:0x0503[10:8] from PDI)
1467  */
1468 #define ESC_AL_EVT_REQ_EE_EMU_MASK (0x20U)
1469 #define ESC_AL_EVT_REQ_EE_EMU_SHIFT (5U)
1470 #define ESC_AL_EVT_REQ_EE_EMU_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_EE_EMU_MASK) >> ESC_AL_EVT_REQ_EE_EMU_SHIFT)
1471 
1472 /*
1473  * SM_ACT (RO)
1474  *
1475  * SyncManager activation register
1476  * (SyncManager register offset 0x6) changed:
1477  * 0:No change in any SyncManager
1478  * 1:At least one SyncManager changed
1479  * (Bit is cleared by reading SyncManager
1480  * Activation registers 0x0806 etc. from PDI)
1481  */
1482 #define ESC_AL_EVT_REQ_SM_ACT_MASK (0x10U)
1483 #define ESC_AL_EVT_REQ_SM_ACT_SHIFT (4U)
1484 #define ESC_AL_EVT_REQ_SM_ACT_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_SM_ACT_MASK) >> ESC_AL_EVT_REQ_SM_ACT_SHIFT)
1485 
1486 /*
1487  * ST_DC_SYNC1 (RO)
1488  *
1489  * State of DC SYNC1 (if register
1490  * 0x0151[7]=1):
1491  * (Bit is cleared by reading of SYNC1 status
1492  * 0x098F from PDI, use only in Acknowledge
1493  * mode)
1494  */
1495 #define ESC_AL_EVT_REQ_ST_DC_SYNC1_MASK (0x8U)
1496 #define ESC_AL_EVT_REQ_ST_DC_SYNC1_SHIFT (3U)
1497 #define ESC_AL_EVT_REQ_ST_DC_SYNC1_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_ST_DC_SYNC1_MASK) >> ESC_AL_EVT_REQ_ST_DC_SYNC1_SHIFT)
1498 
1499 /*
1500  * ST_DC_SYNC0 (RO)
1501  *
1502  * State of DC SYNC0 (if register
1503  * 0x0151[3]=1):
1504  * (Bit is cleared by reading SYNC0 status
1505  * 0x098E from PDI, use only in Acknowledge
1506  * mode)
1507  */
1508 #define ESC_AL_EVT_REQ_ST_DC_SYNC0_MASK (0x4U)
1509 #define ESC_AL_EVT_REQ_ST_DC_SYNC0_SHIFT (2U)
1510 #define ESC_AL_EVT_REQ_ST_DC_SYNC0_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_ST_DC_SYNC0_MASK) >> ESC_AL_EVT_REQ_ST_DC_SYNC0_SHIFT)
1511 
1512 /*
1513  * DCL_EVT (RO)
1514  *
1515  * DC Latch event:
1516  * 0:No change on DC Latch Inputs
1517  * 1:At least one change on DC Latch Inputs
1518  * (Bit is cleared by reading DC Latch event
1519  * times from PDI, so that Latch 0/1 Status
1520  * 0x09AE:0x09AF indicates no event. Available
1521  * if Latch Unit is PDI-controlled)
1522  */
1523 #define ESC_AL_EVT_REQ_DCL_EVT_MASK (0x2U)
1524 #define ESC_AL_EVT_REQ_DCL_EVT_SHIFT (1U)
1525 #define ESC_AL_EVT_REQ_DCL_EVT_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_DCL_EVT_MASK) >> ESC_AL_EVT_REQ_DCL_EVT_SHIFT)
1526 
1527 /*
1528  * ALC_EVT (RO)
1529  *
1530  * AL Control event:
1531  * 0:No AL Control Register change
1532  * 1:AL Control Register has been written3
1533  * (Bit is cleared by reading AL Control register
1534  * 0x0120:0x0121 from PDI)
1535  */
1536 #define ESC_AL_EVT_REQ_ALC_EVT_MASK (0x1U)
1537 #define ESC_AL_EVT_REQ_ALC_EVT_SHIFT (0U)
1538 #define ESC_AL_EVT_REQ_ALC_EVT_GET(x) (((uint32_t)(x) & ESC_AL_EVT_REQ_ALC_EVT_MASK) >> ESC_AL_EVT_REQ_ALC_EVT_SHIFT)
1539 
1540 /* Bitfield definition for register array: RX_ERR_CNT */
1541 /*
1542  * RX_ERR (RO)
1543  *
1544  * RX Error counter of Port y (counting is
1545  * stopped when 0xFF is reached).
1546  */
1547 #define ESC_RX_ERR_CNT_RX_ERR_MASK (0xFF00U)
1548 #define ESC_RX_ERR_CNT_RX_ERR_SHIFT (8U)
1549 #define ESC_RX_ERR_CNT_RX_ERR_GET(x) (((uint16_t)(x) & ESC_RX_ERR_CNT_RX_ERR_MASK) >> ESC_RX_ERR_CNT_RX_ERR_SHIFT)
1550 
1551 /*
1552  * IVD_FRM (RO)
1553  *
1554  * Invalid frame counter of Port y (counting is
1555  * stopped when 0xFF is reached).
1556  */
1557 #define ESC_RX_ERR_CNT_IVD_FRM_MASK (0xFFU)
1558 #define ESC_RX_ERR_CNT_IVD_FRM_SHIFT (0U)
1559 #define ESC_RX_ERR_CNT_IVD_FRM_GET(x) (((uint16_t)(x) & ESC_RX_ERR_CNT_IVD_FRM_MASK) >> ESC_RX_ERR_CNT_IVD_FRM_SHIFT)
1560 
1561 /* Bitfield definition for register array: FWD_RX_ERR_CNT */
1562 /*
1563  * ERR_CNT (RO)
1564  *
1565  * Forwarded error counter of Port y (counting is
1566  * stopped when 0xFF is reached).
1567  */
1568 #define ESC_FWD_RX_ERR_CNT_ERR_CNT_MASK (0xFFU)
1569 #define ESC_FWD_RX_ERR_CNT_ERR_CNT_SHIFT (0U)
1570 #define ESC_FWD_RX_ERR_CNT_ERR_CNT_GET(x) (((uint8_t)(x) & ESC_FWD_RX_ERR_CNT_ERR_CNT_MASK) >> ESC_FWD_RX_ERR_CNT_ERR_CNT_SHIFT)
1571 
1572 /* Bitfield definition for register: ECAT_PU_ERR_CNT */
1573 /*
1574  * CNT (RO)
1575  *
1576  * ECAT Processing Unit error counter
1577  * (counting is stopped when 0xFF is reached).
1578  * Counts errors of frames passing the
1579  * Processing Unit.
1580  */
1581 #define ESC_ECAT_PU_ERR_CNT_CNT_MASK (0xFFU)
1582 #define ESC_ECAT_PU_ERR_CNT_CNT_SHIFT (0U)
1583 #define ESC_ECAT_PU_ERR_CNT_CNT_GET(x) (((uint8_t)(x) & ESC_ECAT_PU_ERR_CNT_CNT_MASK) >> ESC_ECAT_PU_ERR_CNT_CNT_SHIFT)
1584 
1585 /* Bitfield definition for register: PDI_ERR_CNT */
1586 /*
1587  * CNT (RO)
1588  *
1589  * PDI Error counter (counting is stopped when
1590  * 0xFF is reached). Counts if a PDI access has
1591  * an interface error.
1592  */
1593 #define ESC_PDI_ERR_CNT_CNT_MASK (0xFFU)
1594 #define ESC_PDI_ERR_CNT_CNT_SHIFT (0U)
1595 #define ESC_PDI_ERR_CNT_CNT_GET(x) (((uint8_t)(x) & ESC_PDI_ERR_CNT_CNT_MASK) >> ESC_PDI_ERR_CNT_CNT_SHIFT)
1596 
1597 /* Bitfield definition for register array: LOST_LINK_CNT */
1598 /*
1599  * CNT (RO)
1600  *
1601  * Lost Link counter of Port y (counting is
1602  * stopped when 0xff is reached). Counts only if
1603  * port is open and loop is Auto.
1604  */
1605 #define ESC_LOST_LINK_CNT_CNT_MASK (0xFFU)
1606 #define ESC_LOST_LINK_CNT_CNT_SHIFT (0U)
1607 #define ESC_LOST_LINK_CNT_CNT_GET(x) (((uint8_t)(x) & ESC_LOST_LINK_CNT_CNT_MASK) >> ESC_LOST_LINK_CNT_CNT_SHIFT)
1608 
1609 /* Bitfield definition for register: WDG_DIV */
1610 /*
1611  * DIV (RO)
1612  *
1613  * Watchdog divider:Number of 25 MHz tics
1614  * (minus 2) that represent the basic watchdog
1615  * increment. (Default value is 100µs = 2498)
1616  */
1617 #define ESC_WDG_DIV_DIV_MASK (0xFFFFU)
1618 #define ESC_WDG_DIV_DIV_SHIFT (0U)
1619 #define ESC_WDG_DIV_DIV_GET(x) (((uint16_t)(x) & ESC_WDG_DIV_DIV_MASK) >> ESC_WDG_DIV_DIV_SHIFT)
1620 
1621 /* Bitfield definition for register: WDG_TIME_PDI */
1622 /*
1623  * TIME (RO)
1624  *
1625  * Watchdog Time PDI:number of basic
1626  * watchdog increments
1627  * (Default value with Watchdog divider 100µs
1628  * means 100ms Watchdog)
1629  */
1630 #define ESC_WDG_TIME_PDI_TIME_MASK (0xFFFFU)
1631 #define ESC_WDG_TIME_PDI_TIME_SHIFT (0U)
1632 #define ESC_WDG_TIME_PDI_TIME_GET(x) (((uint16_t)(x) & ESC_WDG_TIME_PDI_TIME_MASK) >> ESC_WDG_TIME_PDI_TIME_SHIFT)
1633 
1634 /* Bitfield definition for register: WDG_TIME_PDAT */
1635 /*
1636  * TIME (RO)
1637  *
1638  * Watchdog Time Process Data:number of
1639  * basic watchdog increments
1640  * (Default value with Watchdog divider 100µs
1641  * means 100ms Watchdog)
1642  */
1643 #define ESC_WDG_TIME_PDAT_TIME_MASK (0xFFFFU)
1644 #define ESC_WDG_TIME_PDAT_TIME_SHIFT (0U)
1645 #define ESC_WDG_TIME_PDAT_TIME_GET(x) (((uint16_t)(x) & ESC_WDG_TIME_PDAT_TIME_MASK) >> ESC_WDG_TIME_PDAT_TIME_SHIFT)
1646 
1647 /* Bitfield definition for register: WDG_STAT_PDAT */
1648 /*
1649  * ST (RW)
1650  *
1651  * Watchdog Status of Process Data (triggered
1652  * by SyncManagers)
1653  * 0:Watchdog Process Data expired
1654  * 1:Watchdog Process Data is active or
1655  * disabled
1656  */
1657 #define ESC_WDG_STAT_PDAT_ST_MASK (0x1U)
1658 #define ESC_WDG_STAT_PDAT_ST_SHIFT (0U)
1659 #define ESC_WDG_STAT_PDAT_ST_SET(x) (((uint16_t)(x) << ESC_WDG_STAT_PDAT_ST_SHIFT) & ESC_WDG_STAT_PDAT_ST_MASK)
1660 #define ESC_WDG_STAT_PDAT_ST_GET(x) (((uint16_t)(x) & ESC_WDG_STAT_PDAT_ST_MASK) >> ESC_WDG_STAT_PDAT_ST_SHIFT)
1661 
1662 /* Bitfield definition for register: WDG_CNT_PDAT */
1663 /*
1664  * CNT (RO)
1665  *
1666  * Watchdog Counter Process Data (counting is
1667  * stopped when 0xFF is reached). Counts if
1668  * Process Data Watchdog expires.
1669  */
1670 #define ESC_WDG_CNT_PDAT_CNT_MASK (0xFFU)
1671 #define ESC_WDG_CNT_PDAT_CNT_SHIFT (0U)
1672 #define ESC_WDG_CNT_PDAT_CNT_GET(x) (((uint8_t)(x) & ESC_WDG_CNT_PDAT_CNT_MASK) >> ESC_WDG_CNT_PDAT_CNT_SHIFT)
1673 
1674 /* Bitfield definition for register: WDG_CNT_PDI */
1675 /*
1676  * CNT (RO)
1677  *
1678  * Watchdog PDI counter (counting is stopped
1679  * when 0xFF is reached). Counts if PDI
1680  * Watchdog expires.
1681  */
1682 #define ESC_WDG_CNT_PDI_CNT_MASK (0xFFU)
1683 #define ESC_WDG_CNT_PDI_CNT_SHIFT (0U)
1684 #define ESC_WDG_CNT_PDI_CNT_GET(x) (((uint8_t)(x) & ESC_WDG_CNT_PDI_CNT_MASK) >> ESC_WDG_CNT_PDI_CNT_SHIFT)
1685 
1686 /* Bitfield definition for register: EEPROM_CFG */
1687 /*
1688  * FORCE_ECAT (RO)
1689  *
1690  * Force ECAT access:
1691  * 0:Do not change Bit 0x0501[0]
1692  * 1:Reset Bit 0x0501[0] to 0
1693  */
1694 #define ESC_EEPROM_CFG_FORCE_ECAT_MASK (0x2U)
1695 #define ESC_EEPROM_CFG_FORCE_ECAT_SHIFT (1U)
1696 #define ESC_EEPROM_CFG_FORCE_ECAT_GET(x) (((uint8_t)(x) & ESC_EEPROM_CFG_FORCE_ECAT_MASK) >> ESC_EEPROM_CFG_FORCE_ECAT_SHIFT)
1697 
1698 /*
1699  * PDI (RO)
1700  *
1701  * EEPROM control is offered to PDI:
1702  * 0:no
1703  * 1:yes (PDI has EEPROM control)
1704  */
1705 #define ESC_EEPROM_CFG_PDI_MASK (0x1U)
1706 #define ESC_EEPROM_CFG_PDI_SHIFT (0U)
1707 #define ESC_EEPROM_CFG_PDI_GET(x) (((uint8_t)(x) & ESC_EEPROM_CFG_PDI_MASK) >> ESC_EEPROM_CFG_PDI_SHIFT)
1708 
1709 /* Bitfield definition for register: EEPROM_PDI_ACC_STAT */
1710 /*
1711  * ACCESS (RW)
1712  *
1713  * Access to EEPROM:
1714  * 0:PDI releases EEPROM access
1715  * 1:PDI takes EEPROM access (PDI has
1716  * EEPROM control)
1717  */
1718 #define ESC_EEPROM_PDI_ACC_STAT_ACCESS_MASK (0x1U)
1719 #define ESC_EEPROM_PDI_ACC_STAT_ACCESS_SHIFT (0U)
1720 #define ESC_EEPROM_PDI_ACC_STAT_ACCESS_SET(x) (((uint8_t)(x) << ESC_EEPROM_PDI_ACC_STAT_ACCESS_SHIFT) & ESC_EEPROM_PDI_ACC_STAT_ACCESS_MASK)
1721 #define ESC_EEPROM_PDI_ACC_STAT_ACCESS_GET(x) (((uint8_t)(x) & ESC_EEPROM_PDI_ACC_STAT_ACCESS_MASK) >> ESC_EEPROM_PDI_ACC_STAT_ACCESS_SHIFT)
1722 
1723 /* Bitfield definition for register: EEPROM_CTRL_STAT */
1724 /*
1725  * BUSY (RO)
1726  *
1727  * Busy:
1728  * 0:EEPROM Interface is idle
1729  * 1:EEPROM Interface is busy
1730  */
1731 #define ESC_EEPROM_CTRL_STAT_BUSY_MASK (0x8000U)
1732 #define ESC_EEPROM_CTRL_STAT_BUSY_SHIFT (15U)
1733 #define ESC_EEPROM_CTRL_STAT_BUSY_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_BUSY_MASK) >> ESC_EEPROM_CTRL_STAT_BUSY_SHIFT)
1734 
1735 /*
1736  * ERR_WEN (RO)
1737  *
1738  * Error Write Enable*3
1739  * :
1740  * 0:No error
1741  * 1:Write Command without Write enable
1742  */
1743 #define ESC_EEPROM_CTRL_STAT_ERR_WEN_MASK (0x4000U)
1744 #define ESC_EEPROM_CTRL_STAT_ERR_WEN_SHIFT (14U)
1745 #define ESC_EEPROM_CTRL_STAT_ERR_WEN_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_ERR_WEN_MASK) >> ESC_EEPROM_CTRL_STAT_ERR_WEN_SHIFT)
1746 
1747 /*
1748  * ERR_ACK_CMD (RW)
1749  *
1750  * Error Acknowledge/Command*3
1751  * :
1752  * 0:No error
1753  * 1:Missing EEPROM acknowledge or invalid
1754  * command
1755  * EEPROM emulation only:PDI writes 1 if a temporary
1756  * failure has occurred.
1757  */
1758 #define ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_MASK (0x2000U)
1759 #define ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_SHIFT (13U)
1760 #define ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_SET(x) (((uint16_t)(x) << ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_SHIFT) & ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_MASK)
1761 #define ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_MASK) >> ESC_EEPROM_CTRL_STAT_ERR_ACK_CMD_SHIFT)
1762 
1763 /*
1764  * EE_LDS (RO)
1765  *
1766  * EEPROM loading status:
1767  * 0:EEPROM loaded, device information ok
1768  * 1:EEPROM not loaded, device information not
1769  * available (EEPROM loading in progress or
1770  * finished with a failure)
1771  */
1772 #define ESC_EEPROM_CTRL_STAT_EE_LDS_MASK (0x1000U)
1773 #define ESC_EEPROM_CTRL_STAT_EE_LDS_SHIFT (12U)
1774 #define ESC_EEPROM_CTRL_STAT_EE_LDS_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_EE_LDS_MASK) >> ESC_EEPROM_CTRL_STAT_EE_LDS_SHIFT)
1775 
1776 /*
1777  * CKSM_ERR (RW)
1778  *
1779  * Checksum Error in ESC Configuration Area:
1780  * 0:Checksum ok
1781  * 1:Checksum error
1782  * EEPROM emulation for IP Core only:PDI writes 1 if a
1783  * CRC failure has occurred for a reload command.
1784  */
1785 #define ESC_EEPROM_CTRL_STAT_CKSM_ERR_MASK (0x800U)
1786 #define ESC_EEPROM_CTRL_STAT_CKSM_ERR_SHIFT (11U)
1787 #define ESC_EEPROM_CTRL_STAT_CKSM_ERR_SET(x) (((uint16_t)(x) << ESC_EEPROM_CTRL_STAT_CKSM_ERR_SHIFT) & ESC_EEPROM_CTRL_STAT_CKSM_ERR_MASK)
1788 #define ESC_EEPROM_CTRL_STAT_CKSM_ERR_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_CKSM_ERR_MASK) >> ESC_EEPROM_CTRL_STAT_CKSM_ERR_SHIFT)
1789 
1790 /*
1791  * CMD (RW)
1792  *
1793  * Command register*2:
1794  * Write:Initiate command.
1795  * Read:Currently executed command
1796  * Commands:
1797  * 000:No command/EEPROM idle (clear error bits)
1798  * 001:Read
1799  * 010:Write
1800  * 100:Reload
1801  * Others:Reserved/invalid commands (do not issue)
1802  * EEPROM emulation only:after execution, PDI writes
1803  * command value to indicate operation is ready.
1804  */
1805 #define ESC_EEPROM_CTRL_STAT_CMD_MASK (0x700U)
1806 #define ESC_EEPROM_CTRL_STAT_CMD_SHIFT (8U)
1807 #define ESC_EEPROM_CTRL_STAT_CMD_SET(x) (((uint16_t)(x) << ESC_EEPROM_CTRL_STAT_CMD_SHIFT) & ESC_EEPROM_CTRL_STAT_CMD_MASK)
1808 #define ESC_EEPROM_CTRL_STAT_CMD_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_CMD_MASK) >> ESC_EEPROM_CTRL_STAT_CMD_SHIFT)
1809 
1810 /*
1811  * EE_ALGM (RO)
1812  *
1813  * Selected EEPROM Algorithm:
1814  * 0:1 address byte (1Kbit – 16Kbit EEPROMs)
1815  * 1:2 address bytes (32Kbit – 4 Mbit EEPROMs)
1816  */
1817 #define ESC_EEPROM_CTRL_STAT_EE_ALGM_MASK (0x80U)
1818 #define ESC_EEPROM_CTRL_STAT_EE_ALGM_SHIFT (7U)
1819 #define ESC_EEPROM_CTRL_STAT_EE_ALGM_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_EE_ALGM_MASK) >> ESC_EEPROM_CTRL_STAT_EE_ALGM_SHIFT)
1820 
1821 /*
1822  * NUM_RD_BYTE (RO)
1823  *
1824  * Supported number of EEPROM read bytes:
1825  * 0:4 Bytes
1826  * 1:8 Bytes
1827  */
1828 #define ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_MASK (0x40U)
1829 #define ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_SHIFT (6U)
1830 #define ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_MASK) >> ESC_EEPROM_CTRL_STAT_NUM_RD_BYTE_SHIFT)
1831 
1832 /*
1833  * EE_EMU (RO)
1834  *
1835  * EPROM emulation:
1836  * 0:Normal operation (I²C interface used)
1837  * 1:PDI emulates EEPROM (I²C not used)
1838  */
1839 #define ESC_EEPROM_CTRL_STAT_EE_EMU_MASK (0x20U)
1840 #define ESC_EEPROM_CTRL_STAT_EE_EMU_SHIFT (5U)
1841 #define ESC_EEPROM_CTRL_STAT_EE_EMU_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_EE_EMU_MASK) >> ESC_EEPROM_CTRL_STAT_EE_EMU_SHIFT)
1842 
1843 /*
1844  * ECAT_WEN (RO)
1845  *
1846  * ECAT write enable*2
1847  * :
1848  * 0:Write requests are disabled
1849  * 1:Write requests are enabled
1850  * This bit is always 1 if PDI has EEPROM control.
1851  */
1852 #define ESC_EEPROM_CTRL_STAT_ECAT_WEN_MASK (0x1U)
1853 #define ESC_EEPROM_CTRL_STAT_ECAT_WEN_SHIFT (0U)
1854 #define ESC_EEPROM_CTRL_STAT_ECAT_WEN_GET(x) (((uint16_t)(x) & ESC_EEPROM_CTRL_STAT_ECAT_WEN_MASK) >> ESC_EEPROM_CTRL_STAT_ECAT_WEN_SHIFT)
1855 
1856 /* Bitfield definition for register: EEPROM_ADDR */
1857 /*
1858  * ADDR (RW)
1859  *
1860  * EEPROM Address
1861  * 0:First word (= 16 bit)
1862  * 1:Second word
1863  * …
1864  * Actually used EEPROM Address bits:
1865  * 9-0: EEPROM size up to 16 Kbit
1866  * 17-0: EEPROM size 32 Kbit – 4 Mbit
1867  * 31-0: EEPROM Emulation
1868  */
1869 #define ESC_EEPROM_ADDR_ADDR_MASK (0xFFFFFFFFUL)
1870 #define ESC_EEPROM_ADDR_ADDR_SHIFT (0U)
1871 #define ESC_EEPROM_ADDR_ADDR_SET(x) (((uint32_t)(x) << ESC_EEPROM_ADDR_ADDR_SHIFT) & ESC_EEPROM_ADDR_ADDR_MASK)
1872 #define ESC_EEPROM_ADDR_ADDR_GET(x) (((uint32_t)(x) & ESC_EEPROM_ADDR_ADDR_MASK) >> ESC_EEPROM_ADDR_ADDR_SHIFT)
1873 
1874 /* Bitfield definition for register: EEPROM_DATA */
1875 /*
1876  * HI (RW)
1877  *
1878  * EEPROM Read data (data read from
1879  * EEPROM, higher bytes)
1880  */
1881 #define ESC_EEPROM_DATA_HI_MASK (0xFFFFFFFFFFFF0000ULL)
1882 #define ESC_EEPROM_DATA_HI_SHIFT (16U)
1883 #define ESC_EEPROM_DATA_HI_SET(x) (((uint64_t)(x) << ESC_EEPROM_DATA_HI_SHIFT) & ESC_EEPROM_DATA_HI_MASK)
1884 #define ESC_EEPROM_DATA_HI_GET(x) (((uint64_t)(x) & ESC_EEPROM_DATA_HI_MASK) >> ESC_EEPROM_DATA_HI_SHIFT)
1885 
1886 /*
1887  * LO (RW)
1888  *
1889  * EEPROM Write data (data to be written to
1890  * EEPROM) or
1891  * EEPROM Read data (data read from
1892  * EEPROM, lower bytes)
1893  */
1894 #define ESC_EEPROM_DATA_LO_MASK (0xFFFFU)
1895 #define ESC_EEPROM_DATA_LO_SHIFT (0U)
1896 #define ESC_EEPROM_DATA_LO_SET(x) (((uint64_t)(x) << ESC_EEPROM_DATA_LO_SHIFT) & ESC_EEPROM_DATA_LO_MASK)
1897 #define ESC_EEPROM_DATA_LO_GET(x) (((uint64_t)(x) & ESC_EEPROM_DATA_LO_MASK) >> ESC_EEPROM_DATA_LO_SHIFT)
1898 
1899 /* Bitfield definition for register: MII_MNG_CS */
1900 /*
1901  * BUSY (RO)
1902  *
1903  * Busy:
1904  * 0:MII Management Interface is idle
1905  * 1:MII Management Interface is busy
1906  */
1907 #define ESC_MII_MNG_CS_BUSY_MASK (0x8000U)
1908 #define ESC_MII_MNG_CS_BUSY_SHIFT (15U)
1909 #define ESC_MII_MNG_CS_BUSY_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_BUSY_MASK) >> ESC_MII_MNG_CS_BUSY_SHIFT)
1910 
1911 /*
1912  * CMD_ERR (RO)
1913  *
1914  * Command error:
1915  * 0:Last Command was successful
1916  * 1:Invalid command or write command
1917  * without Write Enable
1918  * Cleared by executing a valid command or by
1919  * writing “00” to Command register bits [9:8].
1920  */
1921 #define ESC_MII_MNG_CS_CMD_ERR_MASK (0x4000U)
1922 #define ESC_MII_MNG_CS_CMD_ERR_SHIFT (14U)
1923 #define ESC_MII_MNG_CS_CMD_ERR_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_CMD_ERR_MASK) >> ESC_MII_MNG_CS_CMD_ERR_SHIFT)
1924 
1925 /*
1926  * RD_ERR (RO)
1927  *
1928  * Read error:
1929  * 0:No read error
1930  * 1:Read error occurred (PHY or register
1931  * not available)
1932  * Cleared by writing to register 0x0511
1933  */
1934 #define ESC_MII_MNG_CS_RD_ERR_MASK (0x2000U)
1935 #define ESC_MII_MNG_CS_RD_ERR_SHIFT (13U)
1936 #define ESC_MII_MNG_CS_RD_ERR_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_RD_ERR_MASK) >> ESC_MII_MNG_CS_RD_ERR_SHIFT)
1937 
1938 /*
1939  * CMD (RW)
1940  *
1941  * Command register*:
1942  * Write:Initiate command.
1943  * Read:Currently executed command
1944  * 00:No command/MI idle (clear error bits)
1945  * 01:Read
1946  * 10:Write
1947  * Others:Reserved/invalid command (do not
1948  * issue)
1949  */
1950 #define ESC_MII_MNG_CS_CMD_MASK (0x300U)
1951 #define ESC_MII_MNG_CS_CMD_SHIFT (8U)
1952 #define ESC_MII_MNG_CS_CMD_SET(x) (((uint16_t)(x) << ESC_MII_MNG_CS_CMD_SHIFT) & ESC_MII_MNG_CS_CMD_MASK)
1953 #define ESC_MII_MNG_CS_CMD_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_CMD_MASK) >> ESC_MII_MNG_CS_CMD_SHIFT)
1954 
1955 /*
1956  * PHY_ADDR (RO)
1957  *
1958  * PHY address of port 0
1959  * (this is equal to the PHY address offset, if the
1960  * PHY addresses are consecutive)
1961  * IP Core since V3.0.0/3.00c:
1962  * Translation 0x0512[7]=0:
1963  * Register 0x0510[7:3] shows PHY address of
1964  * port 0
1965  * Translation 0x0512[7]=1:
1966  * Register 0x0510[7:3] shows the PHY address
1967  * which will be used for port 0-3 as requested
1968  * by 0x0512[4:0] (valid values 0-3)
1969  */
1970 #define ESC_MII_MNG_CS_PHY_ADDR_MASK (0xF8U)
1971 #define ESC_MII_MNG_CS_PHY_ADDR_SHIFT (3U)
1972 #define ESC_MII_MNG_CS_PHY_ADDR_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_PHY_ADDR_MASK) >> ESC_MII_MNG_CS_PHY_ADDR_SHIFT)
1973 
1974 /*
1975  * LINK_DC (RO)
1976  *
1977  * MI link detection and configuration:
1978  * 0:Disabled for all ports
1979  * 1:Enabled for at least one MII port, refer
1980  * to PHY Port Status (0x0518 ff.) for
1981  * details
1982  */
1983 #define ESC_MII_MNG_CS_LINK_DC_MASK (0x4U)
1984 #define ESC_MII_MNG_CS_LINK_DC_SHIFT (2U)
1985 #define ESC_MII_MNG_CS_LINK_DC_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_LINK_DC_MASK) >> ESC_MII_MNG_CS_LINK_DC_SHIFT)
1986 
1987 /*
1988  * PDI (RO)
1989  *
1990  * Management Interface can be controlled by
1991  * PDI (registers 0x0516-0x0517):
1992  * 0:Only ECAT control
1993  * 1:PDI control possible
1994  */
1995 #define ESC_MII_MNG_CS_PDI_MASK (0x2U)
1996 #define ESC_MII_MNG_CS_PDI_SHIFT (1U)
1997 #define ESC_MII_MNG_CS_PDI_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_PDI_MASK) >> ESC_MII_MNG_CS_PDI_SHIFT)
1998 
1999 /*
2000  * WEN (RO)
2001  *
2002  * Write enable*:
2003  * 0:Write disabled
2004  * 1:Write enabled
2005  * This bit is always 1 if PDI has MI control.
2006  * ET1100-0000/-0001 exception:
2007  * Bit is not always 1 if PDI has MI control, and
2008  * bit is writable by PDI.
2009  */
2010 #define ESC_MII_MNG_CS_WEN_MASK (0x1U)
2011 #define ESC_MII_MNG_CS_WEN_SHIFT (0U)
2012 #define ESC_MII_MNG_CS_WEN_GET(x) (((uint16_t)(x) & ESC_MII_MNG_CS_WEN_MASK) >> ESC_MII_MNG_CS_WEN_SHIFT)
2013 
2014 /* Bitfield definition for register: PHY_ADDR */
2015 /*
2016  * SHOW (RW)
2017  *
2018  * Target PHY Address translation:
2019  * 0:Enabled
2020  * 1:Disabled
2021  * Refer to 0x0512[4:0] and 0x0510[7:3] for
2022  * details.
2023  */
2024 #define ESC_PHY_ADDR_SHOW_MASK (0x80U)
2025 #define ESC_PHY_ADDR_SHOW_SHIFT (7U)
2026 #define ESC_PHY_ADDR_SHOW_SET(x) (((uint8_t)(x) << ESC_PHY_ADDR_SHOW_SHIFT) & ESC_PHY_ADDR_SHOW_MASK)
2027 #define ESC_PHY_ADDR_SHOW_GET(x) (((uint8_t)(x) & ESC_PHY_ADDR_SHOW_MASK) >> ESC_PHY_ADDR_SHOW_SHIFT)
2028 
2029 /*
2030  * ADDR (RW)
2031  *
2032  * Target PHY Address
2033  * Translation 0x0512[7]=0:
2034  * 0-3:Target PHY Addresses 0-3 are used
2035  * to access the PHYs at port 0-3, when
2036  * the PHY addresses are properly
2037  * configured
2038  * 4-31:The configured PHY address of port 0
2039  * (PHY address offset) is added to the
2040  * Target PHY Address values 4-31
2041  * when accessing a PHY
2042  * Translation 0x0512[7]=1:
2043  * 0-31:Target PHY Addresses is used when
2044  * accessing a PHY without translation
2045  */
2046 #define ESC_PHY_ADDR_ADDR_MASK (0x1FU)
2047 #define ESC_PHY_ADDR_ADDR_SHIFT (0U)
2048 #define ESC_PHY_ADDR_ADDR_SET(x) (((uint8_t)(x) << ESC_PHY_ADDR_ADDR_SHIFT) & ESC_PHY_ADDR_ADDR_MASK)
2049 #define ESC_PHY_ADDR_ADDR_GET(x) (((uint8_t)(x) & ESC_PHY_ADDR_ADDR_MASK) >> ESC_PHY_ADDR_ADDR_SHIFT)
2050 
2051 /* Bitfield definition for register: PHY_REG_ADDR */
2052 /*
2053  * ADDR (RW)
2054  *
2055  * Address of PHY Register that shall be
2056  * read/written
2057  */
2058 #define ESC_PHY_REG_ADDR_ADDR_MASK (0x1FU)
2059 #define ESC_PHY_REG_ADDR_ADDR_SHIFT (0U)
2060 #define ESC_PHY_REG_ADDR_ADDR_SET(x) (((uint8_t)(x) << ESC_PHY_REG_ADDR_ADDR_SHIFT) & ESC_PHY_REG_ADDR_ADDR_MASK)
2061 #define ESC_PHY_REG_ADDR_ADDR_GET(x) (((uint8_t)(x) & ESC_PHY_REG_ADDR_ADDR_MASK) >> ESC_PHY_REG_ADDR_ADDR_SHIFT)
2062 
2063 /* Bitfield definition for register: PHY_DATA */
2064 /*
2065  * DATA (RW)
2066  *
2067  * PHY Read/Write Data
2068  */
2069 #define ESC_PHY_DATA_DATA_MASK (0xFFFFU)
2070 #define ESC_PHY_DATA_DATA_SHIFT (0U)
2071 #define ESC_PHY_DATA_DATA_SET(x) (((uint16_t)(x) << ESC_PHY_DATA_DATA_SHIFT) & ESC_PHY_DATA_DATA_MASK)
2072 #define ESC_PHY_DATA_DATA_GET(x) (((uint16_t)(x) & ESC_PHY_DATA_DATA_MASK) >> ESC_PHY_DATA_DATA_SHIFT)
2073 
2074 /* Bitfield definition for register: MIIM_ECAT_ACC_STAT */
2075 /*
2076  * ACC (RO)
2077  *
2078  * Access to MII management:
2079  * 0:ECAT enables PDI takeover of MII
2080  * management interface
2081  * 1:ECAT claims exclusive access to MII
2082  * management interface
2083  */
2084 #define ESC_MIIM_ECAT_ACC_STAT_ACC_MASK (0x1U)
2085 #define ESC_MIIM_ECAT_ACC_STAT_ACC_SHIFT (0U)
2086 #define ESC_MIIM_ECAT_ACC_STAT_ACC_GET(x) (((uint8_t)(x) & ESC_MIIM_ECAT_ACC_STAT_ACC_MASK) >> ESC_MIIM_ECAT_ACC_STAT_ACC_SHIFT)
2087 
2088 /* Bitfield definition for register: MIIM_PDI_ACC_STAT */
2089 /*
2090  * FORCE (RO)
2091  *
2092  * Force PDI Access State:
2093  * 0:Do not change Bit 0x0517[0]
2094  * 1:Reset Bit 0x0517[0] to 0
2095  */
2096 #define ESC_MIIM_PDI_ACC_STAT_FORCE_MASK (0x2U)
2097 #define ESC_MIIM_PDI_ACC_STAT_FORCE_SHIFT (1U)
2098 #define ESC_MIIM_PDI_ACC_STAT_FORCE_GET(x) (((uint8_t)(x) & ESC_MIIM_PDI_ACC_STAT_FORCE_MASK) >> ESC_MIIM_PDI_ACC_STAT_FORCE_SHIFT)
2099 
2100 /*
2101  * ACC (RW)
2102  *
2103  * Access to MII management:
2104  * 0:ECAT has access to MII management
2105  * 1:PDI has access to MII management
2106  */
2107 #define ESC_MIIM_PDI_ACC_STAT_ACC_MASK (0x1U)
2108 #define ESC_MIIM_PDI_ACC_STAT_ACC_SHIFT (0U)
2109 #define ESC_MIIM_PDI_ACC_STAT_ACC_SET(x) (((uint8_t)(x) << ESC_MIIM_PDI_ACC_STAT_ACC_SHIFT) & ESC_MIIM_PDI_ACC_STAT_ACC_MASK)
2110 #define ESC_MIIM_PDI_ACC_STAT_ACC_GET(x) (((uint8_t)(x) & ESC_MIIM_PDI_ACC_STAT_ACC_MASK) >> ESC_MIIM_PDI_ACC_STAT_ACC_SHIFT)
2111 
2112 /* Bitfield definition for register array: PHY_STAT */
2113 /*
2114  * PCU (RW)
2115  *
2116  * PHY configuration updated:
2117  * 0:No update
2118  * 1:PHY configuration was updated
2119  * Cleared by writing any value to at least one
2120  * of the PHY Port y Status registers.
2121  */
2122 #define ESC_PHY_STAT_PCU_MASK (0x20U)
2123 #define ESC_PHY_STAT_PCU_SHIFT (5U)
2124 #define ESC_PHY_STAT_PCU_SET(x) (((uint8_t)(x) << ESC_PHY_STAT_PCU_SHIFT) & ESC_PHY_STAT_PCU_MASK)
2125 #define ESC_PHY_STAT_PCU_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_PCU_MASK) >> ESC_PHY_STAT_PCU_SHIFT)
2126 
2127 /*
2128  * LPE (RO)
2129  *
2130  * Link partner error:
2131  * 0:No error detected
2132  * 1:Link partner error
2133  */
2134 #define ESC_PHY_STAT_LPE_MASK (0x10U)
2135 #define ESC_PHY_STAT_LPE_SHIFT (4U)
2136 #define ESC_PHY_STAT_LPE_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_LPE_MASK) >> ESC_PHY_STAT_LPE_SHIFT)
2137 
2138 /*
2139  * RE (RW)
2140  *
2141  * Read error:
2142  * 0:No read error occurred
2143  * 1:A read error has occurred
2144  * Cleared by writing any value to at least one
2145  * of the PHY Port y Status registers.
2146  */
2147 #define ESC_PHY_STAT_RE_MASK (0x8U)
2148 #define ESC_PHY_STAT_RE_SHIFT (3U)
2149 #define ESC_PHY_STAT_RE_SET(x) (((uint8_t)(x) << ESC_PHY_STAT_RE_SHIFT) & ESC_PHY_STAT_RE_MASK)
2150 #define ESC_PHY_STAT_RE_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_RE_MASK) >> ESC_PHY_STAT_RE_SHIFT)
2151 
2152 /*
2153  * LSE (RO)
2154  *
2155  * Link status error:
2156  * 0:No error
2157  * 1:Link error, link inhibited
2158  */
2159 #define ESC_PHY_STAT_LSE_MASK (0x4U)
2160 #define ESC_PHY_STAT_LSE_SHIFT (2U)
2161 #define ESC_PHY_STAT_LSE_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_LSE_MASK) >> ESC_PHY_STAT_LSE_SHIFT)
2162 
2163 /*
2164  * LS (RO)
2165  *
2166  * Link status (100 Mbit/s, Full Duplex, Auto
2167  * negotiation):
2168  * 0:No link
2169  * 1:Link detected
2170  */
2171 #define ESC_PHY_STAT_LS_MASK (0x2U)
2172 #define ESC_PHY_STAT_LS_SHIFT (1U)
2173 #define ESC_PHY_STAT_LS_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_LS_MASK) >> ESC_PHY_STAT_LS_SHIFT)
2174 
2175 /*
2176  * PLS (RO)
2177  *
2178  * Physical link status (PHY status register 1.2):
2179  * 0:No physical link
2180  * 1:Physical link detected
2181  */
2182 #define ESC_PHY_STAT_PLS_MASK (0x1U)
2183 #define ESC_PHY_STAT_PLS_SHIFT (0U)
2184 #define ESC_PHY_STAT_PLS_GET(x) (((uint8_t)(x) & ESC_PHY_STAT_PLS_MASK) >> ESC_PHY_STAT_PLS_SHIFT)
2185 
2186 /* Bitfield definition for register of struct array FMMU: LOGIC_START_ADDR */
2187 /*
2188  * ADDR (RO)
2189  *
2190  * Logical start address within the EtherCAT
2191  * Address Space.
2192  */
2193 #define ESC_FMMU_LOGIC_START_ADDR_ADDR_MASK (0xFFFFFFFFUL)
2194 #define ESC_FMMU_LOGIC_START_ADDR_ADDR_SHIFT (0U)
2195 #define ESC_FMMU_LOGIC_START_ADDR_ADDR_GET(x) (((uint32_t)(x) & ESC_FMMU_LOGIC_START_ADDR_ADDR_MASK) >> ESC_FMMU_LOGIC_START_ADDR_ADDR_SHIFT)
2196 
2197 /* Bitfield definition for register of struct array FMMU: LENGTH */
2198 /*
2199  * OFFSET (RO)
2200  *
2201  * Offset from the first logical FMMU byte to the
2202  * last FMMU byte + 1 (e.g., if two bytes are
2203  * used, then this parameter shall contain 2)
2204  */
2205 #define ESC_FMMU_LENGTH_OFFSET_MASK (0xFFFFU)
2206 #define ESC_FMMU_LENGTH_OFFSET_SHIFT (0U)
2207 #define ESC_FMMU_LENGTH_OFFSET_GET(x) (((uint16_t)(x) & ESC_FMMU_LENGTH_OFFSET_MASK) >> ESC_FMMU_LENGTH_OFFSET_SHIFT)
2208 
2209 /* Bitfield definition for register of struct array FMMU: LOGIC_START_BIT */
2210 /*
2211  * START (RO)
2212  *
2213  * Logical starting bit that shall be mapped (bits
2214  * are counted from least significant bit 0 to
2215  * most significant bit 7)
2216  */
2217 #define ESC_FMMU_LOGIC_START_BIT_START_MASK (0x7U)
2218 #define ESC_FMMU_LOGIC_START_BIT_START_SHIFT (0U)
2219 #define ESC_FMMU_LOGIC_START_BIT_START_GET(x) (((uint8_t)(x) & ESC_FMMU_LOGIC_START_BIT_START_MASK) >> ESC_FMMU_LOGIC_START_BIT_START_SHIFT)
2220 
2221 /* Bitfield definition for register of struct array FMMU: LOGIC_STOP_BIT */
2222 /*
2223  * STOP (RO)
2224  *
2225  * Last logical bit that shall be mapped (bits are
2226  * counted from least significant bit 0 to most
2227  * significant bit 7)
2228  */
2229 #define ESC_FMMU_LOGIC_STOP_BIT_STOP_MASK (0x7U)
2230 #define ESC_FMMU_LOGIC_STOP_BIT_STOP_SHIFT (0U)
2231 #define ESC_FMMU_LOGIC_STOP_BIT_STOP_GET(x) (((uint8_t)(x) & ESC_FMMU_LOGIC_STOP_BIT_STOP_MASK) >> ESC_FMMU_LOGIC_STOP_BIT_STOP_SHIFT)
2232 
2233 /* Bitfield definition for register of struct array FMMU: PHYSICAL_START_ADDR */
2234 /*
2235  * ADDR (RO)
2236  *
2237  * Physical Start Address (mapped to logical
2238  * Start address)
2239  */
2240 #define ESC_FMMU_PHYSICAL_START_ADDR_ADDR_MASK (0xFFFFU)
2241 #define ESC_FMMU_PHYSICAL_START_ADDR_ADDR_SHIFT (0U)
2242 #define ESC_FMMU_PHYSICAL_START_ADDR_ADDR_GET(x) (((uint16_t)(x) & ESC_FMMU_PHYSICAL_START_ADDR_ADDR_MASK) >> ESC_FMMU_PHYSICAL_START_ADDR_ADDR_SHIFT)
2243 
2244 /* Bitfield definition for register of struct array FMMU: PHYSICAL_START_BIT */
2245 /*
2246  * START (RO)
2247  *
2248  * Physical starting bit as target of logical start
2249  * bit mapping (bits are counted from least
2250  * significant bit 0 to most significant bit 7)
2251  */
2252 #define ESC_FMMU_PHYSICAL_START_BIT_START_MASK (0x7U)
2253 #define ESC_FMMU_PHYSICAL_START_BIT_START_SHIFT (0U)
2254 #define ESC_FMMU_PHYSICAL_START_BIT_START_GET(x) (((uint8_t)(x) & ESC_FMMU_PHYSICAL_START_BIT_START_MASK) >> ESC_FMMU_PHYSICAL_START_BIT_START_SHIFT)
2255 
2256 /* Bitfield definition for register of struct array FMMU: TYPE */
2257 /*
2258  * MAP_WR (RO)
2259  *
2260  * 0:Ignore mapping for write accesses
2261  * 1:Use mapping for write accesses
2262  */
2263 #define ESC_FMMU_TYPE_MAP_WR_MASK (0x2U)
2264 #define ESC_FMMU_TYPE_MAP_WR_SHIFT (1U)
2265 #define ESC_FMMU_TYPE_MAP_WR_GET(x) (((uint8_t)(x) & ESC_FMMU_TYPE_MAP_WR_MASK) >> ESC_FMMU_TYPE_MAP_WR_SHIFT)
2266 
2267 /*
2268  * MAP_RD (RO)
2269  *
2270  * 0:Ignore mapping for read accesses
2271  * 1:Use mapping for read accesses
2272  */
2273 #define ESC_FMMU_TYPE_MAP_RD_MASK (0x1U)
2274 #define ESC_FMMU_TYPE_MAP_RD_SHIFT (0U)
2275 #define ESC_FMMU_TYPE_MAP_RD_GET(x) (((uint8_t)(x) & ESC_FMMU_TYPE_MAP_RD_MASK) >> ESC_FMMU_TYPE_MAP_RD_SHIFT)
2276 
2277 /* Bitfield definition for register of struct array FMMU: ACTIVATE */
2278 /*
2279  * ACT (RO)
2280  *
2281  * 0:FMMU deactivated
2282  * 1:FMMU activated. FMMU checks
2283  * logically addressed blocks to be
2284  * mapped according to configured
2285  * mapping
2286  */
2287 #define ESC_FMMU_ACTIVATE_ACT_MASK (0x1U)
2288 #define ESC_FMMU_ACTIVATE_ACT_SHIFT (0U)
2289 #define ESC_FMMU_ACTIVATE_ACT_GET(x) (((uint8_t)(x) & ESC_FMMU_ACTIVATE_ACT_MASK) >> ESC_FMMU_ACTIVATE_ACT_SHIFT)
2290 
2291 /* Bitfield definition for register of struct array SYNCM: PHYSICAL_START_ADDR */
2292 /*
2293  * ADDR (RO)
2294  *
2295  * First byte that will be handled by
2296  * SyncManager
2297  */
2298 #define ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_MASK (0xFFFFU)
2299 #define ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_SHIFT (0U)
2300 #define ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_GET(x) (((uint16_t)(x) & ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_MASK) >> ESC_SYNCM_PHYSICAL_START_ADDR_ADDR_SHIFT)
2301 
2302 /* Bitfield definition for register of struct array SYNCM: LENGTH */
2303 /*
2304  * LEN (RO)
2305  *
2306  * Number of bytes assigned to SyncManager
2307  * (shall be greater than 1, otherwise
2308  * SyncManager is not activated. If set to 1, only
2309  * Watchdog Trigger is generated if configured)
2310  */
2311 #define ESC_SYNCM_LENGTH_LEN_MASK (0xFFFFU)
2312 #define ESC_SYNCM_LENGTH_LEN_SHIFT (0U)
2313 #define ESC_SYNCM_LENGTH_LEN_GET(x) (((uint16_t)(x) & ESC_SYNCM_LENGTH_LEN_MASK) >> ESC_SYNCM_LENGTH_LEN_SHIFT)
2314 
2315 /* Bitfield definition for register of struct array SYNCM: CONTROL */
2316 /*
2317  * WDG_TRG_EN (RO)
2318  *
2319  * Watchdog Trigger Enable:
2320  * 0:Disabled
2321  * 1:Enabled
2322  */
2323 #define ESC_SYNCM_CONTROL_WDG_TRG_EN_MASK (0x40U)
2324 #define ESC_SYNCM_CONTROL_WDG_TRG_EN_SHIFT (6U)
2325 #define ESC_SYNCM_CONTROL_WDG_TRG_EN_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_WDG_TRG_EN_MASK) >> ESC_SYNCM_CONTROL_WDG_TRG_EN_SHIFT)
2326 
2327 /*
2328  * INT_AL (RO)
2329  *
2330  * Interrupt in AL Event Request Register:
2331  * 0:Disabled
2332  * 1:Enabled
2333  */
2334 #define ESC_SYNCM_CONTROL_INT_AL_MASK (0x20U)
2335 #define ESC_SYNCM_CONTROL_INT_AL_SHIFT (5U)
2336 #define ESC_SYNCM_CONTROL_INT_AL_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_INT_AL_MASK) >> ESC_SYNCM_CONTROL_INT_AL_SHIFT)
2337 
2338 /*
2339  * INT_ECAT (RO)
2340  *
2341  * Interrupt in ECAT Event Request Register:
2342  * 0:Disabled
2343  * 1:Enabled
2344  */
2345 #define ESC_SYNCM_CONTROL_INT_ECAT_MASK (0x10U)
2346 #define ESC_SYNCM_CONTROL_INT_ECAT_SHIFT (4U)
2347 #define ESC_SYNCM_CONTROL_INT_ECAT_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_INT_ECAT_MASK) >> ESC_SYNCM_CONTROL_INT_ECAT_SHIFT)
2348 
2349 /*
2350  * DIR (RO)
2351  *
2352  * Direction:
2353  * 00:Read:ECAT read access, PDI write
2354  * access.
2355  * 01:Write:ECAT write access, PDI read
2356  * access.
2357  * 10:Reserved
2358  * 11:Reserved
2359  */
2360 #define ESC_SYNCM_CONTROL_DIR_MASK (0xCU)
2361 #define ESC_SYNCM_CONTROL_DIR_SHIFT (2U)
2362 #define ESC_SYNCM_CONTROL_DIR_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_DIR_MASK) >> ESC_SYNCM_CONTROL_DIR_SHIFT)
2363 
2364 /*
2365  * OP_MODE (RO)
2366  *
2367  * Operation Mode:
2368  * 00:Buffered (3 buffer mode)
2369  * 01:Reserved
2370  * 10:Mailbox (Single buffer mode)
2371  * 11:Reserved
2372  */
2373 #define ESC_SYNCM_CONTROL_OP_MODE_MASK (0x3U)
2374 #define ESC_SYNCM_CONTROL_OP_MODE_SHIFT (0U)
2375 #define ESC_SYNCM_CONTROL_OP_MODE_GET(x) (((uint8_t)(x) & ESC_SYNCM_CONTROL_OP_MODE_MASK) >> ESC_SYNCM_CONTROL_OP_MODE_SHIFT)
2376 
2377 /* Bitfield definition for register of struct array SYNCM: STATUS */
2378 /*
2379  * WB_INUSE (RO)
2380  *
2381  * Write buffer in use (opened)
2382  */
2383 #define ESC_SYNCM_STATUS_WB_INUSE_MASK (0x80U)
2384 #define ESC_SYNCM_STATUS_WB_INUSE_SHIFT (7U)
2385 #define ESC_SYNCM_STATUS_WB_INUSE_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_WB_INUSE_MASK) >> ESC_SYNCM_STATUS_WB_INUSE_SHIFT)
2386 
2387 /*
2388  * RB_INUSE (RO)
2389  *
2390  * Read buffer in use (opened)
2391  */
2392 #define ESC_SYNCM_STATUS_RB_INUSE_MASK (0x40U)
2393 #define ESC_SYNCM_STATUS_RB_INUSE_SHIFT (6U)
2394 #define ESC_SYNCM_STATUS_RB_INUSE_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_RB_INUSE_MASK) >> ESC_SYNCM_STATUS_RB_INUSE_SHIFT)
2395 
2396 /*
2397  * BUF_MODE (RO)
2398  *
2399  * Buffered mode:buffer status (last written
2400  * buffer):
2401  * 00:1
2402  * st buffer
2403  * 01:2
2404  * nd buffer
2405  * 10:3
2406  * rd buffer
2407  * 11:(no buffer written)
2408  * Mailbox mode:reserved
2409  */
2410 #define ESC_SYNCM_STATUS_BUF_MODE_MASK (0x30U)
2411 #define ESC_SYNCM_STATUS_BUF_MODE_SHIFT (4U)
2412 #define ESC_SYNCM_STATUS_BUF_MODE_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_BUF_MODE_MASK) >> ESC_SYNCM_STATUS_BUF_MODE_SHIFT)
2413 
2414 /*
2415  * MBX_MODE (RO)
2416  *
2417  * Mailbox mode:mailbox status:
2418  * 0:Mailbox empty
2419  * 1:Mailbox full
2420  * Buffered mode:reserved
2421  */
2422 #define ESC_SYNCM_STATUS_MBX_MODE_MASK (0x8U)
2423 #define ESC_SYNCM_STATUS_MBX_MODE_SHIFT (3U)
2424 #define ESC_SYNCM_STATUS_MBX_MODE_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_MBX_MODE_MASK) >> ESC_SYNCM_STATUS_MBX_MODE_SHIFT)
2425 
2426 /*
2427  * INT_RD (RO)
2428  *
2429  * Interrupt Read:
2430  * 1:Interrupt after buffer was completely and
2431  * successfully read
2432  * 0:Interrupt cleared after first byte of buffer
2433  * was written
2434  * NOTE:This interrupt is signalled to the writing
2435  * side if enabled in the SM Control register
2436  */
2437 #define ESC_SYNCM_STATUS_INT_RD_MASK (0x2U)
2438 #define ESC_SYNCM_STATUS_INT_RD_SHIFT (1U)
2439 #define ESC_SYNCM_STATUS_INT_RD_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_INT_RD_MASK) >> ESC_SYNCM_STATUS_INT_RD_SHIFT)
2440 
2441 /*
2442  * INT_WR (RO)
2443  *
2444  * Interrupt Write:
2445  * 1:Interrupt after buffer was completely and
2446  * successfully written
2447  * 0:Interrupt cleared after first byte of buffer
2448  * was read
2449  * NOTE:This interrupt is signalled to the reading
2450  * side if enabled in the SM Control register
2451  */
2452 #define ESC_SYNCM_STATUS_INT_WR_MASK (0x1U)
2453 #define ESC_SYNCM_STATUS_INT_WR_SHIFT (0U)
2454 #define ESC_SYNCM_STATUS_INT_WR_GET(x) (((uint8_t)(x) & ESC_SYNCM_STATUS_INT_WR_MASK) >> ESC_SYNCM_STATUS_INT_WR_SHIFT)
2455 
2456 /* Bitfield definition for register of struct array SYNCM: ACTIVATE */
2457 /*
2458  * LATCH_PDI (RO)
2459  *
2460  * Latch Event PDI:
2461  * 0:No
2462  * 1:Generate Latch events when PDI issues
2463  * a buffer exchange or when PDI
2464  * accesses buffer start address
2465  */
2466 #define ESC_SYNCM_ACTIVATE_LATCH_PDI_MASK (0x80U)
2467 #define ESC_SYNCM_ACTIVATE_LATCH_PDI_SHIFT (7U)
2468 #define ESC_SYNCM_ACTIVATE_LATCH_PDI_GET(x) (((uint8_t)(x) & ESC_SYNCM_ACTIVATE_LATCH_PDI_MASK) >> ESC_SYNCM_ACTIVATE_LATCH_PDI_SHIFT)
2469 
2470 /*
2471  * LATCH_ECAT (RO)
2472  *
2473  * Latch Event ECAT:
2474  * 0:No
2475  * 1:Generate Latch event when EtherCAT
2476  * master issues a buffer exchange
2477  */
2478 #define ESC_SYNCM_ACTIVATE_LATCH_ECAT_MASK (0x40U)
2479 #define ESC_SYNCM_ACTIVATE_LATCH_ECAT_SHIFT (6U)
2480 #define ESC_SYNCM_ACTIVATE_LATCH_ECAT_GET(x) (((uint8_t)(x) & ESC_SYNCM_ACTIVATE_LATCH_ECAT_MASK) >> ESC_SYNCM_ACTIVATE_LATCH_ECAT_SHIFT)
2481 
2482 /*
2483  * REPEAT (RO)
2484  *
2485  * Repeat Request:
2486  * A toggle of Repeat Request means that a
2487  * mailbox retry is needed (primarily used in
2488  * conjunction with ECAT Read Mailbox)
2489  */
2490 #define ESC_SYNCM_ACTIVATE_REPEAT_MASK (0x2U)
2491 #define ESC_SYNCM_ACTIVATE_REPEAT_SHIFT (1U)
2492 #define ESC_SYNCM_ACTIVATE_REPEAT_GET(x) (((uint8_t)(x) & ESC_SYNCM_ACTIVATE_REPEAT_MASK) >> ESC_SYNCM_ACTIVATE_REPEAT_SHIFT)
2493 
2494 /*
2495  * EN (RW)
2496  *
2497  * SyncManager Enable/Disable:
2498  * 0:Disable:Access to Memory without
2499  * SyncManager control
2500  * 1:Enable:SyncManager is active and
2501  * controls Memory area set in
2502  * configuration
2503  */
2504 #define ESC_SYNCM_ACTIVATE_EN_MASK (0x1U)
2505 #define ESC_SYNCM_ACTIVATE_EN_SHIFT (0U)
2506 #define ESC_SYNCM_ACTIVATE_EN_SET(x) (((uint8_t)(x) << ESC_SYNCM_ACTIVATE_EN_SHIFT) & ESC_SYNCM_ACTIVATE_EN_MASK)
2507 #define ESC_SYNCM_ACTIVATE_EN_GET(x) (((uint8_t)(x) & ESC_SYNCM_ACTIVATE_EN_MASK) >> ESC_SYNCM_ACTIVATE_EN_SHIFT)
2508 
2509 /* Bitfield definition for register of struct array SYNCM: PDI_CTRL */
2510 /*
2511  * REPEAT_ACK (RW)
2512  *
2513  * Repeat Ack:
2514  * If this is set to the same value as that set by
2515  * Repeat Request, the PDI acknowledges the
2516  * execution of a previous set Repeat request.
2517  */
2518 #define ESC_SYNCM_PDI_CTRL_REPEAT_ACK_MASK (0x2U)
2519 #define ESC_SYNCM_PDI_CTRL_REPEAT_ACK_SHIFT (1U)
2520 #define ESC_SYNCM_PDI_CTRL_REPEAT_ACK_SET(x) (((uint8_t)(x) << ESC_SYNCM_PDI_CTRL_REPEAT_ACK_SHIFT) & ESC_SYNCM_PDI_CTRL_REPEAT_ACK_MASK)
2521 #define ESC_SYNCM_PDI_CTRL_REPEAT_ACK_GET(x) (((uint8_t)(x) & ESC_SYNCM_PDI_CTRL_REPEAT_ACK_MASK) >> ESC_SYNCM_PDI_CTRL_REPEAT_ACK_SHIFT)
2522 
2523 /*
2524  * DEACT (RW)
2525  *
2526  * Deactivate SyncManager:
2527  * Read:
2528  * 0:Normal operation, SyncManager
2529  * activated.
2530  * 1:SyncManager deactivated and reset.
2531  * SyncManager locks access to Memory
2532  * area.
2533  * Write:
2534  * 0:Activate SyncManager
2535  * 1:Request SyncManager deactivation
2536  * NOTE:Writing 1 is delayed until the end of the
2537  * frame, which is currently processed.
2538  */
2539 #define ESC_SYNCM_PDI_CTRL_DEACT_MASK (0x1U)
2540 #define ESC_SYNCM_PDI_CTRL_DEACT_SHIFT (0U)
2541 #define ESC_SYNCM_PDI_CTRL_DEACT_SET(x) (((uint8_t)(x) << ESC_SYNCM_PDI_CTRL_DEACT_SHIFT) & ESC_SYNCM_PDI_CTRL_DEACT_MASK)
2542 #define ESC_SYNCM_PDI_CTRL_DEACT_GET(x) (((uint8_t)(x) & ESC_SYNCM_PDI_CTRL_DEACT_MASK) >> ESC_SYNCM_PDI_CTRL_DEACT_SHIFT)
2543 
2544 /* Bitfield definition for register array: RCV_TIME */
2545 /*
2546  * LT (RO)
2547  *
2548  * Local time at the beginning of the last receive
2549  * frame containing a write access to register
2550  * 0x0900.
2551  */
2552 #define ESC_RCV_TIME_LT_MASK (0xFFFFFF00UL)
2553 #define ESC_RCV_TIME_LT_SHIFT (8U)
2554 #define ESC_RCV_TIME_LT_GET(x) (((uint32_t)(x) & ESC_RCV_TIME_LT_MASK) >> ESC_RCV_TIME_LT_SHIFT)
2555 
2556 /*
2557  * REQ (RO)
2558  *
2559  * Write:
2560  * A write access to register 0x0900 with
2561  * BWR or FPWR latches the local time at
2562  * the beginning of the receive frame (start
2563  * first bit of preamble) at each port.
2564  * Write (ESC20, ET1200 exception):
2565  * A write access latches the local time at
2566  * the beginning of the receive frame at
2567  * port 0. It enables the time stamping at
2568  * the other ports.
2569  * Read:
2570  * Local time at the beginning of the last
2571  * receive frame containing a write access
2572  * to this register.
2573  * NOTE:FPWR requires an address match for
2574  * accessing this register like any FPWR command.
2575  * All write commands with address match will
2576  * increment the working counter (e.g., APWR), but
2577  * they will not trigger receive time latching.
2578  */
2579 #define ESC_RCV_TIME_REQ_MASK (0xFFU)
2580 #define ESC_RCV_TIME_REQ_SHIFT (0U)
2581 #define ESC_RCV_TIME_REQ_GET(x) (((uint32_t)(x) & ESC_RCV_TIME_REQ_MASK) >> ESC_RCV_TIME_REQ_SHIFT)
2582 
2583 /* Bitfield definition for register: SYS_TIME */
2584 /*
2585  * ST (RW)
2586  *
2587  */
2588 #define ESC_SYS_TIME_ST_MASK (0xFFFFFFFFFFFFFFFFULL)
2589 #define ESC_SYS_TIME_ST_SHIFT (0U)
2590 #define ESC_SYS_TIME_ST_SET(x) (((uint64_t)(x) << ESC_SYS_TIME_ST_SHIFT) & ESC_SYS_TIME_ST_MASK)
2591 #define ESC_SYS_TIME_ST_GET(x) (((uint64_t)(x) & ESC_SYS_TIME_ST_MASK) >> ESC_SYS_TIME_ST_SHIFT)
2592 
2593 /* Bitfield definition for register: RCVT_ECAT_PU */
2594 /*
2595  * LT (RO)
2596  *
2597  * Local time at the beginning of a frame (start
2598  * first bit of preamble) received at the ECAT
2599  * Processing Unit containing a write access to
2600  * register 0x0900
2601  * NOTE:E.g., if port 0 is open, this register reflects
2602  * the Receive Time Port 0 as a 64 Bit value.
2603  * Any valid EtherCAT write access to register
2604  * 0x0900 triggers latching, not only BWR/FPWR
2605  * commands as with register 0x0900.
2606  */
2607 #define ESC_RCVT_ECAT_PU_LT_MASK (0xFFFFFFFFFFFFFFFFULL)
2608 #define ESC_RCVT_ECAT_PU_LT_SHIFT (0U)
2609 #define ESC_RCVT_ECAT_PU_LT_GET(x) (((uint64_t)(x) & ESC_RCVT_ECAT_PU_LT_MASK) >> ESC_RCVT_ECAT_PU_LT_SHIFT)
2610 
2611 /* Bitfield definition for register: SYS_TIME_OFFSET */
2612 /*
2613  * OFFSET (RW)
2614  *
2615  * Difference between local time and System
2616  * Time. Offset is added to the local time.
2617  */
2618 #define ESC_SYS_TIME_OFFSET_OFFSET_MASK (0xFFFFFFFFFFFFFFFFULL)
2619 #define ESC_SYS_TIME_OFFSET_OFFSET_SHIFT (0U)
2620 #define ESC_SYS_TIME_OFFSET_OFFSET_SET(x) (((uint64_t)(x) << ESC_SYS_TIME_OFFSET_OFFSET_SHIFT) & ESC_SYS_TIME_OFFSET_OFFSET_MASK)
2621 #define ESC_SYS_TIME_OFFSET_OFFSET_GET(x) (((uint64_t)(x) & ESC_SYS_TIME_OFFSET_OFFSET_MASK) >> ESC_SYS_TIME_OFFSET_OFFSET_SHIFT)
2622 
2623 /* Bitfield definition for register: SYS_TIME_DELAY */
2624 /*
2625  * DLY (RW)
2626  *
2627  * Delay between Reference Clock and the
2628  * ESC
2629  */
2630 #define ESC_SYS_TIME_DELAY_DLY_MASK (0xFFFFFFFFUL)
2631 #define ESC_SYS_TIME_DELAY_DLY_SHIFT (0U)
2632 #define ESC_SYS_TIME_DELAY_DLY_SET(x) (((uint32_t)(x) << ESC_SYS_TIME_DELAY_DLY_SHIFT) & ESC_SYS_TIME_DELAY_DLY_MASK)
2633 #define ESC_SYS_TIME_DELAY_DLY_GET(x) (((uint32_t)(x) & ESC_SYS_TIME_DELAY_DLY_MASK) >> ESC_SYS_TIME_DELAY_DLY_SHIFT)
2634 
2635 /* Bitfield definition for register: SYS_TIME_DIFF */
2636 /*
2637  * DIFF (RO)
2638  *
2639  * 0:Local copy of System Time less than
2640  * received System Time
2641  * 1:Local copy of System Time greater than
2642  * or equal to received System Time
2643  */
2644 #define ESC_SYS_TIME_DIFF_DIFF_MASK (0x80000000UL)
2645 #define ESC_SYS_TIME_DIFF_DIFF_SHIFT (31U)
2646 #define ESC_SYS_TIME_DIFF_DIFF_GET(x) (((uint32_t)(x) & ESC_SYS_TIME_DIFF_DIFF_MASK) >> ESC_SYS_TIME_DIFF_DIFF_SHIFT)
2647 
2648 /*
2649  * NUM (RO)
2650  *
2651  * Mean difference between local copy of
2652  * System Time and received System Time
2653  * values
2654  * Difference = Received System Time –
2655  * local copy of System Time
2656  */
2657 #define ESC_SYS_TIME_DIFF_NUM_MASK (0x7FFFFFFFUL)
2658 #define ESC_SYS_TIME_DIFF_NUM_SHIFT (0U)
2659 #define ESC_SYS_TIME_DIFF_NUM_GET(x) (((uint32_t)(x) & ESC_SYS_TIME_DIFF_NUM_MASK) >> ESC_SYS_TIME_DIFF_NUM_SHIFT)
2660 
2661 /* Bitfield definition for register: SPD_CNT_START */
2662 /*
2663  * BW (RW)
2664  *
2665  * Bandwidth for adjustment of local copy of
2666  * System Time (larger values → smaller
2667  * bandwidth and smoother adjustment)
2668  * A write access resets System Time
2669  * Difference (0x092C:0x092F) and Speed
2670  * Counter Diff (0x0932:0x0933).
2671  * Valid values:0x0080 to 0x3FFF
2672  */
2673 #define ESC_SPD_CNT_START_BW_MASK (0x7FFFU)
2674 #define ESC_SPD_CNT_START_BW_SHIFT (0U)
2675 #define ESC_SPD_CNT_START_BW_SET(x) (((uint16_t)(x) << ESC_SPD_CNT_START_BW_SHIFT) & ESC_SPD_CNT_START_BW_MASK)
2676 #define ESC_SPD_CNT_START_BW_GET(x) (((uint16_t)(x) & ESC_SPD_CNT_START_BW_MASK) >> ESC_SPD_CNT_START_BW_SHIFT)
2677 
2678 /* Bitfield definition for register: SPD_CNT_DIFF */
2679 /*
2680  * DIFF (RO)
2681  *
2682  * Representation of the deviation between
2683  * local clock period and Reference Clock's
2684  * clock period (representation:two's
2685  * complement)
2686  * Range:±(Speed Counter Start – 0x7F)
2687  */
2688 #define ESC_SPD_CNT_DIFF_DIFF_MASK (0xFFFFU)
2689 #define ESC_SPD_CNT_DIFF_DIFF_SHIFT (0U)
2690 #define ESC_SPD_CNT_DIFF_DIFF_GET(x) (((uint16_t)(x) & ESC_SPD_CNT_DIFF_DIFF_MASK) >> ESC_SPD_CNT_DIFF_DIFF_SHIFT)
2691 
2692 /* Bitfield definition for register: SYS_TIME_DIFF_FD */
2693 /*
2694  * DEPTH (RW)
2695  *
2696  * Filter depth for averaging the received
2697  * System Time deviation
2698  * IP Core since V2.2.0/V2.02a:
2699  * A write access resets System Time
2700  * Difference (0x092C:0x092F)
2701  */
2702 #define ESC_SYS_TIME_DIFF_FD_DEPTH_MASK (0xFU)
2703 #define ESC_SYS_TIME_DIFF_FD_DEPTH_SHIFT (0U)
2704 #define ESC_SYS_TIME_DIFF_FD_DEPTH_SET(x) (((uint8_t)(x) << ESC_SYS_TIME_DIFF_FD_DEPTH_SHIFT) & ESC_SYS_TIME_DIFF_FD_DEPTH_MASK)
2705 #define ESC_SYS_TIME_DIFF_FD_DEPTH_GET(x) (((uint8_t)(x) & ESC_SYS_TIME_DIFF_FD_DEPTH_MASK) >> ESC_SYS_TIME_DIFF_FD_DEPTH_SHIFT)
2706 
2707 /* Bitfield definition for register: SPD_CNT_FD */
2708 /*
2709  * DEPTH (RW)
2710  *
2711  * Filter depth for averaging the clock period
2712  * deviation
2713  * IP Core since V2.2.0/V2.02a:
2714  * A write access resets the internal speed
2715  * counter filter
2716  */
2717 #define ESC_SPD_CNT_FD_DEPTH_MASK (0xFU)
2718 #define ESC_SPD_CNT_FD_DEPTH_SHIFT (0U)
2719 #define ESC_SPD_CNT_FD_DEPTH_SET(x) (((uint8_t)(x) << ESC_SPD_CNT_FD_DEPTH_SHIFT) & ESC_SPD_CNT_FD_DEPTH_MASK)
2720 #define ESC_SPD_CNT_FD_DEPTH_GET(x) (((uint8_t)(x) & ESC_SPD_CNT_FD_DEPTH_MASK) >> ESC_SPD_CNT_FD_DEPTH_SHIFT)
2721 
2722 /* Bitfield definition for register: RCV_TIME_LM */
2723 /*
2724  * LATCH_MODE (RO)
2725  *
2726  * Receive Time Latch Mode:
2727  * 0:Forwarding mode (used if frames are
2728  * entering the ESC at port 0 first):
2729  * Receive time stamps of ports 1-3 are
2730  * enabled after the write access to
2731  * 0x0900, so the following frame at ports
2732  * 1-3 will be time stamped (this is typically
2733  * the write frame to 0x0900 coming back
2734  * from the network behind the ESC).
2735  * 1:Reverse mode (used if frames are
2736  * entering ESC at port 1-3 first):
2737  * Receive time stamps of ports 1-3 are
2738  * immediately taken over from the internal
2739  * hidden time stamp registers, so the
2740  * previous frame entering the ESC at
2741  * ports 1-3 will be time stamped when the
2742  * write frame to 0x0900 enters port 0 (the
2743  * previous frame at ports 1-3 is typically
2744  * the write frame to 0x0900 coming from
2745  * the master, which will enable time
2746  * stamp
2747  */
2748 #define ESC_RCV_TIME_LM_LATCH_MODE_MASK (0x1U)
2749 #define ESC_RCV_TIME_LM_LATCH_MODE_SHIFT (0U)
2750 #define ESC_RCV_TIME_LM_LATCH_MODE_GET(x) (((uint8_t)(x) & ESC_RCV_TIME_LM_LATCH_MODE_MASK) >> ESC_RCV_TIME_LM_LATCH_MODE_SHIFT)
2751 
2752 /* Bitfield definition for register: CYC_UNIT_CTRL */
2753 /*
2754  * LATCHI1 (RO)
2755  *
2756  * Latch In unit 1:
2757  * 0:ECAT-controlled
2758  * 1:PDI-controlled
2759  * NOTE:Latch interrupt is routed to ECAT/PDI
2760  * depending on this setting
2761  */
2762 #define ESC_CYC_UNIT_CTRL_LATCHI1_MASK (0x20U)
2763 #define ESC_CYC_UNIT_CTRL_LATCHI1_SHIFT (5U)
2764 #define ESC_CYC_UNIT_CTRL_LATCHI1_GET(x) (((uint8_t)(x) & ESC_CYC_UNIT_CTRL_LATCHI1_MASK) >> ESC_CYC_UNIT_CTRL_LATCHI1_SHIFT)
2765 
2766 /*
2767  * LATCHI0 (RO)
2768  *
2769  * Latch In unit 0:
2770  * 0:ECAT-controlled
2771  * 1:PDI-controlled
2772  * NOTE:Latch interrupt is routed to ECAT/PDI
2773  * depending on this setting.
2774  * Always 1 (PDI-controlled) if System Time is PDIcontrolled.
2775  */
2776 #define ESC_CYC_UNIT_CTRL_LATCHI0_MASK (0x10U)
2777 #define ESC_CYC_UNIT_CTRL_LATCHI0_SHIFT (4U)
2778 #define ESC_CYC_UNIT_CTRL_LATCHI0_GET(x) (((uint8_t)(x) & ESC_CYC_UNIT_CTRL_LATCHI0_MASK) >> ESC_CYC_UNIT_CTRL_LATCHI0_SHIFT)
2779 
2780 /*
2781  * SYNCO (RO)
2782  *
2783  * Cyclic Unit and SYNC0 out unit control:
2784  * 0:ECAT-controlled
2785  * 1:PDI-controlled
2786  */
2787 #define ESC_CYC_UNIT_CTRL_SYNCO_MASK (0x1U)
2788 #define ESC_CYC_UNIT_CTRL_SYNCO_SHIFT (0U)
2789 #define ESC_CYC_UNIT_CTRL_SYNCO_GET(x) (((uint8_t)(x) & ESC_CYC_UNIT_CTRL_SYNCO_MASK) >> ESC_CYC_UNIT_CTRL_SYNCO_SHIFT)
2790 
2791 /* Bitfield definition for register: SYNCO_ACT */
2792 /*
2793  * SSDP (RW)
2794  *
2795  * SyncSignal debug pulse (Vasily bit):
2796  * 0:Deactivated
2797  * 1:Immediately generate one ping only on
2798  * SYNC0-1 according to 0x0981[2:1 for
2799  * debugging
2800  * This bit is self-clearing, always read 0.
2801  * All pulses are generated at the same time,
2802  * the cycle time is ignored. The configured
2803  * pulse length is used.
2804  */
2805 #define ESC_SYNCO_ACT_SSDP_MASK (0x80U)
2806 #define ESC_SYNCO_ACT_SSDP_SHIFT (7U)
2807 #define ESC_SYNCO_ACT_SSDP_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_SSDP_SHIFT) & ESC_SYNCO_ACT_SSDP_MASK)
2808 #define ESC_SYNCO_ACT_SSDP_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_SSDP_MASK) >> ESC_SYNCO_ACT_SSDP_SHIFT)
2809 
2810 /*
2811  * NFC (RW)
2812  *
2813  * Near future configuration (approx.):
2814  * 0:½ DC width future (231 ns or 263 ns)
2815  * 1:~2.1 sec. future (231 ns)
2816  */
2817 #define ESC_SYNCO_ACT_NFC_MASK (0x40U)
2818 #define ESC_SYNCO_ACT_NFC_SHIFT (6U)
2819 #define ESC_SYNCO_ACT_NFC_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_NFC_SHIFT) & ESC_SYNCO_ACT_NFC_MASK)
2820 #define ESC_SYNCO_ACT_NFC_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_NFC_MASK) >> ESC_SYNCO_ACT_NFC_SHIFT)
2821 
2822 /*
2823  * STPC (RW)
2824  *
2825  * Start Time plausibility check:
2826  * 0:Disabled. SyncSignal generation if Start
2827  * Time is reached.
2828  * 1:Immediate SyncSignal generation if
2829  * Start Time is outside near future (see
2830  * 0x0981[6])
2831  */
2832 #define ESC_SYNCO_ACT_STPC_MASK (0x20U)
2833 #define ESC_SYNCO_ACT_STPC_SHIFT (5U)
2834 #define ESC_SYNCO_ACT_STPC_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_STPC_SHIFT) & ESC_SYNCO_ACT_STPC_MASK)
2835 #define ESC_SYNCO_ACT_STPC_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_STPC_MASK) >> ESC_SYNCO_ACT_STPC_SHIFT)
2836 
2837 /*
2838  * EXT (RW)
2839  *
2840  * Extension of Start Time Cyclic Operation
2841  * (0x0990:0x0993):
2842  * 0:No extension
2843  * 1:Extend 32 bit written Start Time to 64 bit
2844  */
2845 #define ESC_SYNCO_ACT_EXT_MASK (0x10U)
2846 #define ESC_SYNCO_ACT_EXT_SHIFT (4U)
2847 #define ESC_SYNCO_ACT_EXT_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_EXT_SHIFT) & ESC_SYNCO_ACT_EXT_MASK)
2848 #define ESC_SYNCO_ACT_EXT_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_EXT_MASK) >> ESC_SYNCO_ACT_EXT_SHIFT)
2849 
2850 /*
2851  * AC (RW)
2852  *
2853  * Auto-activation by writing Start Time Cyclic
2854  * Operation (0x0990:0x0997):
2855  * 0:Disabled
2856  * 1:Auto-activation enabled. 0x0981[0] is
2857  * set automatically after Start Time is
2858  * written.
2859  */
2860 #define ESC_SYNCO_ACT_AC_MASK (0x8U)
2861 #define ESC_SYNCO_ACT_AC_SHIFT (3U)
2862 #define ESC_SYNCO_ACT_AC_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_AC_SHIFT) & ESC_SYNCO_ACT_AC_MASK)
2863 #define ESC_SYNCO_ACT_AC_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_AC_MASK) >> ESC_SYNCO_ACT_AC_SHIFT)
2864 
2865 /*
2866  * SYNC1_GEN (RW)
2867  *
2868  * SYNC1 generation:
2869  * 0:Deactivated
2870  * 1:SYNC1 pulse is generated
2871  */
2872 #define ESC_SYNCO_ACT_SYNC1_GEN_MASK (0x4U)
2873 #define ESC_SYNCO_ACT_SYNC1_GEN_SHIFT (2U)
2874 #define ESC_SYNCO_ACT_SYNC1_GEN_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_SYNC1_GEN_SHIFT) & ESC_SYNCO_ACT_SYNC1_GEN_MASK)
2875 #define ESC_SYNCO_ACT_SYNC1_GEN_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_SYNC1_GEN_MASK) >> ESC_SYNCO_ACT_SYNC1_GEN_SHIFT)
2876 
2877 /*
2878  * SYNC0_GEN (RW)
2879  *
2880  * SYNC0 generation:
2881  * 0:Deactivated
2882  * 1:SYNC0 pulse is generated
2883  */
2884 #define ESC_SYNCO_ACT_SYNC0_GEN_MASK (0x2U)
2885 #define ESC_SYNCO_ACT_SYNC0_GEN_SHIFT (1U)
2886 #define ESC_SYNCO_ACT_SYNC0_GEN_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_SYNC0_GEN_SHIFT) & ESC_SYNCO_ACT_SYNC0_GEN_MASK)
2887 #define ESC_SYNCO_ACT_SYNC0_GEN_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_SYNC0_GEN_MASK) >> ESC_SYNCO_ACT_SYNC0_GEN_SHIFT)
2888 
2889 /*
2890  * SOUA (RW)
2891  *
2892  * Sync Out Unit activation:
2893  * 0:Deactivated
2894  * 1:Activated
2895  */
2896 #define ESC_SYNCO_ACT_SOUA_MASK (0x1U)
2897 #define ESC_SYNCO_ACT_SOUA_SHIFT (0U)
2898 #define ESC_SYNCO_ACT_SOUA_SET(x) (((uint8_t)(x) << ESC_SYNCO_ACT_SOUA_SHIFT) & ESC_SYNCO_ACT_SOUA_MASK)
2899 #define ESC_SYNCO_ACT_SOUA_GET(x) (((uint8_t)(x) & ESC_SYNCO_ACT_SOUA_MASK) >> ESC_SYNCO_ACT_SOUA_SHIFT)
2900 
2901 /* Bitfield definition for register: PULSE_LEN */
2902 /*
2903  * LEN (RO)
2904  *
2905  * Pulse length of SyncSignals (in Units of
2906  * 10ns)
2907  * 0:Acknowledge mode:SyncSignal will be
2908  * cleared by reading SYNC[1:0] Status
2909  * register
2910  */
2911 #define ESC_PULSE_LEN_LEN_MASK (0xFFFFU)
2912 #define ESC_PULSE_LEN_LEN_SHIFT (0U)
2913 #define ESC_PULSE_LEN_LEN_GET(x) (((uint16_t)(x) & ESC_PULSE_LEN_LEN_MASK) >> ESC_PULSE_LEN_LEN_SHIFT)
2914 
2915 /* Bitfield definition for register: ACT_STAT */
2916 /*
2917  * CHK_RSLT (RO)
2918  *
2919  * Start Time Cyclic Operation (0x0990:0x0997)
2920  * plausibility check result when Sync Out Unit
2921  * was activated:
2922  * 0:Start Time was within near future
2923  * 1:Start Time was out of near future
2924  * (0x0981[6])
2925  */
2926 #define ESC_ACT_STAT_CHK_RSLT_MASK (0x4U)
2927 #define ESC_ACT_STAT_CHK_RSLT_SHIFT (2U)
2928 #define ESC_ACT_STAT_CHK_RSLT_GET(x) (((uint8_t)(x) & ESC_ACT_STAT_CHK_RSLT_MASK) >> ESC_ACT_STAT_CHK_RSLT_SHIFT)
2929 
2930 /*
2931  * SYNC1 (RO)
2932  *
2933  * SYNC1 activation state:
2934  * 0:First SYNC1 pulse is not pending
2935  * 1:First SYNC1 pulse is pending
2936  */
2937 #define ESC_ACT_STAT_SYNC1_MASK (0x2U)
2938 #define ESC_ACT_STAT_SYNC1_SHIFT (1U)
2939 #define ESC_ACT_STAT_SYNC1_GET(x) (((uint8_t)(x) & ESC_ACT_STAT_SYNC1_MASK) >> ESC_ACT_STAT_SYNC1_SHIFT)
2940 
2941 /*
2942  * SYNC0 (RO)
2943  *
2944  * SYNC0 activation state:
2945  * 0:First SYNC0 pulse is not pending
2946  * 1:First SYNC0 pulse is pending
2947  */
2948 #define ESC_ACT_STAT_SYNC0_MASK (0x1U)
2949 #define ESC_ACT_STAT_SYNC0_SHIFT (0U)
2950 #define ESC_ACT_STAT_SYNC0_GET(x) (((uint8_t)(x) & ESC_ACT_STAT_SYNC0_MASK) >> ESC_ACT_STAT_SYNC0_SHIFT)
2951 
2952 /* Bitfield definition for register: SYNC0_STAT */
2953 /*
2954  * ACK (RW)
2955  *
2956  * SYNC0 state for Acknowledge mode.
2957  * SYNC0 in Acknowledge mode is cleared by
2958  * reading this register from PDI, use only in
2959  * Acknowledge mode
2960  */
2961 #define ESC_SYNC0_STAT_ACK_MASK (0x1U)
2962 #define ESC_SYNC0_STAT_ACK_SHIFT (0U)
2963 #define ESC_SYNC0_STAT_ACK_SET(x) (((uint8_t)(x) << ESC_SYNC0_STAT_ACK_SHIFT) & ESC_SYNC0_STAT_ACK_MASK)
2964 #define ESC_SYNC0_STAT_ACK_GET(x) (((uint8_t)(x) & ESC_SYNC0_STAT_ACK_MASK) >> ESC_SYNC0_STAT_ACK_SHIFT)
2965 
2966 /* Bitfield definition for register: SYNC1_STAT */
2967 /*
2968  * ACK (RW)
2969  *
2970  * SYNC1 state for Acknowledge mode.
2971  * SYNC1 in Acknowledge mode is cleared by
2972  * reading this register from PDI, use only in
2973  * Acknowledge mode
2974  */
2975 #define ESC_SYNC1_STAT_ACK_MASK (0x1U)
2976 #define ESC_SYNC1_STAT_ACK_SHIFT (0U)
2977 #define ESC_SYNC1_STAT_ACK_SET(x) (((uint8_t)(x) << ESC_SYNC1_STAT_ACK_SHIFT) & ESC_SYNC1_STAT_ACK_MASK)
2978 #define ESC_SYNC1_STAT_ACK_GET(x) (((uint8_t)(x) & ESC_SYNC1_STAT_ACK_MASK) >> ESC_SYNC1_STAT_ACK_SHIFT)
2979 
2980 /* Bitfield definition for register: START_TIME_CO */
2981 /*
2982  * ST (RW)
2983  *
2984  * Write:Start time (System time) of cyclic
2985  * operation in ns
2986  * Read:System time of next SYNC0 pulse in
2987  * ns
2988  */
2989 #define ESC_START_TIME_CO_ST_MASK (0xFFFFFFFFFFFFFFFFULL)
2990 #define ESC_START_TIME_CO_ST_SHIFT (0U)
2991 #define ESC_START_TIME_CO_ST_SET(x) (((uint64_t)(x) << ESC_START_TIME_CO_ST_SHIFT) & ESC_START_TIME_CO_ST_MASK)
2992 #define ESC_START_TIME_CO_ST_GET(x) (((uint64_t)(x) & ESC_START_TIME_CO_ST_MASK) >> ESC_START_TIME_CO_ST_SHIFT)
2993 
2994 /* Bitfield definition for register: NXT_SYNC1_PULSE */
2995 /*
2996  * TIME (RO)
2997  *
2998  * System time of next SYNC1 pulse in ns
2999  */
3000 #define ESC_NXT_SYNC1_PULSE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
3001 #define ESC_NXT_SYNC1_PULSE_TIME_SHIFT (0U)
3002 #define ESC_NXT_SYNC1_PULSE_TIME_GET(x) (((uint64_t)(x) & ESC_NXT_SYNC1_PULSE_TIME_MASK) >> ESC_NXT_SYNC1_PULSE_TIME_SHIFT)
3003 
3004 /* Bitfield definition for register: SYNC0_CYC_TIME */
3005 /*
3006  * CYC (RW)
3007  *
3008  * Time between two consecutive SYNC0
3009  * pulses in ns.
3010  * 0:Single shot mode, generate only one
3011  * SYNC0 pulse.
3012  */
3013 #define ESC_SYNC0_CYC_TIME_CYC_MASK (0xFFFFFFFFUL)
3014 #define ESC_SYNC0_CYC_TIME_CYC_SHIFT (0U)
3015 #define ESC_SYNC0_CYC_TIME_CYC_SET(x) (((uint32_t)(x) << ESC_SYNC0_CYC_TIME_CYC_SHIFT) & ESC_SYNC0_CYC_TIME_CYC_MASK)
3016 #define ESC_SYNC0_CYC_TIME_CYC_GET(x) (((uint32_t)(x) & ESC_SYNC0_CYC_TIME_CYC_MASK) >> ESC_SYNC0_CYC_TIME_CYC_SHIFT)
3017 
3018 /* Bitfield definition for register: SYNC1_CYC_TIME */
3019 /*
3020  * CYC (RW)
3021  *
3022  * Time between SYNC0 pulse and SYNC1
3023  * pulse in ns
3024  */
3025 #define ESC_SYNC1_CYC_TIME_CYC_MASK (0xFFFFFFFFUL)
3026 #define ESC_SYNC1_CYC_TIME_CYC_SHIFT (0U)
3027 #define ESC_SYNC1_CYC_TIME_CYC_SET(x) (((uint32_t)(x) << ESC_SYNC1_CYC_TIME_CYC_SHIFT) & ESC_SYNC1_CYC_TIME_CYC_MASK)
3028 #define ESC_SYNC1_CYC_TIME_CYC_GET(x) (((uint32_t)(x) & ESC_SYNC1_CYC_TIME_CYC_MASK) >> ESC_SYNC1_CYC_TIME_CYC_SHIFT)
3029 
3030 /* Bitfield definition for register: LATCH0_CTRL */
3031 /*
3032  * NEG_EDGE (RW)
3033  *
3034  * Latch0 negative edge:
3035  * 0:Continuous Latch active
3036  * 1:Single event (only first event active)
3037  */
3038 #define ESC_LATCH0_CTRL_NEG_EDGE_MASK (0x2U)
3039 #define ESC_LATCH0_CTRL_NEG_EDGE_SHIFT (1U)
3040 #define ESC_LATCH0_CTRL_NEG_EDGE_SET(x) (((uint8_t)(x) << ESC_LATCH0_CTRL_NEG_EDGE_SHIFT) & ESC_LATCH0_CTRL_NEG_EDGE_MASK)
3041 #define ESC_LATCH0_CTRL_NEG_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH0_CTRL_NEG_EDGE_MASK) >> ESC_LATCH0_CTRL_NEG_EDGE_SHIFT)
3042 
3043 /*
3044  * POS_EDGE (RW)
3045  *
3046  * Latch0 positive edge:
3047  * 0:Continuous Latch active
3048  * 1:Single event (only first event active)
3049  */
3050 #define ESC_LATCH0_CTRL_POS_EDGE_MASK (0x1U)
3051 #define ESC_LATCH0_CTRL_POS_EDGE_SHIFT (0U)
3052 #define ESC_LATCH0_CTRL_POS_EDGE_SET(x) (((uint8_t)(x) << ESC_LATCH0_CTRL_POS_EDGE_SHIFT) & ESC_LATCH0_CTRL_POS_EDGE_MASK)
3053 #define ESC_LATCH0_CTRL_POS_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH0_CTRL_POS_EDGE_MASK) >> ESC_LATCH0_CTRL_POS_EDGE_SHIFT)
3054 
3055 /* Bitfield definition for register: LATCH1_CTRL */
3056 /*
3057  * NEG_EDGE (RW)
3058  *
3059  * Latch1 negative edge:
3060  * 0:Continuous Latch active
3061  * 1:Single event (only first event active)
3062  */
3063 #define ESC_LATCH1_CTRL_NEG_EDGE_MASK (0x2U)
3064 #define ESC_LATCH1_CTRL_NEG_EDGE_SHIFT (1U)
3065 #define ESC_LATCH1_CTRL_NEG_EDGE_SET(x) (((uint8_t)(x) << ESC_LATCH1_CTRL_NEG_EDGE_SHIFT) & ESC_LATCH1_CTRL_NEG_EDGE_MASK)
3066 #define ESC_LATCH1_CTRL_NEG_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH1_CTRL_NEG_EDGE_MASK) >> ESC_LATCH1_CTRL_NEG_EDGE_SHIFT)
3067 
3068 /*
3069  * POS_EDGE (RW)
3070  *
3071  * Latch1 positive edge:
3072  * 0:Continuous Latch active
3073  * 1:Single event (only first event active)
3074  */
3075 #define ESC_LATCH1_CTRL_POS_EDGE_MASK (0x1U)
3076 #define ESC_LATCH1_CTRL_POS_EDGE_SHIFT (0U)
3077 #define ESC_LATCH1_CTRL_POS_EDGE_SET(x) (((uint8_t)(x) << ESC_LATCH1_CTRL_POS_EDGE_SHIFT) & ESC_LATCH1_CTRL_POS_EDGE_MASK)
3078 #define ESC_LATCH1_CTRL_POS_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH1_CTRL_POS_EDGE_MASK) >> ESC_LATCH1_CTRL_POS_EDGE_SHIFT)
3079 
3080 /* Bitfield definition for register: LATCH0_STAT */
3081 /*
3082  * PIN_STAT (RO)
3083  *
3084  * Latch0 pin state
3085  */
3086 #define ESC_LATCH0_STAT_PIN_STAT_MASK (0x4U)
3087 #define ESC_LATCH0_STAT_PIN_STAT_SHIFT (2U)
3088 #define ESC_LATCH0_STAT_PIN_STAT_GET(x) (((uint8_t)(x) & ESC_LATCH0_STAT_PIN_STAT_MASK) >> ESC_LATCH0_STAT_PIN_STAT_SHIFT)
3089 
3090 /*
3091  * NEG_EDGE (RO)
3092  *
3093  * Event Latch0 negative edge.
3094  * 0:Negative edge not detected or
3095  * continuous mode
3096  * 1:Negative edge detected in single event
3097  * mode only.
3098  * Flag cleared by reading out Latch0 Time
3099  * Negative Edge.
3100  */
3101 #define ESC_LATCH0_STAT_NEG_EDGE_MASK (0x2U)
3102 #define ESC_LATCH0_STAT_NEG_EDGE_SHIFT (1U)
3103 #define ESC_LATCH0_STAT_NEG_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH0_STAT_NEG_EDGE_MASK) >> ESC_LATCH0_STAT_NEG_EDGE_SHIFT)
3104 
3105 /*
3106  * POS_EDGE (RO)
3107  *
3108  * Event Latch0 positive edge.
3109  * 0:Positive edge not detected or
3110  * continuous mode
3111  * 1:Positive edge detected in single event
3112  * mode only.
3113  * Flag cleared by reading out Latch0 Time
3114  * Positive Edge.
3115  */
3116 #define ESC_LATCH0_STAT_POS_EDGE_MASK (0x1U)
3117 #define ESC_LATCH0_STAT_POS_EDGE_SHIFT (0U)
3118 #define ESC_LATCH0_STAT_POS_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH0_STAT_POS_EDGE_MASK) >> ESC_LATCH0_STAT_POS_EDGE_SHIFT)
3119 
3120 /* Bitfield definition for register: LATCH1_STAT */
3121 /*
3122  * PIN_STAT (RO)
3123  *
3124  * Latch1 pin state
3125  */
3126 #define ESC_LATCH1_STAT_PIN_STAT_MASK (0x4U)
3127 #define ESC_LATCH1_STAT_PIN_STAT_SHIFT (2U)
3128 #define ESC_LATCH1_STAT_PIN_STAT_GET(x) (((uint8_t)(x) & ESC_LATCH1_STAT_PIN_STAT_MASK) >> ESC_LATCH1_STAT_PIN_STAT_SHIFT)
3129 
3130 /*
3131  * NEG_EDGE (RO)
3132  *
3133  * Event Latch1 negative edge.
3134  * 0:Negative edge not detected or
3135  * continuous mode
3136  * 1:Negative edge detected in single event
3137  * mode only.
3138  * Flag cleared by reading out Latch1 Time
3139  * Negative Edge.
3140  */
3141 #define ESC_LATCH1_STAT_NEG_EDGE_MASK (0x2U)
3142 #define ESC_LATCH1_STAT_NEG_EDGE_SHIFT (1U)
3143 #define ESC_LATCH1_STAT_NEG_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH1_STAT_NEG_EDGE_MASK) >> ESC_LATCH1_STAT_NEG_EDGE_SHIFT)
3144 
3145 /*
3146  * POS_EDGE (RO)
3147  *
3148  * Event Latch1 positive edge.
3149  * 0:Positive edge not detected or
3150  * continuous mode
3151  * 1:Positive edge detected in single event
3152  * mode only.
3153  * Flag cleared by reading out Latch1 Time
3154  * Positive Edge.
3155  */
3156 #define ESC_LATCH1_STAT_POS_EDGE_MASK (0x1U)
3157 #define ESC_LATCH1_STAT_POS_EDGE_SHIFT (0U)
3158 #define ESC_LATCH1_STAT_POS_EDGE_GET(x) (((uint8_t)(x) & ESC_LATCH1_STAT_POS_EDGE_MASK) >> ESC_LATCH1_STAT_POS_EDGE_SHIFT)
3159 
3160 /* Bitfield definition for register: LATCH0_TIME_PE */
3161 /*
3162  * TIME (RW)
3163  *
3164  * System time at the positive edge of the
3165  * Latch0 signal.
3166  */
3167 #define ESC_LATCH0_TIME_PE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
3168 #define ESC_LATCH0_TIME_PE_TIME_SHIFT (0U)
3169 #define ESC_LATCH0_TIME_PE_TIME_SET(x) (((uint64_t)(x) << ESC_LATCH0_TIME_PE_TIME_SHIFT) & ESC_LATCH0_TIME_PE_TIME_MASK)
3170 #define ESC_LATCH0_TIME_PE_TIME_GET(x) (((uint64_t)(x) & ESC_LATCH0_TIME_PE_TIME_MASK) >> ESC_LATCH0_TIME_PE_TIME_SHIFT)
3171 
3172 /* Bitfield definition for register: LATCH0_TIME_NE */
3173 /*
3174  * TIME (RW)
3175  *
3176  * System time at the negative edge of the
3177  * Latch0 signal.
3178  */
3179 #define ESC_LATCH0_TIME_NE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
3180 #define ESC_LATCH0_TIME_NE_TIME_SHIFT (0U)
3181 #define ESC_LATCH0_TIME_NE_TIME_SET(x) (((uint64_t)(x) << ESC_LATCH0_TIME_NE_TIME_SHIFT) & ESC_LATCH0_TIME_NE_TIME_MASK)
3182 #define ESC_LATCH0_TIME_NE_TIME_GET(x) (((uint64_t)(x) & ESC_LATCH0_TIME_NE_TIME_MASK) >> ESC_LATCH0_TIME_NE_TIME_SHIFT)
3183 
3184 /* Bitfield definition for register: LATCH1_TIME_PE */
3185 /*
3186  * TIME (RW)
3187  *
3188  * System time at the positive edge of the
3189  * Latch1 signal.
3190  */
3191 #define ESC_LATCH1_TIME_PE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
3192 #define ESC_LATCH1_TIME_PE_TIME_SHIFT (0U)
3193 #define ESC_LATCH1_TIME_PE_TIME_SET(x) (((uint64_t)(x) << ESC_LATCH1_TIME_PE_TIME_SHIFT) & ESC_LATCH1_TIME_PE_TIME_MASK)
3194 #define ESC_LATCH1_TIME_PE_TIME_GET(x) (((uint64_t)(x) & ESC_LATCH1_TIME_PE_TIME_MASK) >> ESC_LATCH1_TIME_PE_TIME_SHIFT)
3195 
3196 /* Bitfield definition for register: LATCH1_TIME_NE */
3197 /*
3198  * TIME (RW)
3199  *
3200  * System time at the negative edge of the
3201  * Latch1 signal.
3202  */
3203 #define ESC_LATCH1_TIME_NE_TIME_MASK (0xFFFFFFFFFFFFFFFFULL)
3204 #define ESC_LATCH1_TIME_NE_TIME_SHIFT (0U)
3205 #define ESC_LATCH1_TIME_NE_TIME_SET(x) (((uint64_t)(x) << ESC_LATCH1_TIME_NE_TIME_SHIFT) & ESC_LATCH1_TIME_NE_TIME_MASK)
3206 #define ESC_LATCH1_TIME_NE_TIME_GET(x) (((uint64_t)(x) & ESC_LATCH1_TIME_NE_TIME_MASK) >> ESC_LATCH1_TIME_NE_TIME_SHIFT)
3207 
3208 /* Bitfield definition for register: ECAT_BUF_CET */
3209 /*
3210  * TIME (RO)
3211  *
3212  * Local time at the beginning of the frame
3213  * which causes at least one SyncManager to
3214  * assert an ECAT event
3215  */
3216 #define ESC_ECAT_BUF_CET_TIME_MASK (0xFFFFFFFFUL)
3217 #define ESC_ECAT_BUF_CET_TIME_SHIFT (0U)
3218 #define ESC_ECAT_BUF_CET_TIME_GET(x) (((uint32_t)(x) & ESC_ECAT_BUF_CET_TIME_MASK) >> ESC_ECAT_BUF_CET_TIME_SHIFT)
3219 
3220 /* Bitfield definition for register: PDI_BUF_SET */
3221 /*
3222  * TIME (RO)
3223  *
3224  * Local time when at least one SyncManager
3225  * asserts a PDI buffer start event
3226  */
3227 #define ESC_PDI_BUF_SET_TIME_MASK (0xFFFFFFFFUL)
3228 #define ESC_PDI_BUF_SET_TIME_SHIFT (0U)
3229 #define ESC_PDI_BUF_SET_TIME_GET(x) (((uint32_t)(x) & ESC_PDI_BUF_SET_TIME_MASK) >> ESC_PDI_BUF_SET_TIME_SHIFT)
3230 
3231 /* Bitfield definition for register: PDI_BUF_CET */
3232 /*
3233  * TIME (RO)
3234  *
3235  * Local time when at least one SyncManager
3236  * asserts a PDI buffer change event
3237  */
3238 #define ESC_PDI_BUF_CET_TIME_MASK (0xFFFFFFFFUL)
3239 #define ESC_PDI_BUF_CET_TIME_SHIFT (0U)
3240 #define ESC_PDI_BUF_CET_TIME_GET(x) (((uint32_t)(x) & ESC_PDI_BUF_CET_TIME_MASK) >> ESC_PDI_BUF_CET_TIME_SHIFT)
3241 
3242 /* Bitfield definition for register: PID */
3243 /*
3244  * PID (RO)
3245  *
3246  * Product ID
3247  */
3248 #define ESC_PID_PID_MASK (0xFFFFFFFFFFFFFFFFULL)
3249 #define ESC_PID_PID_SHIFT (0U)
3250 #define ESC_PID_PID_GET(x) (((uint64_t)(x) & ESC_PID_PID_MASK) >> ESC_PID_PID_SHIFT)
3251 
3252 /* Bitfield definition for register: VID */
3253 /*
3254  * VID (RO)
3255  *
3256  * Vendor ID:
3257  * 23-0: Company
3258  * 31-24: Department
3259  * NOTE:Test Vendor IDs have [31:28]=0xE
3260  */
3261 #define ESC_VID_VID_MASK (0xFFFFFFFFFFFFFFFFULL)
3262 #define ESC_VID_VID_SHIFT (0U)
3263 #define ESC_VID_VID_GET(x) (((uint64_t)(x) & ESC_VID_VID_MASK) >> ESC_VID_VID_SHIFT)
3264 
3265 /* Bitfield definition for register: DIO_OUT_DATA */
3266 /*
3267  * OD (RO)
3268  *
3269  * Output Data
3270  */
3271 #define ESC_DIO_OUT_DATA_OD_MASK (0xFFFFFFFFUL)
3272 #define ESC_DIO_OUT_DATA_OD_SHIFT (0U)
3273 #define ESC_DIO_OUT_DATA_OD_GET(x) (((uint32_t)(x) & ESC_DIO_OUT_DATA_OD_MASK) >> ESC_DIO_OUT_DATA_OD_SHIFT)
3274 
3275 /* Bitfield definition for register: GPO */
3276 /*
3277  * GPOD (RW)
3278  *
3279  * General Purpose Output Data
3280  */
3281 #define ESC_GPO_GPOD_MASK (0xFFFFFFFFFFFFFFFFULL)
3282 #define ESC_GPO_GPOD_SHIFT (0U)
3283 #define ESC_GPO_GPOD_SET(x) (((uint64_t)(x) << ESC_GPO_GPOD_SHIFT) & ESC_GPO_GPOD_MASK)
3284 #define ESC_GPO_GPOD_GET(x) (((uint64_t)(x) & ESC_GPO_GPOD_MASK) >> ESC_GPO_GPOD_SHIFT)
3285 
3286 /* Bitfield definition for register: GPI */
3287 /*
3288  * GPID (RO)
3289  *
3290  * General Purpose Input Data
3291  */
3292 #define ESC_GPI_GPID_MASK (0xFFFFFFFFFFFFFFFFULL)
3293 #define ESC_GPI_GPID_SHIFT (0U)
3294 #define ESC_GPI_GPID_GET(x) (((uint64_t)(x) & ESC_GPI_GPID_MASK) >> ESC_GPI_GPID_SHIFT)
3295 
3296 /* Bitfield definition for register: USER_RAM_BYTE0 */
3297 /*
3298  * EXTF (RW)
3299  *
3300  * Number of extended feature bits
3301  */
3302 #define ESC_USER_RAM_BYTE0_EXTF_MASK (0xFFU)
3303 #define ESC_USER_RAM_BYTE0_EXTF_SHIFT (0U)
3304 #define ESC_USER_RAM_BYTE0_EXTF_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE0_EXTF_SHIFT) & ESC_USER_RAM_BYTE0_EXTF_MASK)
3305 #define ESC_USER_RAM_BYTE0_EXTF_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE0_EXTF_MASK) >> ESC_USER_RAM_BYTE0_EXTF_SHIFT)
3306 
3307 /* Bitfield definition for register: USER_RAM_BYTE1 */
3308 /*
3309  * PRWO (RW)
3310  *
3311  * Physical Read/Write Offset (0x0108:0x0109)
3312  */
3313 #define ESC_USER_RAM_BYTE1_PRWO_MASK (0x80U)
3314 #define ESC_USER_RAM_BYTE1_PRWO_SHIFT (7U)
3315 #define ESC_USER_RAM_BYTE1_PRWO_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_PRWO_SHIFT) & ESC_USER_RAM_BYTE1_PRWO_MASK)
3316 #define ESC_USER_RAM_BYTE1_PRWO_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_PRWO_MASK) >> ESC_USER_RAM_BYTE1_PRWO_SHIFT)
3317 
3318 /*
3319  * AEMW (RW)
3320  *
3321  * AL Event Mask writable (0x0204:0x0207)
3322  */
3323 #define ESC_USER_RAM_BYTE1_AEMW_MASK (0x40U)
3324 #define ESC_USER_RAM_BYTE1_AEMW_SHIFT (6U)
3325 #define ESC_USER_RAM_BYTE1_AEMW_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_AEMW_SHIFT) & ESC_USER_RAM_BYTE1_AEMW_MASK)
3326 #define ESC_USER_RAM_BYTE1_AEMW_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_AEMW_MASK) >> ESC_USER_RAM_BYTE1_AEMW_SHIFT)
3327 
3328 /*
3329  * GPO (RW)
3330  *
3331  * General Purpose Outputs (0x0F10:0x0F17)
3332  */
3333 #define ESC_USER_RAM_BYTE1_GPO_MASK (0x20U)
3334 #define ESC_USER_RAM_BYTE1_GPO_SHIFT (5U)
3335 #define ESC_USER_RAM_BYTE1_GPO_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_GPO_SHIFT) & ESC_USER_RAM_BYTE1_GPO_MASK)
3336 #define ESC_USER_RAM_BYTE1_GPO_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_GPO_MASK) >> ESC_USER_RAM_BYTE1_GPO_SHIFT)
3337 
3338 /*
3339  * GPI (RW)
3340  *
3341  * General Purpose Inputs (0x0F18:0x0F1F)
3342  */
3343 #define ESC_USER_RAM_BYTE1_GPI_MASK (0x10U)
3344 #define ESC_USER_RAM_BYTE1_GPI_SHIFT (4U)
3345 #define ESC_USER_RAM_BYTE1_GPI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_GPI_SHIFT) & ESC_USER_RAM_BYTE1_GPI_MASK)
3346 #define ESC_USER_RAM_BYTE1_GPI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_GPI_MASK) >> ESC_USER_RAM_BYTE1_GPI_SHIFT)
3347 
3348 /*
3349  * CSA (RW)
3350  *
3351  * Configured Station Alias (0x0012:0x0013)
3352  */
3353 #define ESC_USER_RAM_BYTE1_CSA_MASK (0x8U)
3354 #define ESC_USER_RAM_BYTE1_CSA_SHIFT (3U)
3355 #define ESC_USER_RAM_BYTE1_CSA_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_CSA_SHIFT) & ESC_USER_RAM_BYTE1_CSA_MASK)
3356 #define ESC_USER_RAM_BYTE1_CSA_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_CSA_MASK) >> ESC_USER_RAM_BYTE1_CSA_SHIFT)
3357 
3358 /*
3359  * EIM (RW)
3360  *
3361  * ECAT Interrupt Mask (0x0200:0x0201)
3362  */
3363 #define ESC_USER_RAM_BYTE1_EIM_MASK (0x4U)
3364 #define ESC_USER_RAM_BYTE1_EIM_SHIFT (2U)
3365 #define ESC_USER_RAM_BYTE1_EIM_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_EIM_SHIFT) & ESC_USER_RAM_BYTE1_EIM_MASK)
3366 #define ESC_USER_RAM_BYTE1_EIM_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_EIM_MASK) >> ESC_USER_RAM_BYTE1_EIM_SHIFT)
3367 
3368 /*
3369  * ALSCR (RW)
3370  *
3371  * AL Status Code Register (0x0134:0x0135)
3372  */
3373 #define ESC_USER_RAM_BYTE1_ALSCR_MASK (0x2U)
3374 #define ESC_USER_RAM_BYTE1_ALSCR_SHIFT (1U)
3375 #define ESC_USER_RAM_BYTE1_ALSCR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_ALSCR_SHIFT) & ESC_USER_RAM_BYTE1_ALSCR_MASK)
3376 #define ESC_USER_RAM_BYTE1_ALSCR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_ALSCR_MASK) >> ESC_USER_RAM_BYTE1_ALSCR_SHIFT)
3377 
3378 /*
3379  * EDLCR (RW)
3380  *
3381  * Extended DL Control Register (0x0102:0x0103)
3382  */
3383 #define ESC_USER_RAM_BYTE1_EDLCR_MASK (0x1U)
3384 #define ESC_USER_RAM_BYTE1_EDLCR_SHIFT (0U)
3385 #define ESC_USER_RAM_BYTE1_EDLCR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE1_EDLCR_SHIFT) & ESC_USER_RAM_BYTE1_EDLCR_MASK)
3386 #define ESC_USER_RAM_BYTE1_EDLCR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE1_EDLCR_MASK) >> ESC_USER_RAM_BYTE1_EDLCR_SHIFT)
3387 
3388 /* Bitfield definition for register: USER_RAM_BYTE2 */
3389 /*
3390  * ESCFG (RW)
3391  *
3392  * EEPROM Size configurable (0x0502[7]):
3393  * 0:EEPROM Size fixed to sizes up to 16 Kbit
3394  * 1:EEPROM Size configurable
3395  */
3396 #define ESC_USER_RAM_BYTE2_ESCFG_MASK (0x80U)
3397 #define ESC_USER_RAM_BYTE2_ESCFG_SHIFT (7U)
3398 #define ESC_USER_RAM_BYTE2_ESCFG_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_ESCFG_SHIFT) & ESC_USER_RAM_BYTE2_ESCFG_MASK)
3399 #define ESC_USER_RAM_BYTE2_ESCFG_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_ESCFG_MASK) >> ESC_USER_RAM_BYTE2_ESCFG_SHIFT)
3400 
3401 /*
3402  * EPUPEC (RW)
3403  *
3404  * ECAT Processing Unit/PDI Error Counter
3405  * (0x030C:0x030D)
3406  */
3407 #define ESC_USER_RAM_BYTE2_EPUPEC_MASK (0x40U)
3408 #define ESC_USER_RAM_BYTE2_EPUPEC_SHIFT (6U)
3409 #define ESC_USER_RAM_BYTE2_EPUPEC_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_EPUPEC_SHIFT) & ESC_USER_RAM_BYTE2_EPUPEC_MASK)
3410 #define ESC_USER_RAM_BYTE2_EPUPEC_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_EPUPEC_MASK) >> ESC_USER_RAM_BYTE2_EPUPEC_SHIFT)
3411 
3412 /*
3413  * DCSMET (RW)
3414  *
3415  * DC SyncManager Event Times (0x09F0:0x09FF)
3416  */
3417 #define ESC_USER_RAM_BYTE2_DCSMET_MASK (0x20U)
3418 #define ESC_USER_RAM_BYTE2_DCSMET_SHIFT (5U)
3419 #define ESC_USER_RAM_BYTE2_DCSMET_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_DCSMET_SHIFT) & ESC_USER_RAM_BYTE2_DCSMET_MASK)
3420 #define ESC_USER_RAM_BYTE2_DCSMET_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_DCSMET_MASK) >> ESC_USER_RAM_BYTE2_DCSMET_SHIFT)
3421 
3422 /*
3423  * RESET (RW)
3424  *
3425  * Reset (0x0040:0x0041)
3426  */
3427 #define ESC_USER_RAM_BYTE2_RESET_MASK (0x8U)
3428 #define ESC_USER_RAM_BYTE2_RESET_SHIFT (3U)
3429 #define ESC_USER_RAM_BYTE2_RESET_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_RESET_SHIFT) & ESC_USER_RAM_BYTE2_RESET_MASK)
3430 #define ESC_USER_RAM_BYTE2_RESET_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_RESET_MASK) >> ESC_USER_RAM_BYTE2_RESET_SHIFT)
3431 
3432 /*
3433  * WP (RW)
3434  *
3435  * Write Protection (0x0020:0x0031)
3436  */
3437 #define ESC_USER_RAM_BYTE2_WP_MASK (0x4U)
3438 #define ESC_USER_RAM_BYTE2_WP_SHIFT (2U)
3439 #define ESC_USER_RAM_BYTE2_WP_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_WP_SHIFT) & ESC_USER_RAM_BYTE2_WP_MASK)
3440 #define ESC_USER_RAM_BYTE2_WP_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_WP_MASK) >> ESC_USER_RAM_BYTE2_WP_SHIFT)
3441 
3442 /*
3443  * WDGCNT (RW)
3444  *
3445  * Watchdog counters (0x0442:0x0443)
3446  */
3447 #define ESC_USER_RAM_BYTE2_WDGCNT_MASK (0x2U)
3448 #define ESC_USER_RAM_BYTE2_WDGCNT_SHIFT (1U)
3449 #define ESC_USER_RAM_BYTE2_WDGCNT_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_WDGCNT_SHIFT) & ESC_USER_RAM_BYTE2_WDGCNT_MASK)
3450 #define ESC_USER_RAM_BYTE2_WDGCNT_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_WDGCNT_MASK) >> ESC_USER_RAM_BYTE2_WDGCNT_SHIFT)
3451 
3452 /*
3453  * WDW (RW)
3454  *
3455  * Watchdog divider writable (0x0400:0x0401) and
3456  * Watchdog PDI (0x0410:0x0411)
3457  */
3458 #define ESC_USER_RAM_BYTE2_WDW_MASK (0x1U)
3459 #define ESC_USER_RAM_BYTE2_WDW_SHIFT (0U)
3460 #define ESC_USER_RAM_BYTE2_WDW_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE2_WDW_SHIFT) & ESC_USER_RAM_BYTE2_WDW_MASK)
3461 #define ESC_USER_RAM_BYTE2_WDW_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE2_WDW_MASK) >> ESC_USER_RAM_BYTE2_WDW_SHIFT)
3462 
3463 /* Bitfield definition for register: USER_RAM_BYTE3 */
3464 /*
3465  * RLED (RW)
3466  *
3467  * Run LED (DEV_STATE LED)
3468  */
3469 #define ESC_USER_RAM_BYTE3_RLED_MASK (0x80U)
3470 #define ESC_USER_RAM_BYTE3_RLED_SHIFT (7U)
3471 #define ESC_USER_RAM_BYTE3_RLED_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_RLED_SHIFT) & ESC_USER_RAM_BYTE3_RLED_MASK)
3472 #define ESC_USER_RAM_BYTE3_RLED_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_RLED_MASK) >> ESC_USER_RAM_BYTE3_RLED_SHIFT)
3473 
3474 /*
3475  * ELDE (RW)
3476  *
3477  * Enhanced Link Detection EBUS
3478  */
3479 #define ESC_USER_RAM_BYTE3_ELDE_MASK (0x40U)
3480 #define ESC_USER_RAM_BYTE3_ELDE_SHIFT (6U)
3481 #define ESC_USER_RAM_BYTE3_ELDE_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_ELDE_SHIFT) & ESC_USER_RAM_BYTE3_ELDE_MASK)
3482 #define ESC_USER_RAM_BYTE3_ELDE_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_ELDE_MASK) >> ESC_USER_RAM_BYTE3_ELDE_SHIFT)
3483 
3484 /*
3485  * ELDM (RW)
3486  *
3487  * Enhanced Link Detection MII
3488  */
3489 #define ESC_USER_RAM_BYTE3_ELDM_MASK (0x20U)
3490 #define ESC_USER_RAM_BYTE3_ELDM_SHIFT (5U)
3491 #define ESC_USER_RAM_BYTE3_ELDM_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_ELDM_SHIFT) & ESC_USER_RAM_BYTE3_ELDM_MASK)
3492 #define ESC_USER_RAM_BYTE3_ELDM_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_ELDM_MASK) >> ESC_USER_RAM_BYTE3_ELDM_SHIFT)
3493 
3494 /*
3495  * MMI (RW)
3496  *
3497  * MII Management Interface (0x0510:0x0515)
3498  */
3499 #define ESC_USER_RAM_BYTE3_MMI_MASK (0x10U)
3500 #define ESC_USER_RAM_BYTE3_MMI_SHIFT (4U)
3501 #define ESC_USER_RAM_BYTE3_MMI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_MMI_SHIFT) & ESC_USER_RAM_BYTE3_MMI_MASK)
3502 #define ESC_USER_RAM_BYTE3_MMI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_MMI_MASK) >> ESC_USER_RAM_BYTE3_MMI_SHIFT)
3503 
3504 /*
3505  * LLC (RW)
3506  *
3507  * Lost Link Counter (0x0310:0x0313)
3508  */
3509 #define ESC_USER_RAM_BYTE3_LLC_MASK (0x8U)
3510 #define ESC_USER_RAM_BYTE3_LLC_SHIFT (3U)
3511 #define ESC_USER_RAM_BYTE3_LLC_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE3_LLC_SHIFT) & ESC_USER_RAM_BYTE3_LLC_MASK)
3512 #define ESC_USER_RAM_BYTE3_LLC_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE3_LLC_MASK) >> ESC_USER_RAM_BYTE3_LLC_SHIFT)
3513 
3514 /* Bitfield definition for register: USER_RAM_BYTE4 */
3515 /*
3516  * LDCM (RW)
3517  *
3518  * Link detection and configuration by MI
3519  */
3520 #define ESC_USER_RAM_BYTE4_LDCM_MASK (0x80U)
3521 #define ESC_USER_RAM_BYTE4_LDCM_SHIFT (7U)
3522 #define ESC_USER_RAM_BYTE4_LDCM_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_LDCM_SHIFT) & ESC_USER_RAM_BYTE4_LDCM_MASK)
3523 #define ESC_USER_RAM_BYTE4_LDCM_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_LDCM_MASK) >> ESC_USER_RAM_BYTE4_LDCM_SHIFT)
3524 
3525 /*
3526  * DTLC (RW)
3527  *
3528  * DC Time loop control assigned to PDI
3529  */
3530 #define ESC_USER_RAM_BYTE4_DTLC_MASK (0x40U)
3531 #define ESC_USER_RAM_BYTE4_DTLC_SHIFT (6U)
3532 #define ESC_USER_RAM_BYTE4_DTLC_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_DTLC_SHIFT) & ESC_USER_RAM_BYTE4_DTLC_MASK)
3533 #define ESC_USER_RAM_BYTE4_DTLC_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_DTLC_MASK) >> ESC_USER_RAM_BYTE4_DTLC_SHIFT)
3534 
3535 /*
3536  * DSOU (RW)
3537  *
3538  * DC Sync Out Unit
3539  */
3540 #define ESC_USER_RAM_BYTE4_DSOU_MASK (0x20U)
3541 #define ESC_USER_RAM_BYTE4_DSOU_SHIFT (5U)
3542 #define ESC_USER_RAM_BYTE4_DSOU_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_DSOU_SHIFT) & ESC_USER_RAM_BYTE4_DSOU_MASK)
3543 #define ESC_USER_RAM_BYTE4_DSOU_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_DSOU_MASK) >> ESC_USER_RAM_BYTE4_DSOU_SHIFT)
3544 
3545 /*
3546  * DLIU (RW)
3547  *
3548  * DC Latch In Unit
3549  */
3550 #define ESC_USER_RAM_BYTE4_DLIU_MASK (0x8U)
3551 #define ESC_USER_RAM_BYTE4_DLIU_SHIFT (3U)
3552 #define ESC_USER_RAM_BYTE4_DLIU_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_DLIU_SHIFT) & ESC_USER_RAM_BYTE4_DLIU_MASK)
3553 #define ESC_USER_RAM_BYTE4_DLIU_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_DLIU_MASK) >> ESC_USER_RAM_BYTE4_DLIU_SHIFT)
3554 
3555 /*
3556  * LALED (RW)
3557  *
3558  * Link/Activity LED
3559  */
3560 #define ESC_USER_RAM_BYTE4_LALED_MASK (0x1U)
3561 #define ESC_USER_RAM_BYTE4_LALED_SHIFT (0U)
3562 #define ESC_USER_RAM_BYTE4_LALED_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE4_LALED_SHIFT) & ESC_USER_RAM_BYTE4_LALED_MASK)
3563 #define ESC_USER_RAM_BYTE4_LALED_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE4_LALED_MASK) >> ESC_USER_RAM_BYTE4_LALED_SHIFT)
3564 
3565 /* Bitfield definition for register: USER_RAM_BYTE5 */
3566 /*
3567  * DDIOR (RW)
3568  *
3569  * Disable Digital I/O register (0x0F00:0x0F03)
3570  */
3571 #define ESC_USER_RAM_BYTE5_DDIOR_MASK (0x20U)
3572 #define ESC_USER_RAM_BYTE5_DDIOR_SHIFT (5U)
3573 #define ESC_USER_RAM_BYTE5_DDIOR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE5_DDIOR_SHIFT) & ESC_USER_RAM_BYTE5_DDIOR_MASK)
3574 #define ESC_USER_RAM_BYTE5_DDIOR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE5_DDIOR_MASK) >> ESC_USER_RAM_BYTE5_DDIOR_SHIFT)
3575 
3576 /*
3577  * EEU (RW)
3578  *
3579  * EEPROM emulation by µController
3580  */
3581 #define ESC_USER_RAM_BYTE5_EEU_MASK (0x4U)
3582 #define ESC_USER_RAM_BYTE5_EEU_SHIFT (2U)
3583 #define ESC_USER_RAM_BYTE5_EEU_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE5_EEU_SHIFT) & ESC_USER_RAM_BYTE5_EEU_MASK)
3584 #define ESC_USER_RAM_BYTE5_EEU_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE5_EEU_MASK) >> ESC_USER_RAM_BYTE5_EEU_SHIFT)
3585 
3586 /*
3587  * ATS (RW)
3588  *
3589  * Automatic TX shift
3590  */
3591 #define ESC_USER_RAM_BYTE5_ATS_MASK (0x2U)
3592 #define ESC_USER_RAM_BYTE5_ATS_SHIFT (1U)
3593 #define ESC_USER_RAM_BYTE5_ATS_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE5_ATS_SHIFT) & ESC_USER_RAM_BYTE5_ATS_MASK)
3594 #define ESC_USER_RAM_BYTE5_ATS_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE5_ATS_MASK) >> ESC_USER_RAM_BYTE5_ATS_SHIFT)
3595 
3596 /*
3597  * MCPP (RW)
3598  *
3599  * MI control by PDI possible
3600  */
3601 #define ESC_USER_RAM_BYTE5_MCPP_MASK (0x1U)
3602 #define ESC_USER_RAM_BYTE5_MCPP_SHIFT (0U)
3603 #define ESC_USER_RAM_BYTE5_MCPP_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE5_MCPP_SHIFT) & ESC_USER_RAM_BYTE5_MCPP_MASK)
3604 #define ESC_USER_RAM_BYTE5_MCPP_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE5_MCPP_MASK) >> ESC_USER_RAM_BYTE5_MCPP_SHIFT)
3605 
3606 /* Bitfield definition for register: USER_RAM_BYTE6 */
3607 /*
3608  * RELEDOR (RW)
3609  *
3610  * RUN/ERR LED Override (0x0138:0x0139)
3611  */
3612 #define ESC_USER_RAM_BYTE6_RELEDOR_MASK (0x4U)
3613 #define ESC_USER_RAM_BYTE6_RELEDOR_SHIFT (2U)
3614 #define ESC_USER_RAM_BYTE6_RELEDOR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE6_RELEDOR_SHIFT) & ESC_USER_RAM_BYTE6_RELEDOR_MASK)
3615 #define ESC_USER_RAM_BYTE6_RELEDOR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE6_RELEDOR_MASK) >> ESC_USER_RAM_BYTE6_RELEDOR_SHIFT)
3616 
3617 /* Bitfield definition for register: USER_RAM_BYTE7 */
3618 /*
3619  * DCST (RW)
3620  *
3621  * DC System Time (0x0910:0x0936)
3622  */
3623 #define ESC_USER_RAM_BYTE7_DCST_MASK (0x80U)
3624 #define ESC_USER_RAM_BYTE7_DCST_SHIFT (7U)
3625 #define ESC_USER_RAM_BYTE7_DCST_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE7_DCST_SHIFT) & ESC_USER_RAM_BYTE7_DCST_MASK)
3626 #define ESC_USER_RAM_BYTE7_DCST_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE7_DCST_MASK) >> ESC_USER_RAM_BYTE7_DCST_SHIFT)
3627 
3628 /*
3629  * DCRT (RW)
3630  *
3631  * DC Receive Times (0x0900:0x090F)
3632  */
3633 #define ESC_USER_RAM_BYTE7_DCRT_MASK (0x40U)
3634 #define ESC_USER_RAM_BYTE7_DCRT_SHIFT (6U)
3635 #define ESC_USER_RAM_BYTE7_DCRT_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE7_DCRT_SHIFT) & ESC_USER_RAM_BYTE7_DCRT_MASK)
3636 #define ESC_USER_RAM_BYTE7_DCRT_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE7_DCRT_MASK) >> ESC_USER_RAM_BYTE7_DCRT_SHIFT)
3637 
3638 /*
3639  * DCS1D (RW)
3640  *
3641  * DC Sync1 disable
3642  */
3643 #define ESC_USER_RAM_BYTE7_DCS1D_MASK (0x8U)
3644 #define ESC_USER_RAM_BYTE7_DCS1D_SHIFT (3U)
3645 #define ESC_USER_RAM_BYTE7_DCS1D_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE7_DCS1D_SHIFT) & ESC_USER_RAM_BYTE7_DCS1D_MASK)
3646 #define ESC_USER_RAM_BYTE7_DCS1D_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE7_DCS1D_MASK) >> ESC_USER_RAM_BYTE7_DCS1D_SHIFT)
3647 
3648 /* Bitfield definition for register: USER_RAM_BYTE8 */
3649 /*
3650  * PPDI (RW)
3651  *
3652  * PLB PDI
3653  */
3654 #define ESC_USER_RAM_BYTE8_PPDI_MASK (0x20U)
3655 #define ESC_USER_RAM_BYTE8_PPDI_SHIFT (5U)
3656 #define ESC_USER_RAM_BYTE8_PPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_PPDI_SHIFT) & ESC_USER_RAM_BYTE8_PPDI_MASK)
3657 #define ESC_USER_RAM_BYTE8_PPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_PPDI_MASK) >> ESC_USER_RAM_BYTE8_PPDI_SHIFT)
3658 
3659 /*
3660  * OPDI (RW)
3661  *
3662  * OPB PDI
3663  */
3664 #define ESC_USER_RAM_BYTE8_OPDI_MASK (0x10U)
3665 #define ESC_USER_RAM_BYTE8_OPDI_SHIFT (4U)
3666 #define ESC_USER_RAM_BYTE8_OPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_OPDI_SHIFT) & ESC_USER_RAM_BYTE8_OPDI_MASK)
3667 #define ESC_USER_RAM_BYTE8_OPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_OPDI_MASK) >> ESC_USER_RAM_BYTE8_OPDI_SHIFT)
3668 
3669 /*
3670  * APDI (RW)
3671  *
3672  * Avalon PDI
3673  */
3674 #define ESC_USER_RAM_BYTE8_APDI_MASK (0x8U)
3675 #define ESC_USER_RAM_BYTE8_APDI_SHIFT (3U)
3676 #define ESC_USER_RAM_BYTE8_APDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_APDI_SHIFT) & ESC_USER_RAM_BYTE8_APDI_MASK)
3677 #define ESC_USER_RAM_BYTE8_APDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_APDI_MASK) >> ESC_USER_RAM_BYTE8_APDI_SHIFT)
3678 
3679 /*
3680  * PDICEC (RW)
3681  *
3682  * PDI clears error counter
3683  */
3684 #define ESC_USER_RAM_BYTE8_PDICEC_MASK (0x4U)
3685 #define ESC_USER_RAM_BYTE8_PDICEC_SHIFT (2U)
3686 #define ESC_USER_RAM_BYTE8_PDICEC_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_PDICEC_SHIFT) & ESC_USER_RAM_BYTE8_PDICEC_MASK)
3687 #define ESC_USER_RAM_BYTE8_PDICEC_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_PDICEC_MASK) >> ESC_USER_RAM_BYTE8_PDICEC_SHIFT)
3688 
3689 /*
3690  * DC64 (RW)
3691  *
3692  * DC 64 bit
3693  */
3694 #define ESC_USER_RAM_BYTE8_DC64_MASK (0x1U)
3695 #define ESC_USER_RAM_BYTE8_DC64_SHIFT (0U)
3696 #define ESC_USER_RAM_BYTE8_DC64_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE8_DC64_SHIFT) & ESC_USER_RAM_BYTE8_DC64_MASK)
3697 #define ESC_USER_RAM_BYTE8_DC64_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE8_DC64_MASK) >> ESC_USER_RAM_BYTE8_DC64_SHIFT)
3698 
3699 /* Bitfield definition for register: USER_RAM_BYTE9 */
3700 /*
3701  * DR (RW)
3702  *
3703  * Direct RESET
3704  */
3705 #define ESC_USER_RAM_BYTE9_DR_MASK (0x80U)
3706 #define ESC_USER_RAM_BYTE9_DR_SHIFT (7U)
3707 #define ESC_USER_RAM_BYTE9_DR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE9_DR_SHIFT) & ESC_USER_RAM_BYTE9_DR_MASK)
3708 #define ESC_USER_RAM_BYTE9_DR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE9_DR_MASK) >> ESC_USER_RAM_BYTE9_DR_SHIFT)
3709 
3710 /* Bitfield definition for register: USER_RAM_BYTE10 */
3711 /*
3712  * PDIIR (RW)
3713  *
3714  * PDI Information register (0x014E:0x014F)
3715  */
3716 #define ESC_USER_RAM_BYTE10_PDIIR_MASK (0x80U)
3717 #define ESC_USER_RAM_BYTE10_PDIIR_SHIFT (7U)
3718 #define ESC_USER_RAM_BYTE10_PDIIR_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE10_PDIIR_SHIFT) & ESC_USER_RAM_BYTE10_PDIIR_MASK)
3719 #define ESC_USER_RAM_BYTE10_PDIIR_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE10_PDIIR_MASK) >> ESC_USER_RAM_BYTE10_PDIIR_SHIFT)
3720 
3721 /*
3722  * PDIFA (RW)
3723  *
3724  * PDI function acknowledge by PDI write
3725  */
3726 #define ESC_USER_RAM_BYTE10_PDIFA_MASK (0x40U)
3727 #define ESC_USER_RAM_BYTE10_PDIFA_SHIFT (6U)
3728 #define ESC_USER_RAM_BYTE10_PDIFA_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE10_PDIFA_SHIFT) & ESC_USER_RAM_BYTE10_PDIFA_MASK)
3729 #define ESC_USER_RAM_BYTE10_PDIFA_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE10_PDIFA_MASK) >> ESC_USER_RAM_BYTE10_PDIFA_SHIFT)
3730 
3731 /*
3732  * APDI (RW)
3733  *
3734  * AXI PDI
3735  */
3736 #define ESC_USER_RAM_BYTE10_APDI_MASK (0x8U)
3737 #define ESC_USER_RAM_BYTE10_APDI_SHIFT (3U)
3738 #define ESC_USER_RAM_BYTE10_APDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE10_APDI_SHIFT) & ESC_USER_RAM_BYTE10_APDI_MASK)
3739 #define ESC_USER_RAM_BYTE10_APDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE10_APDI_MASK) >> ESC_USER_RAM_BYTE10_APDI_SHIFT)
3740 
3741 /*
3742  * DCL1D (RW)
3743  *
3744  * DC Latch1 disable
3745  */
3746 #define ESC_USER_RAM_BYTE10_DCL1D_MASK (0x4U)
3747 #define ESC_USER_RAM_BYTE10_DCL1D_SHIFT (2U)
3748 #define ESC_USER_RAM_BYTE10_DCL1D_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE10_DCL1D_SHIFT) & ESC_USER_RAM_BYTE10_DCL1D_MASK)
3749 #define ESC_USER_RAM_BYTE10_DCL1D_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE10_DCL1D_MASK) >> ESC_USER_RAM_BYTE10_DCL1D_SHIFT)
3750 
3751 /* Bitfield definition for register: USER_RAM_BYTE11 */
3752 /*
3753  * LEDTST (RW)
3754  *
3755  * LED test
3756  */
3757 #define ESC_USER_RAM_BYTE11_LEDTST_MASK (0x8U)
3758 #define ESC_USER_RAM_BYTE11_LEDTST_SHIFT (3U)
3759 #define ESC_USER_RAM_BYTE11_LEDTST_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE11_LEDTST_SHIFT) & ESC_USER_RAM_BYTE11_LEDTST_MASK)
3760 #define ESC_USER_RAM_BYTE11_LEDTST_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE11_LEDTST_MASK) >> ESC_USER_RAM_BYTE11_LEDTST_SHIFT)
3761 
3762 /* Bitfield definition for register: USER_RAM_BYTE14 */
3763 /*
3764  * DIOBS (RW)
3765  *
3766  * Digital I/O PDI byte size
3767  */
3768 #define ESC_USER_RAM_BYTE14_DIOBS_MASK (0xC0U)
3769 #define ESC_USER_RAM_BYTE14_DIOBS_SHIFT (6U)
3770 #define ESC_USER_RAM_BYTE14_DIOBS_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE14_DIOBS_SHIFT) & ESC_USER_RAM_BYTE14_DIOBS_MASK)
3771 #define ESC_USER_RAM_BYTE14_DIOBS_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE14_DIOBS_MASK) >> ESC_USER_RAM_BYTE14_DIOBS_SHIFT)
3772 
3773 /* Bitfield definition for register: USER_RAM_BYTE15 */
3774 /*
3775  * AUCPDI (RW)
3776  *
3777  * Asynchronous µC PDI
3778  */
3779 #define ESC_USER_RAM_BYTE15_AUCPDI_MASK (0x10U)
3780 #define ESC_USER_RAM_BYTE15_AUCPDI_SHIFT (4U)
3781 #define ESC_USER_RAM_BYTE15_AUCPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE15_AUCPDI_SHIFT) & ESC_USER_RAM_BYTE15_AUCPDI_MASK)
3782 #define ESC_USER_RAM_BYTE15_AUCPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE15_AUCPDI_MASK) >> ESC_USER_RAM_BYTE15_AUCPDI_SHIFT)
3783 
3784 /*
3785  * SSPDI (RW)
3786  *
3787  * SPI Slave PDI
3788  */
3789 #define ESC_USER_RAM_BYTE15_SSPDI_MASK (0x8U)
3790 #define ESC_USER_RAM_BYTE15_SSPDI_SHIFT (3U)
3791 #define ESC_USER_RAM_BYTE15_SSPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE15_SSPDI_SHIFT) & ESC_USER_RAM_BYTE15_SSPDI_MASK)
3792 #define ESC_USER_RAM_BYTE15_SSPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE15_SSPDI_MASK) >> ESC_USER_RAM_BYTE15_SSPDI_SHIFT)
3793 
3794 /*
3795  * DIOPDI (RW)
3796  *
3797  * Digital I/O PDI
3798  */
3799 #define ESC_USER_RAM_BYTE15_DIOPDI_MASK (0x4U)
3800 #define ESC_USER_RAM_BYTE15_DIOPDI_SHIFT (2U)
3801 #define ESC_USER_RAM_BYTE15_DIOPDI_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE15_DIOPDI_SHIFT) & ESC_USER_RAM_BYTE15_DIOPDI_MASK)
3802 #define ESC_USER_RAM_BYTE15_DIOPDI_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE15_DIOPDI_MASK) >> ESC_USER_RAM_BYTE15_DIOPDI_SHIFT)
3803 
3804 /* Bitfield definition for register: USER_RAM_BYTE19 */
3805 /*
3806  * SCP (RW)
3807  *
3808  * Security CPLD protection
3809  */
3810 #define ESC_USER_RAM_BYTE19_SCP_MASK (0x40U)
3811 #define ESC_USER_RAM_BYTE19_SCP_SHIFT (6U)
3812 #define ESC_USER_RAM_BYTE19_SCP_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_SCP_SHIFT) & ESC_USER_RAM_BYTE19_SCP_MASK)
3813 #define ESC_USER_RAM_BYTE19_SCP_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_SCP_MASK) >> ESC_USER_RAM_BYTE19_SCP_SHIFT)
3814 
3815 /*
3816  * RMII (RW)
3817  *
3818  * RMII
3819  */
3820 #define ESC_USER_RAM_BYTE19_RMII_MASK (0x20U)
3821 #define ESC_USER_RAM_BYTE19_RMII_SHIFT (5U)
3822 #define ESC_USER_RAM_BYTE19_RMII_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_RMII_SHIFT) & ESC_USER_RAM_BYTE19_RMII_MASK)
3823 #define ESC_USER_RAM_BYTE19_RMII_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_RMII_MASK) >> ESC_USER_RAM_BYTE19_RMII_SHIFT)
3824 
3825 /*
3826  * URGP (RW)
3827  *
3828  * Use RGMII GTX_CLK phase shifted clock input
3829  */
3830 #define ESC_USER_RAM_BYTE19_URGP_MASK (0x10U)
3831 #define ESC_USER_RAM_BYTE19_URGP_SHIFT (4U)
3832 #define ESC_USER_RAM_BYTE19_URGP_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_URGP_SHIFT) & ESC_USER_RAM_BYTE19_URGP_MASK)
3833 #define ESC_USER_RAM_BYTE19_URGP_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_URGP_MASK) >> ESC_USER_RAM_BYTE19_URGP_SHIFT)
3834 
3835 /*
3836  * CIA (RW)
3837  *
3838  * CLK_PDI_EXT is asynchronous
3839  */
3840 #define ESC_USER_RAM_BYTE19_CIA_MASK (0x4U)
3841 #define ESC_USER_RAM_BYTE19_CIA_SHIFT (2U)
3842 #define ESC_USER_RAM_BYTE19_CIA_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_CIA_SHIFT) & ESC_USER_RAM_BYTE19_CIA_MASK)
3843 #define ESC_USER_RAM_BYTE19_CIA_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_CIA_MASK) >> ESC_USER_RAM_BYTE19_CIA_SHIFT)
3844 
3845 /*
3846  * IPARO (RW)
3847  *
3848  * Individual PHY address read out (0x0510[7:3])
3849  */
3850 #define ESC_USER_RAM_BYTE19_IPARO_MASK (0x2U)
3851 #define ESC_USER_RAM_BYTE19_IPARO_SHIFT (1U)
3852 #define ESC_USER_RAM_BYTE19_IPARO_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_IPARO_SHIFT) & ESC_USER_RAM_BYTE19_IPARO_MASK)
3853 #define ESC_USER_RAM_BYTE19_IPARO_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_IPARO_MASK) >> ESC_USER_RAM_BYTE19_IPARO_SHIFT)
3854 
3855 /*
3856  * RGMII (RW)
3857  *
3858  * RGMII
3859  */
3860 #define ESC_USER_RAM_BYTE19_RGMII_MASK (0x1U)
3861 #define ESC_USER_RAM_BYTE19_RGMII_SHIFT (0U)
3862 #define ESC_USER_RAM_BYTE19_RGMII_SET(x) (((uint8_t)(x) << ESC_USER_RAM_BYTE19_RGMII_SHIFT) & ESC_USER_RAM_BYTE19_RGMII_MASK)
3863 #define ESC_USER_RAM_BYTE19_RGMII_GET(x) (((uint8_t)(x) & ESC_USER_RAM_BYTE19_RGMII_MASK) >> ESC_USER_RAM_BYTE19_RGMII_SHIFT)
3864 
3865 /* Bitfield definition for register: PDRAM */
3866 /*
3867  * DATA (RW)
3868  *
3869  * Input Data
3870  */
3871 #define ESC_PDRAM_DATA_MASK (0xFFFFFFFFUL)
3872 #define ESC_PDRAM_DATA_SHIFT (0U)
3873 #define ESC_PDRAM_DATA_SET(x) (((uint32_t)(x) << ESC_PDRAM_DATA_SHIFT) & ESC_PDRAM_DATA_MASK)
3874 #define ESC_PDRAM_DATA_GET(x) (((uint32_t)(x) & ESC_PDRAM_DATA_MASK) >> ESC_PDRAM_DATA_SHIFT)
3875 
3876 /* Bitfield definition for register: PDRAM_ALS */
3877 /*
3878  * DATA (RW)
3879  *
3880  */
3881 #define ESC_PDRAM_ALS_DATA_MASK (0xFFFFFFFFUL)
3882 #define ESC_PDRAM_ALS_DATA_SHIFT (0U)
3883 #define ESC_PDRAM_ALS_DATA_SET(x) (((uint32_t)(x) << ESC_PDRAM_ALS_DATA_SHIFT) & ESC_PDRAM_ALS_DATA_MASK)
3884 #define ESC_PDRAM_ALS_DATA_GET(x) (((uint32_t)(x) & ESC_PDRAM_ALS_DATA_MASK) >> ESC_PDRAM_ALS_DATA_SHIFT)
3885 
3886 /* Bitfield definition for register: GPR_CFG0 */
3887 /*
3888  * CLK100_EN (RW)
3889  *
3890  */
3891 #define ESC_GPR_CFG0_CLK100_EN_MASK (0x2000U)
3892 #define ESC_GPR_CFG0_CLK100_EN_SHIFT (13U)
3893 #define ESC_GPR_CFG0_CLK100_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG0_CLK100_EN_SHIFT) & ESC_GPR_CFG0_CLK100_EN_MASK)
3894 #define ESC_GPR_CFG0_CLK100_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG0_CLK100_EN_MASK) >> ESC_GPR_CFG0_CLK100_EN_SHIFT)
3895 
3896 /*
3897  * EEPROM_EMU (RW)
3898  *
3899  * 1 is EEPROM emulation mode (default)
3900  */
3901 #define ESC_GPR_CFG0_EEPROM_EMU_MASK (0x1000U)
3902 #define ESC_GPR_CFG0_EEPROM_EMU_SHIFT (12U)
3903 #define ESC_GPR_CFG0_EEPROM_EMU_SET(x) (((uint32_t)(x) << ESC_GPR_CFG0_EEPROM_EMU_SHIFT) & ESC_GPR_CFG0_EEPROM_EMU_MASK)
3904 #define ESC_GPR_CFG0_EEPROM_EMU_GET(x) (((uint32_t)(x) & ESC_GPR_CFG0_EEPROM_EMU_MASK) >> ESC_GPR_CFG0_EEPROM_EMU_SHIFT)
3905 
3906 /*
3907  * I2C_SCLK_EN (RW)
3908  *
3909  */
3910 #define ESC_GPR_CFG0_I2C_SCLK_EN_MASK (0x8U)
3911 #define ESC_GPR_CFG0_I2C_SCLK_EN_SHIFT (3U)
3912 #define ESC_GPR_CFG0_I2C_SCLK_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG0_I2C_SCLK_EN_SHIFT) & ESC_GPR_CFG0_I2C_SCLK_EN_MASK)
3913 #define ESC_GPR_CFG0_I2C_SCLK_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG0_I2C_SCLK_EN_MASK) >> ESC_GPR_CFG0_I2C_SCLK_EN_SHIFT)
3914 
3915 /*
3916  * PROM_SIZE (RW)
3917  *
3918  * Sets EEPROM size:
3919  * 0:up to 16 kbit EEPROM
3920  * 1:32 kbit-4Mbit EEPROM
3921  */
3922 #define ESC_GPR_CFG0_PROM_SIZE_MASK (0x1U)
3923 #define ESC_GPR_CFG0_PROM_SIZE_SHIFT (0U)
3924 #define ESC_GPR_CFG0_PROM_SIZE_SET(x) (((uint32_t)(x) << ESC_GPR_CFG0_PROM_SIZE_SHIFT) & ESC_GPR_CFG0_PROM_SIZE_MASK)
3925 #define ESC_GPR_CFG0_PROM_SIZE_GET(x) (((uint32_t)(x) & ESC_GPR_CFG0_PROM_SIZE_MASK) >> ESC_GPR_CFG0_PROM_SIZE_SHIFT)
3926 
3927 /* Bitfield definition for register: GPR_CFG1 */
3928 /*
3929  * SYNC1_IRQ_EN (RW)
3930  *
3931  */
3932 #define ESC_GPR_CFG1_SYNC1_IRQ_EN_MASK (0x80000000UL)
3933 #define ESC_GPR_CFG1_SYNC1_IRQ_EN_SHIFT (31U)
3934 #define ESC_GPR_CFG1_SYNC1_IRQ_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_SYNC1_IRQ_EN_SHIFT) & ESC_GPR_CFG1_SYNC1_IRQ_EN_MASK)
3935 #define ESC_GPR_CFG1_SYNC1_IRQ_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_SYNC1_IRQ_EN_MASK) >> ESC_GPR_CFG1_SYNC1_IRQ_EN_SHIFT)
3936 
3937 /*
3938  * SYNC0_IRQ_EN (RW)
3939  *
3940  */
3941 #define ESC_GPR_CFG1_SYNC0_IRQ_EN_MASK (0x40000000UL)
3942 #define ESC_GPR_CFG1_SYNC0_IRQ_EN_SHIFT (30U)
3943 #define ESC_GPR_CFG1_SYNC0_IRQ_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_SYNC0_IRQ_EN_SHIFT) & ESC_GPR_CFG1_SYNC0_IRQ_EN_MASK)
3944 #define ESC_GPR_CFG1_SYNC0_IRQ_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_SYNC0_IRQ_EN_MASK) >> ESC_GPR_CFG1_SYNC0_IRQ_EN_SHIFT)
3945 
3946 /*
3947  * RSTO_IRQ_EN (RW)
3948  *
3949  */
3950 #define ESC_GPR_CFG1_RSTO_IRQ_EN_MASK (0x20000000UL)
3951 #define ESC_GPR_CFG1_RSTO_IRQ_EN_SHIFT (29U)
3952 #define ESC_GPR_CFG1_RSTO_IRQ_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_RSTO_IRQ_EN_SHIFT) & ESC_GPR_CFG1_RSTO_IRQ_EN_MASK)
3953 #define ESC_GPR_CFG1_RSTO_IRQ_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_RSTO_IRQ_EN_MASK) >> ESC_GPR_CFG1_RSTO_IRQ_EN_SHIFT)
3954 
3955 /*
3956  * SYNC1_DMA_EN (RW)
3957  *
3958  */
3959 #define ESC_GPR_CFG1_SYNC1_DMA_EN_MASK (0x2000U)
3960 #define ESC_GPR_CFG1_SYNC1_DMA_EN_SHIFT (13U)
3961 #define ESC_GPR_CFG1_SYNC1_DMA_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_SYNC1_DMA_EN_SHIFT) & ESC_GPR_CFG1_SYNC1_DMA_EN_MASK)
3962 #define ESC_GPR_CFG1_SYNC1_DMA_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_SYNC1_DMA_EN_MASK) >> ESC_GPR_CFG1_SYNC1_DMA_EN_SHIFT)
3963 
3964 /*
3965  * SYNC0_DMA_EN (RW)
3966  *
3967  */
3968 #define ESC_GPR_CFG1_SYNC0_DMA_EN_MASK (0x1000U)
3969 #define ESC_GPR_CFG1_SYNC0_DMA_EN_SHIFT (12U)
3970 #define ESC_GPR_CFG1_SYNC0_DMA_EN_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_SYNC0_DMA_EN_SHIFT) & ESC_GPR_CFG1_SYNC0_DMA_EN_MASK)
3971 #define ESC_GPR_CFG1_SYNC0_DMA_EN_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_SYNC0_DMA_EN_MASK) >> ESC_GPR_CFG1_SYNC0_DMA_EN_SHIFT)
3972 
3973 /*
3974  * LATCH1_FROM_IO (RW)
3975  *
3976  * 0:from NTM
3977  */
3978 #define ESC_GPR_CFG1_LATCH1_FROM_IO_MASK (0x200U)
3979 #define ESC_GPR_CFG1_LATCH1_FROM_IO_SHIFT (9U)
3980 #define ESC_GPR_CFG1_LATCH1_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_LATCH1_FROM_IO_SHIFT) & ESC_GPR_CFG1_LATCH1_FROM_IO_MASK)
3981 #define ESC_GPR_CFG1_LATCH1_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_LATCH1_FROM_IO_MASK) >> ESC_GPR_CFG1_LATCH1_FROM_IO_SHIFT)
3982 
3983 /*
3984  * LATCH0_FROM_IO (RW)
3985  *
3986  * 0:from TRIGGER_MUX
3987  */
3988 #define ESC_GPR_CFG1_LATCH0_FROM_IO_MASK (0x100U)
3989 #define ESC_GPR_CFG1_LATCH0_FROM_IO_SHIFT (8U)
3990 #define ESC_GPR_CFG1_LATCH0_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_LATCH0_FROM_IO_SHIFT) & ESC_GPR_CFG1_LATCH0_FROM_IO_MASK)
3991 #define ESC_GPR_CFG1_LATCH0_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_LATCH0_FROM_IO_MASK) >> ESC_GPR_CFG1_LATCH0_FROM_IO_SHIFT)
3992 
3993 /*
3994  * RSTO_OVRD (RW)
3995  *
3996  */
3997 #define ESC_GPR_CFG1_RSTO_OVRD_MASK (0x80U)
3998 #define ESC_GPR_CFG1_RSTO_OVRD_SHIFT (7U)
3999 #define ESC_GPR_CFG1_RSTO_OVRD_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_RSTO_OVRD_SHIFT) & ESC_GPR_CFG1_RSTO_OVRD_MASK)
4000 #define ESC_GPR_CFG1_RSTO_OVRD_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_RSTO_OVRD_MASK) >> ESC_GPR_CFG1_RSTO_OVRD_SHIFT)
4001 
4002 /*
4003  * RSTO_OVRD_ENJ (RW)
4004  *
4005  */
4006 #define ESC_GPR_CFG1_RSTO_OVRD_ENJ_MASK (0x40U)
4007 #define ESC_GPR_CFG1_RSTO_OVRD_ENJ_SHIFT (6U)
4008 #define ESC_GPR_CFG1_RSTO_OVRD_ENJ_SET(x) (((uint32_t)(x) << ESC_GPR_CFG1_RSTO_OVRD_ENJ_SHIFT) & ESC_GPR_CFG1_RSTO_OVRD_ENJ_MASK)
4009 #define ESC_GPR_CFG1_RSTO_OVRD_ENJ_GET(x) (((uint32_t)(x) & ESC_GPR_CFG1_RSTO_OVRD_ENJ_MASK) >> ESC_GPR_CFG1_RSTO_OVRD_ENJ_SHIFT)
4010 
4011 /* Bitfield definition for register: GPR_CFG2 */
4012 /*
4013  * NMII_LINK2_FROM_IO (RW)
4014  *
4015  */
4016 #define ESC_GPR_CFG2_NMII_LINK2_FROM_IO_MASK (0x20000000UL)
4017 #define ESC_GPR_CFG2_NMII_LINK2_FROM_IO_SHIFT (29U)
4018 #define ESC_GPR_CFG2_NMII_LINK2_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK2_FROM_IO_SHIFT) & ESC_GPR_CFG2_NMII_LINK2_FROM_IO_MASK)
4019 #define ESC_GPR_CFG2_NMII_LINK2_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK2_FROM_IO_MASK) >> ESC_GPR_CFG2_NMII_LINK2_FROM_IO_SHIFT)
4020 
4021 /*
4022  * NMII_LINK2_GPR (RW)
4023  *
4024  */
4025 #define ESC_GPR_CFG2_NMII_LINK2_GPR_MASK (0x10000000UL)
4026 #define ESC_GPR_CFG2_NMII_LINK2_GPR_SHIFT (28U)
4027 #define ESC_GPR_CFG2_NMII_LINK2_GPR_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK2_GPR_SHIFT) & ESC_GPR_CFG2_NMII_LINK2_GPR_MASK)
4028 #define ESC_GPR_CFG2_NMII_LINK2_GPR_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK2_GPR_MASK) >> ESC_GPR_CFG2_NMII_LINK2_GPR_SHIFT)
4029 
4030 /*
4031  * NMII_LINK1_FROM_IO (RW)
4032  *
4033  */
4034 #define ESC_GPR_CFG2_NMII_LINK1_FROM_IO_MASK (0x2000000UL)
4035 #define ESC_GPR_CFG2_NMII_LINK1_FROM_IO_SHIFT (25U)
4036 #define ESC_GPR_CFG2_NMII_LINK1_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK1_FROM_IO_SHIFT) & ESC_GPR_CFG2_NMII_LINK1_FROM_IO_MASK)
4037 #define ESC_GPR_CFG2_NMII_LINK1_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK1_FROM_IO_MASK) >> ESC_GPR_CFG2_NMII_LINK1_FROM_IO_SHIFT)
4038 
4039 /*
4040  * NMII_LINK1_GPR (RW)
4041  *
4042  */
4043 #define ESC_GPR_CFG2_NMII_LINK1_GPR_MASK (0x1000000UL)
4044 #define ESC_GPR_CFG2_NMII_LINK1_GPR_SHIFT (24U)
4045 #define ESC_GPR_CFG2_NMII_LINK1_GPR_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK1_GPR_SHIFT) & ESC_GPR_CFG2_NMII_LINK1_GPR_MASK)
4046 #define ESC_GPR_CFG2_NMII_LINK1_GPR_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK1_GPR_MASK) >> ESC_GPR_CFG2_NMII_LINK1_GPR_SHIFT)
4047 
4048 /*
4049  * NMII_LINK0_FROM_IO (RW)
4050  *
4051  */
4052 #define ESC_GPR_CFG2_NMII_LINK0_FROM_IO_MASK (0x200000UL)
4053 #define ESC_GPR_CFG2_NMII_LINK0_FROM_IO_SHIFT (21U)
4054 #define ESC_GPR_CFG2_NMII_LINK0_FROM_IO_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK0_FROM_IO_SHIFT) & ESC_GPR_CFG2_NMII_LINK0_FROM_IO_MASK)
4055 #define ESC_GPR_CFG2_NMII_LINK0_FROM_IO_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK0_FROM_IO_MASK) >> ESC_GPR_CFG2_NMII_LINK0_FROM_IO_SHIFT)
4056 
4057 /*
4058  * NMII_LINK0_GPR (RW)
4059  *
4060  */
4061 #define ESC_GPR_CFG2_NMII_LINK0_GPR_MASK (0x100000UL)
4062 #define ESC_GPR_CFG2_NMII_LINK0_GPR_SHIFT (20U)
4063 #define ESC_GPR_CFG2_NMII_LINK0_GPR_SET(x) (((uint32_t)(x) << ESC_GPR_CFG2_NMII_LINK0_GPR_SHIFT) & ESC_GPR_CFG2_NMII_LINK0_GPR_MASK)
4064 #define ESC_GPR_CFG2_NMII_LINK0_GPR_GET(x) (((uint32_t)(x) & ESC_GPR_CFG2_NMII_LINK0_GPR_MASK) >> ESC_GPR_CFG2_NMII_LINK0_GPR_SHIFT)
4065 
4066 /* Bitfield definition for register: PHY_CFG0 */
4067 /*
4068  * MAC_SPEED (RW)
4069  *
4070  * 1:100M
4071  */
4072 #define ESC_PHY_CFG0_MAC_SPEED_MASK (0x40000000UL)
4073 #define ESC_PHY_CFG0_MAC_SPEED_SHIFT (30U)
4074 #define ESC_PHY_CFG0_MAC_SPEED_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_MAC_SPEED_SHIFT) & ESC_PHY_CFG0_MAC_SPEED_MASK)
4075 #define ESC_PHY_CFG0_MAC_SPEED_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_MAC_SPEED_MASK) >> ESC_PHY_CFG0_MAC_SPEED_SHIFT)
4076 
4077 /*
4078  * PHY_OFFSET_VAL (RW)
4079  *
4080  */
4081 #define ESC_PHY_CFG0_PHY_OFFSET_VAL_MASK (0x1F000000UL)
4082 #define ESC_PHY_CFG0_PHY_OFFSET_VAL_SHIFT (24U)
4083 #define ESC_PHY_CFG0_PHY_OFFSET_VAL_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_PHY_OFFSET_VAL_SHIFT) & ESC_PHY_CFG0_PHY_OFFSET_VAL_MASK)
4084 #define ESC_PHY_CFG0_PHY_OFFSET_VAL_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_PHY_OFFSET_VAL_MASK) >> ESC_PHY_CFG0_PHY_OFFSET_VAL_SHIFT)
4085 
4086 /*
4087  * PORT2_RMII_EN (RW)
4088  *
4089  */
4090 #define ESC_PHY_CFG0_PORT2_RMII_EN_MASK (0x800000UL)
4091 #define ESC_PHY_CFG0_PORT2_RMII_EN_SHIFT (23U)
4092 #define ESC_PHY_CFG0_PORT2_RMII_EN_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_PORT2_RMII_EN_SHIFT) & ESC_PHY_CFG0_PORT2_RMII_EN_MASK)
4093 #define ESC_PHY_CFG0_PORT2_RMII_EN_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_PORT2_RMII_EN_MASK) >> ESC_PHY_CFG0_PORT2_RMII_EN_SHIFT)
4094 
4095 /*
4096  * PORT1_RMII_EN (RW)
4097  *
4098  */
4099 #define ESC_PHY_CFG0_PORT1_RMII_EN_MASK (0x8000U)
4100 #define ESC_PHY_CFG0_PORT1_RMII_EN_SHIFT (15U)
4101 #define ESC_PHY_CFG0_PORT1_RMII_EN_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_PORT1_RMII_EN_SHIFT) & ESC_PHY_CFG0_PORT1_RMII_EN_MASK)
4102 #define ESC_PHY_CFG0_PORT1_RMII_EN_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_PORT1_RMII_EN_MASK) >> ESC_PHY_CFG0_PORT1_RMII_EN_SHIFT)
4103 
4104 /*
4105  * PORT0_RMII_EN (RW)
4106  *
4107  */
4108 #define ESC_PHY_CFG0_PORT0_RMII_EN_MASK (0x80U)
4109 #define ESC_PHY_CFG0_PORT0_RMII_EN_SHIFT (7U)
4110 #define ESC_PHY_CFG0_PORT0_RMII_EN_SET(x) (((uint32_t)(x) << ESC_PHY_CFG0_PORT0_RMII_EN_SHIFT) & ESC_PHY_CFG0_PORT0_RMII_EN_MASK)
4111 #define ESC_PHY_CFG0_PORT0_RMII_EN_GET(x) (((uint32_t)(x) & ESC_PHY_CFG0_PORT0_RMII_EN_MASK) >> ESC_PHY_CFG0_PORT0_RMII_EN_SHIFT)
4112 
4113 /* Bitfield definition for register: PHY_CFG1 */
4114 /*
4115  * RMII_REFCLK_SEL (RW)
4116  *
4117  * 0:use RXCK as 50M refclk. 1:use TXCK as 50M refclk
4118  */
4119 #define ESC_PHY_CFG1_RMII_REFCLK_SEL_MASK (0x700U)
4120 #define ESC_PHY_CFG1_RMII_REFCLK_SEL_SHIFT (8U)
4121 #define ESC_PHY_CFG1_RMII_REFCLK_SEL_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_REFCLK_SEL_SHIFT) & ESC_PHY_CFG1_RMII_REFCLK_SEL_MASK)
4122 #define ESC_PHY_CFG1_RMII_REFCLK_SEL_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_REFCLK_SEL_MASK) >> ESC_PHY_CFG1_RMII_REFCLK_SEL_SHIFT)
4123 
4124 /*
4125  * REFCK_25M_INV (RW)
4126  *
4127  */
4128 #define ESC_PHY_CFG1_REFCK_25M_INV_MASK (0x80U)
4129 #define ESC_PHY_CFG1_REFCK_25M_INV_SHIFT (7U)
4130 #define ESC_PHY_CFG1_REFCK_25M_INV_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_REFCK_25M_INV_SHIFT) & ESC_PHY_CFG1_REFCK_25M_INV_MASK)
4131 #define ESC_PHY_CFG1_REFCK_25M_INV_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_REFCK_25M_INV_MASK) >> ESC_PHY_CFG1_REFCK_25M_INV_SHIFT)
4132 
4133 /*
4134  * RMII_P2_RXCK_REFCLK_OE (RW)
4135  *
4136  */
4137 #define ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_MASK (0x40U)
4138 #define ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_SHIFT (6U)
4139 #define ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_MASK)
4140 #define ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P2_RXCK_REFCLK_OE_SHIFT)
4141 
4142 /*
4143  * RMII_P1_RXCK_REFCLK_OE (RW)
4144  *
4145  */
4146 #define ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_MASK (0x20U)
4147 #define ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_SHIFT (5U)
4148 #define ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_MASK)
4149 #define ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P1_RXCK_REFCLK_OE_SHIFT)
4150 
4151 /*
4152  * RMII_P0_RXCK_REFCLK_OE (RW)
4153  *
4154  */
4155 #define ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_MASK (0x10U)
4156 #define ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_SHIFT (4U)
4157 #define ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_MASK)
4158 #define ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P0_RXCK_REFCLK_OE_SHIFT)
4159 
4160 /*
4161  * REFCK_25M_OE (RW)
4162  *
4163  */
4164 #define ESC_PHY_CFG1_REFCK_25M_OE_MASK (0x8U)
4165 #define ESC_PHY_CFG1_REFCK_25M_OE_SHIFT (3U)
4166 #define ESC_PHY_CFG1_REFCK_25M_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_REFCK_25M_OE_SHIFT) & ESC_PHY_CFG1_REFCK_25M_OE_MASK)
4167 #define ESC_PHY_CFG1_REFCK_25M_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_REFCK_25M_OE_MASK) >> ESC_PHY_CFG1_REFCK_25M_OE_SHIFT)
4168 
4169 /*
4170  * RMII_P2_TXCK_REFCLK_OE (RW)
4171  *
4172  */
4173 #define ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_MASK (0x4U)
4174 #define ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_SHIFT (2U)
4175 #define ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_MASK)
4176 #define ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P2_TXCK_REFCLK_OE_SHIFT)
4177 
4178 /*
4179  * RMII_P1_TXCK_REFCLK_OE (RW)
4180  *
4181  */
4182 #define ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_MASK (0x2U)
4183 #define ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_SHIFT (1U)
4184 #define ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_MASK)
4185 #define ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P1_TXCK_REFCLK_OE_SHIFT)
4186 
4187 /*
4188  * RMII_P0_TXCK_REFCLK_OE (RW)
4189  *
4190  */
4191 #define ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_MASK (0x1U)
4192 #define ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_SHIFT (0U)
4193 #define ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_SET(x) (((uint32_t)(x) << ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_SHIFT) & ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_MASK)
4194 #define ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_GET(x) (((uint32_t)(x) & ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_MASK) >> ESC_PHY_CFG1_RMII_P0_TXCK_REFCLK_OE_SHIFT)
4195 
4196 /* Bitfield definition for register: GPIO_CTRL */
4197 /*
4198  * SW_LATCH_GPI (WO)
4199  *
4200  * if gpi_trig_sel is set to 4'b1001, setting this bit will latch GPI to gpi_reg0/1
4201  */
4202 #define ESC_GPIO_CTRL_SW_LATCH_GPI_MASK (0x80000000UL)
4203 #define ESC_GPIO_CTRL_SW_LATCH_GPI_SHIFT (31U)
4204 #define ESC_GPIO_CTRL_SW_LATCH_GPI_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_SW_LATCH_GPI_SHIFT) & ESC_GPIO_CTRL_SW_LATCH_GPI_MASK)
4205 #define ESC_GPIO_CTRL_SW_LATCH_GPI_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_SW_LATCH_GPI_MASK) >> ESC_GPIO_CTRL_SW_LATCH_GPI_SHIFT)
4206 
4207 /*
4208  * SW_LATCH_GPO (WO)
4209  *
4210  * if gpo_trig_sel is set to 4'b1001, setting this bit will latch GPO to gpo_reg0/1
4211  */
4212 #define ESC_GPIO_CTRL_SW_LATCH_GPO_MASK (0x40000000UL)
4213 #define ESC_GPIO_CTRL_SW_LATCH_GPO_SHIFT (30U)
4214 #define ESC_GPIO_CTRL_SW_LATCH_GPO_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_SW_LATCH_GPO_SHIFT) & ESC_GPIO_CTRL_SW_LATCH_GPO_MASK)
4215 #define ESC_GPIO_CTRL_SW_LATCH_GPO_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_SW_LATCH_GPO_MASK) >> ESC_GPIO_CTRL_SW_LATCH_GPO_SHIFT)
4216 
4217 /*
4218  * GPI_OVERRIDE_EN (RW)
4219  *
4220  * set this bit will use GPI from the software register gpi_override0/1
4221  * clr to use GPI from pad directly
4222  */
4223 #define ESC_GPIO_CTRL_GPI_OVERRIDE_EN_MASK (0x2000U)
4224 #define ESC_GPIO_CTRL_GPI_OVERRIDE_EN_SHIFT (13U)
4225 #define ESC_GPIO_CTRL_GPI_OVERRIDE_EN_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPI_OVERRIDE_EN_SHIFT) & ESC_GPIO_CTRL_GPI_OVERRIDE_EN_MASK)
4226 #define ESC_GPIO_CTRL_GPI_OVERRIDE_EN_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPI_OVERRIDE_EN_MASK) >> ESC_GPIO_CTRL_GPI_OVERRIDE_EN_SHIFT)
4227 
4228 /*
4229  * GPI_TRIG_EN (RW)
4230  *
4231  * use gpi_trig_sel can select the trigger event to latch GPI signal(from reg or pad)
4232  * set to use triggered signal;
4233  * clr to use signals direclty(from reg or pad)
4234  * assign pdi_gpi = gpi_trig_en ? gpi_reg :
4235  * (gpi_override_en ? gpi_override :pad_di_ecat_gpi);
4236  */
4237 #define ESC_GPIO_CTRL_GPI_TRIG_EN_MASK (0x1000U)
4238 #define ESC_GPIO_CTRL_GPI_TRIG_EN_SHIFT (12U)
4239 #define ESC_GPIO_CTRL_GPI_TRIG_EN_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPI_TRIG_EN_SHIFT) & ESC_GPIO_CTRL_GPI_TRIG_EN_MASK)
4240 #define ESC_GPIO_CTRL_GPI_TRIG_EN_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPI_TRIG_EN_MASK) >> ESC_GPIO_CTRL_GPI_TRIG_EN_SHIFT)
4241 
4242 /*
4243  * GPI_TRIG_SEL (RW)
4244  *
4245  * select the trigger signal to latch GPI.
4246  * 0000: SOF; 0001: EOF; 0010: pos of SYNC0; 0011: pos of SYNC1;
4247  * 0100: pos of LATCH0; 0101: pos of LATCH1; 0110: neg of LATCH0; 0111: neg of LATCH1
4248  * 1000: wdog trigger; 1001: sw set gpio_ctrl[31];
4249  * others no trigger
4250  */
4251 #define ESC_GPIO_CTRL_GPI_TRIG_SEL_MASK (0xF00U)
4252 #define ESC_GPIO_CTRL_GPI_TRIG_SEL_SHIFT (8U)
4253 #define ESC_GPIO_CTRL_GPI_TRIG_SEL_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPI_TRIG_SEL_SHIFT) & ESC_GPIO_CTRL_GPI_TRIG_SEL_MASK)
4254 #define ESC_GPIO_CTRL_GPI_TRIG_SEL_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPI_TRIG_SEL_MASK) >> ESC_GPIO_CTRL_GPI_TRIG_SEL_SHIFT)
4255 
4256 /*
4257  * GPO_TRIG_EN (RW)
4258  *
4259  * use gpo_trig_sel can select the trigger event to latch GPO signal(from core)
4260  * set to use triggered signal;
4261  * clr to use GPO signals direclty(from reg or pad)
4262  */
4263 #define ESC_GPIO_CTRL_GPO_TRIG_EN_MASK (0x10U)
4264 #define ESC_GPIO_CTRL_GPO_TRIG_EN_SHIFT (4U)
4265 #define ESC_GPIO_CTRL_GPO_TRIG_EN_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPO_TRIG_EN_SHIFT) & ESC_GPIO_CTRL_GPO_TRIG_EN_MASK)
4266 #define ESC_GPIO_CTRL_GPO_TRIG_EN_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPO_TRIG_EN_MASK) >> ESC_GPIO_CTRL_GPO_TRIG_EN_SHIFT)
4267 
4268 /*
4269  * GPO_TRIG_SEL (RW)
4270  *
4271  * select the trigger signal to latch GPO.
4272  * 0000: SOF; 0001: EOF; 0010: pos of SYNC0; 0011: pos of SYNC1;
4273  * 0100: pos of LATCH0; 0101: pos of LATCH1; 0110: neg of LATCH0; 0111: neg of LATCH1
4274  * 1000: wdog trigger; 1001: sw set gpio_ctrl[30];
4275  * others no trigger
4276  */
4277 #define ESC_GPIO_CTRL_GPO_TRIG_SEL_MASK (0xFU)
4278 #define ESC_GPIO_CTRL_GPO_TRIG_SEL_SHIFT (0U)
4279 #define ESC_GPIO_CTRL_GPO_TRIG_SEL_SET(x) (((uint32_t)(x) << ESC_GPIO_CTRL_GPO_TRIG_SEL_SHIFT) & ESC_GPIO_CTRL_GPO_TRIG_SEL_MASK)
4280 #define ESC_GPIO_CTRL_GPO_TRIG_SEL_GET(x) (((uint32_t)(x) & ESC_GPIO_CTRL_GPO_TRIG_SEL_MASK) >> ESC_GPIO_CTRL_GPO_TRIG_SEL_SHIFT)
4281 
4282 /* Bitfield definition for register: GPI_OVERRIDE0 */
4283 /*
4284  * GPR_OVERRIDE_LOW (RW)
4285  *
4286  */
4287 #define ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_MASK (0xFFFFFFFFUL)
4288 #define ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_SHIFT (0U)
4289 #define ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_SET(x) (((uint32_t)(x) << ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_SHIFT) & ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_MASK)
4290 #define ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_GET(x) (((uint32_t)(x) & ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_MASK) >> ESC_GPI_OVERRIDE0_GPR_OVERRIDE_LOW_SHIFT)
4291 
4292 /* Bitfield definition for register: GPI_OVERRIDE1 */
4293 /*
4294  * GPR_OVERRIDE_HIGH (RW)
4295  *
4296  */
4297 #define ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_MASK (0xFFFFFFFFUL)
4298 #define ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_SHIFT (0U)
4299 #define ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_SET(x) (((uint32_t)(x) << ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_SHIFT) & ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_MASK)
4300 #define ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_GET(x) (((uint32_t)(x) & ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_MASK) >> ESC_GPI_OVERRIDE1_GPR_OVERRIDE_HIGH_SHIFT)
4301 
4302 /* Bitfield definition for register: GPO_REG0 */
4303 /*
4304  * VALUE (RO)
4305  *
4306  */
4307 #define ESC_GPO_REG0_VALUE_MASK (0xFFFFFFFFUL)
4308 #define ESC_GPO_REG0_VALUE_SHIFT (0U)
4309 #define ESC_GPO_REG0_VALUE_GET(x) (((uint32_t)(x) & ESC_GPO_REG0_VALUE_MASK) >> ESC_GPO_REG0_VALUE_SHIFT)
4310 
4311 /* Bitfield definition for register: GPO_REG1 */
4312 /*
4313  * VALUE (RO)
4314  *
4315  */
4316 #define ESC_GPO_REG1_VALUE_MASK (0xFFFFFFFFUL)
4317 #define ESC_GPO_REG1_VALUE_SHIFT (0U)
4318 #define ESC_GPO_REG1_VALUE_GET(x) (((uint32_t)(x) & ESC_GPO_REG1_VALUE_MASK) >> ESC_GPO_REG1_VALUE_SHIFT)
4319 
4320 /* Bitfield definition for register: GPI_REG0 */
4321 /*
4322  * VALUE (RO)
4323  *
4324  */
4325 #define ESC_GPI_REG0_VALUE_MASK (0xFFFFFFFFUL)
4326 #define ESC_GPI_REG0_VALUE_SHIFT (0U)
4327 #define ESC_GPI_REG0_VALUE_GET(x) (((uint32_t)(x) & ESC_GPI_REG0_VALUE_MASK) >> ESC_GPI_REG0_VALUE_SHIFT)
4328 
4329 /* Bitfield definition for register: GPI_REG1 */
4330 /*
4331  * VALUE (RO)
4332  *
4333  */
4334 #define ESC_GPI_REG1_VALUE_MASK (0xFFFFFFFFUL)
4335 #define ESC_GPI_REG1_VALUE_SHIFT (0U)
4336 #define ESC_GPI_REG1_VALUE_GET(x) (((uint32_t)(x) & ESC_GPI_REG1_VALUE_MASK) >> ESC_GPI_REG1_VALUE_SHIFT)
4337 
4338 /* Bitfield definition for register: GPR_STATUS */
4339 /*
4340  * NLINK2_PADSEL (RO)
4341  *
4342  */
4343 #define ESC_GPR_STATUS_NLINK2_PADSEL_MASK (0xF0000000UL)
4344 #define ESC_GPR_STATUS_NLINK2_PADSEL_SHIFT (28U)
4345 #define ESC_GPR_STATUS_NLINK2_PADSEL_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_NLINK2_PADSEL_MASK) >> ESC_GPR_STATUS_NLINK2_PADSEL_SHIFT)
4346 
4347 /*
4348  * NLINK1_PADSEL (RO)
4349  *
4350  */
4351 #define ESC_GPR_STATUS_NLINK1_PADSEL_MASK (0xF000000UL)
4352 #define ESC_GPR_STATUS_NLINK1_PADSEL_SHIFT (24U)
4353 #define ESC_GPR_STATUS_NLINK1_PADSEL_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_NLINK1_PADSEL_MASK) >> ESC_GPR_STATUS_NLINK1_PADSEL_SHIFT)
4354 
4355 /*
4356  * NLINK0_PADSEL (RO)
4357  *
4358  */
4359 #define ESC_GPR_STATUS_NLINK0_PADSEL_MASK (0xF00000UL)
4360 #define ESC_GPR_STATUS_NLINK0_PADSEL_SHIFT (20U)
4361 #define ESC_GPR_STATUS_NLINK0_PADSEL_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_NLINK0_PADSEL_MASK) >> ESC_GPR_STATUS_NLINK0_PADSEL_SHIFT)
4362 
4363 /*
4364  * PDI_SOF (RO)
4365  *
4366  */
4367 #define ESC_GPR_STATUS_PDI_SOF_MASK (0x80000UL)
4368 #define ESC_GPR_STATUS_PDI_SOF_SHIFT (19U)
4369 #define ESC_GPR_STATUS_PDI_SOF_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_PDI_SOF_MASK) >> ESC_GPR_STATUS_PDI_SOF_SHIFT)
4370 
4371 /*
4372  * PDI_EOF (RO)
4373  *
4374  */
4375 #define ESC_GPR_STATUS_PDI_EOF_MASK (0x40000UL)
4376 #define ESC_GPR_STATUS_PDI_EOF_SHIFT (18U)
4377 #define ESC_GPR_STATUS_PDI_EOF_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_PDI_EOF_MASK) >> ESC_GPR_STATUS_PDI_EOF_SHIFT)
4378 
4379 /*
4380  * PDI_WD_TRIGGER (RO)
4381  *
4382  */
4383 #define ESC_GPR_STATUS_PDI_WD_TRIGGER_MASK (0x20000UL)
4384 #define ESC_GPR_STATUS_PDI_WD_TRIGGER_SHIFT (17U)
4385 #define ESC_GPR_STATUS_PDI_WD_TRIGGER_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_PDI_WD_TRIGGER_MASK) >> ESC_GPR_STATUS_PDI_WD_TRIGGER_SHIFT)
4386 
4387 /*
4388  * PDI_WD_STATE (RO)
4389  *
4390  */
4391 #define ESC_GPR_STATUS_PDI_WD_STATE_MASK (0x10000UL)
4392 #define ESC_GPR_STATUS_PDI_WD_STATE_SHIFT (16U)
4393 #define ESC_GPR_STATUS_PDI_WD_STATE_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_PDI_WD_STATE_MASK) >> ESC_GPR_STATUS_PDI_WD_STATE_SHIFT)
4394 
4395 /*
4396  * SYNC_OUT1 (RO)
4397  *
4398  */
4399 #define ESC_GPR_STATUS_SYNC_OUT1_MASK (0x200U)
4400 #define ESC_GPR_STATUS_SYNC_OUT1_SHIFT (9U)
4401 #define ESC_GPR_STATUS_SYNC_OUT1_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_SYNC_OUT1_MASK) >> ESC_GPR_STATUS_SYNC_OUT1_SHIFT)
4402 
4403 /*
4404  * SYNC_OUT0 (RO)
4405  *
4406  */
4407 #define ESC_GPR_STATUS_SYNC_OUT0_MASK (0x100U)
4408 #define ESC_GPR_STATUS_SYNC_OUT0_SHIFT (8U)
4409 #define ESC_GPR_STATUS_SYNC_OUT0_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_SYNC_OUT0_MASK) >> ESC_GPR_STATUS_SYNC_OUT0_SHIFT)
4410 
4411 /*
4412  * LED_STATE_RUN (RO)
4413  *
4414  */
4415 #define ESC_GPR_STATUS_LED_STATE_RUN_MASK (0x40U)
4416 #define ESC_GPR_STATUS_LED_STATE_RUN_SHIFT (6U)
4417 #define ESC_GPR_STATUS_LED_STATE_RUN_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_LED_STATE_RUN_MASK) >> ESC_GPR_STATUS_LED_STATE_RUN_SHIFT)
4418 
4419 /*
4420  * LED_ERR (RO)
4421  *
4422  */
4423 #define ESC_GPR_STATUS_LED_ERR_MASK (0x20U)
4424 #define ESC_GPR_STATUS_LED_ERR_SHIFT (5U)
4425 #define ESC_GPR_STATUS_LED_ERR_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_LED_ERR_MASK) >> ESC_GPR_STATUS_LED_ERR_SHIFT)
4426 
4427 /*
4428  * LED_RUN (RO)
4429  *
4430  */
4431 #define ESC_GPR_STATUS_LED_RUN_MASK (0x10U)
4432 #define ESC_GPR_STATUS_LED_RUN_SHIFT (4U)
4433 #define ESC_GPR_STATUS_LED_RUN_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_LED_RUN_MASK) >> ESC_GPR_STATUS_LED_RUN_SHIFT)
4434 
4435 /*
4436  * DEV_STATE (RO)
4437  *
4438  */
4439 #define ESC_GPR_STATUS_DEV_STATE_MASK (0x8U)
4440 #define ESC_GPR_STATUS_DEV_STATE_SHIFT (3U)
4441 #define ESC_GPR_STATUS_DEV_STATE_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_DEV_STATE_MASK) >> ESC_GPR_STATUS_DEV_STATE_SHIFT)
4442 
4443 /*
4444  * LINK_ACT (RO)
4445  *
4446  */
4447 #define ESC_GPR_STATUS_LINK_ACT_MASK (0x7U)
4448 #define ESC_GPR_STATUS_LINK_ACT_SHIFT (0U)
4449 #define ESC_GPR_STATUS_LINK_ACT_GET(x) (((uint32_t)(x) & ESC_GPR_STATUS_LINK_ACT_MASK) >> ESC_GPR_STATUS_LINK_ACT_SHIFT)
4450 
4451 /* Bitfield definition for register array: IO_CFG */
4452 /*
4453  * INVERT (RW)
4454  *
4455  * 1:invert the IO
4456  */
4457 #define ESC_IO_CFG_INVERT_MASK (0x10U)
4458 #define ESC_IO_CFG_INVERT_SHIFT (4U)
4459 #define ESC_IO_CFG_INVERT_SET(x) (((uint32_t)(x) << ESC_IO_CFG_INVERT_SHIFT) & ESC_IO_CFG_INVERT_MASK)
4460 #define ESC_IO_CFG_INVERT_GET(x) (((uint32_t)(x) & ESC_IO_CFG_INVERT_MASK) >> ESC_IO_CFG_INVERT_SHIFT)
4461 
4462 /*
4463  * FUNC_ALT (RW)
4464  *
4465  * IO usage:
4466  * 0:NMII_LINK0
4467  * 1:NMII_LINK1
4468  * 2:NMII_LINK2
4469  * 3:LINK_ACT0
4470  * 4:LINK_ACT1
4471  * 5:LINK_ACT2
4472  * 6:LED_RUN
4473  * 7:LED_ERR
4474  * 8:RESET_OUT
4475  */
4476 #define ESC_IO_CFG_FUNC_ALT_MASK (0xFU)
4477 #define ESC_IO_CFG_FUNC_ALT_SHIFT (0U)
4478 #define ESC_IO_CFG_FUNC_ALT_SET(x) (((uint32_t)(x) << ESC_IO_CFG_FUNC_ALT_SHIFT) & ESC_IO_CFG_FUNC_ALT_MASK)
4479 #define ESC_IO_CFG_FUNC_ALT_GET(x) (((uint32_t)(x) & ESC_IO_CFG_FUNC_ALT_MASK) >> ESC_IO_CFG_FUNC_ALT_SHIFT)
4480 
4481 
4482 
4483 /* RX_ERR_CNT register group index macro definition */
4484 #define ESC_RX_ERR_CNT_PORT0 (0UL)
4485 #define ESC_RX_ERR_CNT_PORT1 (1UL)
4486 #define ESC_RX_ERR_CNT_PORT2 (2UL)
4487 #define ESC_RX_ERR_CNT_PORT3 (3UL)
4488 
4489 /* FWD_RX_ERR_CNT register group index macro definition */
4490 #define ESC_FWD_RX_ERR_CNT_PORT0 (0UL)
4491 #define ESC_FWD_RX_ERR_CNT_PORT1 (1UL)
4492 #define ESC_FWD_RX_ERR_CNT_PORT2 (2UL)
4493 #define ESC_FWD_RX_ERR_CNT_PORT3 (3UL)
4494 
4495 /* LOST_LINK_CNT register group index macro definition */
4496 #define ESC_LOST_LINK_CNT_PORT0 (0UL)
4497 #define ESC_LOST_LINK_CNT_PORT1 (1UL)
4498 #define ESC_LOST_LINK_CNT_PORT2 (2UL)
4499 #define ESC_LOST_LINK_CNT_PORT3 (3UL)
4500 
4501 /* PHY_STAT register group index macro definition */
4502 #define ESC_PHY_STAT_PORT0 (0UL)
4503 #define ESC_PHY_STAT_PORT1 (1UL)
4504 #define ESC_PHY_STAT_PORT2 (2UL)
4505 #define ESC_PHY_STAT_PORT3 (3UL)
4506 
4507 /* FMMU register group index macro definition */
4508 #define ESC_FMMU_0 (0UL)
4509 #define ESC_FMMU_1 (1UL)
4510 #define ESC_FMMU_2 (2UL)
4511 #define ESC_FMMU_3 (3UL)
4512 #define ESC_FMMU_4 (4UL)
4513 #define ESC_FMMU_5 (5UL)
4514 #define ESC_FMMU_6 (6UL)
4515 #define ESC_FMMU_7 (7UL)
4516 
4517 /* SYNCM register group index macro definition */
4518 #define ESC_SYNCM_0 (0UL)
4519 #define ESC_SYNCM_1 (1UL)
4520 #define ESC_SYNCM_2 (2UL)
4521 #define ESC_SYNCM_3 (3UL)
4522 #define ESC_SYNCM_4 (4UL)
4523 #define ESC_SYNCM_5 (5UL)
4524 #define ESC_SYNCM_6 (6UL)
4525 #define ESC_SYNCM_7 (7UL)
4526 
4527 /* RCV_TIME register group index macro definition */
4528 #define ESC_RCV_TIME_PORT0 (0UL)
4529 #define ESC_RCV_TIME_PORT1 (1UL)
4530 #define ESC_RCV_TIME_PORT2 (2UL)
4531 #define ESC_RCV_TIME_PORT3 (3UL)
4532 
4533 /* IO_CFG register group index macro definition */
4534 #define ESC_IO_CFG_CTR0 (0UL)
4535 #define ESC_IO_CFG_CTR1 (1UL)
4536 #define ESC_IO_CFG_CTR2 (2UL)
4537 #define ESC_IO_CFG_CTR3 (3UL)
4538 #define ESC_IO_CFG_CTR4 (4UL)
4539 #define ESC_IO_CFG_CTR5 (5UL)
4540 #define ESC_IO_CFG_CTR6 (6UL)
4541 #define ESC_IO_CFG_CTR7 (7UL)
4542 #define ESC_IO_CFG_CTR8 (8UL)
4543 
4544 
4545 #endif /* HPM_ESC_H */
#define PID
Definition: hpm_ov7725.h:62
Definition: hpm_esc_regs.h:12