| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
enet_17xx_40xx.h
Go to the documentation of this file.
1 /*
2 * @brief LPC17xx/40xx ethernet driver
3 *
4 * @note
5 * Copyright(C) NXP Semiconductors, 2012
6 * All rights reserved.
7 *
8 * @par
9 * Software that is described herein is for illustrative purposes only
10 * which provides customers with programming information regarding the
11 * LPC products. This software is supplied "AS IS" without any warranties of
12 * any kind, and NXP Semiconductors and its licensor disclaim any and
13 * all warranties, express or implied, including all implied warranties of
14 * merchantability, fitness for a particular purpose and non-infringement of
15 * intellectual property rights. NXP Semiconductors assumes no responsibility
16 * or liability for the use of the software, conveys no license or rights under any
17 * patent, copyright, mask work right, or any other intellectual property rights in
18 * or to any products. NXP Semiconductors reserves the right to make changes
19 * in the software without notification. NXP Semiconductors also makes no
20 * representation or warranty that such application will be suitable for the
21 * specified use without further testing or modification.
22 *
23 * @par
24 * Permission to use, copy, modify, and distribute this software and its
25 * documentation is hereby granted, under NXP Semiconductors' and its
26 * licensor's relevant copyrights in the software, without fee, provided that it
27 * is used in conjunction with NXP Semiconductors microcontrollers. This
28 * copyright, permission, and disclaimer notice must appear in all copies of
29 * this code.
30 */
31
32 #ifndef __ENET_17XX_40XX_H_
33 #define __ENET_17XX_40XX_H_
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
60 typedef IP_ENET_002_TXDESC_T ENET_TXDESC_T;
61 typedef IP_ENET_002_TXSTAT_T ENET_TXSTAT_T;
62 typedef IP_ENET_002_RXDESC_T ENET_RXDESC_T;
63 typedef IP_ENET_002_RXSTAT_T ENET_RXSTAT_T;
64 typedef IP_ENET_002_BUFF_STATUS_T ENET_BUFF_STATUS;
65
73 STATIC INLINE void Chip_ENET_Reset(LPC_ENET_T *pENET)
74 {
75 IP_ENET_Reset(pENET);
76 }
77
84 STATIC INLINE void Chip_ENET_SetADDR(LPC_ENET_T *pENET, const uint8_t *macAddr)
85 {
86 IP_ENET_SetADDR(pENET, macAddr);
87 }
88
99 STATIC INLINE void Chip_ENET_SetupMII(LPC_ENET_T *pENET, uint32_t div, uint8_t addr)
100 {
101 IP_ENET_SetupMII(pENET, div, addr);
102 }
103
113 STATIC INLINE void Chip_ENET_StartMIIWrite(LPC_ENET_T *pENET, uint8_t reg, uint16_t data)
114 {
115 IP_ENET_StartMIIWrite(pENET, reg, data);
116 }
117
127 STATIC INLINE void Chip_ENET_StartMIIRead(LPC_ENET_T *pENET, uint8_t reg)
128 {
129 IP_ENET_StartMIIRead(pENET, reg);
130 }
131
137 STATIC INLINE bool Chip_ENET_IsMIIBusy(LPC_ENET_T *pENET)
138 {
139 return IP_ENET_IsMIIBusy(pENET);
140 }
141
147 STATIC INLINE uint16_t Chip_ENET_ReadMIIData(LPC_ENET_T *pENET)
148 {
149 return IP_ENET_ReadMIIData(pENET);
150 }
151
157 STATIC INLINE void Chip_ENET_TXEnable(LPC_ENET_T *pENET)
158 {
159 IP_ENET_TXEnable(pENET);
160 }
161
167 STATIC INLINE void Chip_ENET_TXDisable(LPC_ENET_T *pENET)
168 {
169 IP_ENET_TXDisable(pENET);
170 }
171
177 STATIC INLINE void Chip_ENET_RXEnable(LPC_ENET_T *pENET)
178 {
179 IP_ENET_RXEnable(pENET);
180 }
181
187 STATIC INLINE void Chip_ENET_RXDisable(LPC_ENET_T *pENET)
188 {
189 IP_ENET_RXDisable(pENET);
190 }
191
197 STATIC INLINE void Chip_ENET_ResetTXLogic(LPC_ENET_T *pENET)
198 {
199 IP_ENET_ResetTXLogic(pENET);
200 }
201
207 STATIC INLINE void Chip_ENET_ResetRXLogic(LPC_ENET_T *pENET)
208 {
209 IP_ENET_ResetRXLogic(pENET);
210 }
211
218 STATIC INLINE void Chip_ENET_EnableRXFilter(LPC_ENET_T *pENET, uint32_t mask)
219 {
220 IP_ENET_EnableRXFilter(pENET, mask);
221 }
222
229 STATIC INLINE void Chip_ENET_DisableRXFilter(LPC_ENET_T *pENET, uint32_t mask)
230 {
231 IP_ENET_DisableRXFilter(pENET, mask);
232 }
233
239 STATIC INLINE void Chip_ENET_SetFullDuplex(LPC_ENET_T *pENET)
240 {
241 IP_ENET_SetFullDuplex(pENET);
242 }
243
249 STATIC INLINE void Chip_ENET_SetHalfDuplex(LPC_ENET_T *pENET)
250 {
251 IP_ENET_SetHalfDuplex(pENET);
252 }
253
259 STATIC INLINE void Chip_ENET_Set100Mbps(LPC_ENET_T *pENET)
260 {
261 IP_ENET_Set100Mbps(pENET);
262 }
263
269 STATIC INLINE void Chip_ENET_Set10Mbps(LPC_ENET_T *pENET)
270 {
271 IP_ENET_Set10Mbps(pENET);
272 }
273
282 STATIC INLINE void Chip_ENET_InitTxDescriptors(LPC_ENET_T *pENET, ENET_TXDESC_T *pDescs,
283 ENET_TXSTAT_T *pStatus,
284 uint32_t descNum)
285 {
286 IP_ENET_InitTxDescriptors(pENET, pDescs, pStatus, descNum);
287 }
288
297 STATIC INLINE void Chip_ENET_InitRxDescriptors(LPC_ENET_T *pENET, ENET_RXDESC_T *pDescs,
298 ENET_RXSTAT_T *pStatus,
299 uint32_t descNum)
300 {
301 IP_ENET_InitRxDescriptors(pENET, pDescs, pStatus, descNum);
302 }
303
309 STATIC INLINE uint16_t Chip_ENET_GetTXProduceIndex(LPC_ENET_T *pENET)
310 {
311 return IP_ENET_GetTXProduceIndex(pENET);
312 }
313
319 STATIC INLINE uint16_t Chip_ENET_GetTXConsumeIndex(LPC_ENET_T *pENET)
320 {
321 return IP_ENET_GetTXConsumeIndex(pENET);
322 }
323
329 STATIC INLINE uint16_t Chip_ENET_GetRXProduceIndex(LPC_ENET_T *pENET)
330 {
331 return IP_ENET_GetRXProduceIndex(pENET);
332 }
333
339 STATIC INLINE uint16_t Chip_ENET_GetRXConsumeIndex(LPC_ENET_T *pENET)
340 {
341 return IP_ENET_GetRXConsumeIndex(pENET);
342 }
343
352 STATIC INLINE ENET_BUFF_STATUS Chip_ENET_GetBufferStatus(LPC_ENET_T *pENET, uint16_t produceIndex,
353 uint16_t consumeIndex,
354 uint16_t buffSize)
355 {
356 return IP_ENET_GetBufferStatus(produceIndex, consumeIndex, buffSize);
357 }
358
367 STATIC INLINE uint32_t Chip_ENET_GetFillDescNum(LPC_ENET_T *pENET, uint16_t produceIndex, uint16_t consumeIndex, uint16_t buffSize)
368 {
369 return IP_ENET_GetFillDescNum(produceIndex, consumeIndex, buffSize);
370 }
371
380 STATIC INLINE uint32_t Chip_ENET_GetFreeDescNum(LPC_ENET_T *pENET, uint16_t produceIndex, uint16_t consumeIndex, uint16_t buffSize)
381 {
382 return IP_ENET_GetFreeDescNum(produceIndex, consumeIndex, buffSize);
383 }
384
390 STATIC INLINE bool Chip_ENET_IsTxFull(LPC_ENET_T *pENET)
391 {
392 return IP_ENET_IsTxFull(pENET);
393 }
394
400 STATIC INLINE bool Chip_ENET_IsRxEmpty(LPC_ENET_T *pENET)
401 {
402 return IP_ENET_IsRxEmpty(pENET);
403 }
404
410 STATIC INLINE uint16_t Chip_ENET_IncTXProduceIndex(LPC_ENET_T *pENET)
411 {
412 return IP_ENET_IncTXProduceIndex(pENET);
413 }
414
420 STATIC INLINE uint16_t Chip_ENET_IncRXConsumeIndex(LPC_ENET_T *pENET)
421 {
422 return IP_ENET_IncRXConsumeIndex(pENET);
423 }
424
431 STATIC INLINE void Chip_ENET_EnableInt(LPC_ENET_T *pENET, uint32_t mask)
432 {
433 IP_ENET_EnableInt(pENET, mask);
434 }
435
442 STATIC INLINE void Chip_ENET_DisableInt(LPC_ENET_T *pENET, uint32_t mask)
443 {
444 IP_ENET_DisableInt(pENET, mask);
445 }
446
452 STATIC INLINE uint32_t Chip_ENET_GetIntStatus(LPC_ENET_T *pENET)
453 {
454 return IP_ENET_GetIntStatus(pENET);
455 }
456
463 STATIC INLINE void Chip_ENET_ClearIntStatus(LPC_ENET_T *pENET, uint32_t mask)
464 {
465 IP_ENET_ClearIntStatus(pENET, mask);
466 }
467
476 void Chip_ENET_Init(LPC_ENET_T *pENET);
477
483 void Chip_ENET_DeInit(LPC_ENET_T *pENET);
484
493 uint32_t Chip_ENET_FindMIIDiv(LPC_ENET_T *pENET, uint32_t clockRate);
494
499 #ifdef __cplusplus
500 }
501 #endif
502
503 #endif /* __ENET_17XX_40XX_H_ */