Webserver+3d print
cyclone_tcp/drivers/f28m35x_eth.h@0:8918a71cdbe9, 2017-02-04 (annotated)
- Committer:
- Sergunb
- Date:
- Sat Feb 04 18:15:49 2017 +0000
- Revision:
- 0:8918a71cdbe9
nothing else
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sergunb | 0:8918a71cdbe9 | 1 | /** |
Sergunb | 0:8918a71cdbe9 | 2 | * @file f28m35x_eth.h |
Sergunb | 0:8918a71cdbe9 | 3 | * @brief F28M35x Ethernet MAC controller |
Sergunb | 0:8918a71cdbe9 | 4 | * |
Sergunb | 0:8918a71cdbe9 | 5 | * @section License |
Sergunb | 0:8918a71cdbe9 | 6 | * |
Sergunb | 0:8918a71cdbe9 | 7 | * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved. |
Sergunb | 0:8918a71cdbe9 | 8 | * |
Sergunb | 0:8918a71cdbe9 | 9 | * This file is part of CycloneTCP Open. |
Sergunb | 0:8918a71cdbe9 | 10 | * |
Sergunb | 0:8918a71cdbe9 | 11 | * This program is free software; you can redistribute it and/or |
Sergunb | 0:8918a71cdbe9 | 12 | * modify it under the terms of the GNU General Public License |
Sergunb | 0:8918a71cdbe9 | 13 | * as published by the Free Software Foundation; either version 2 |
Sergunb | 0:8918a71cdbe9 | 14 | * of the License, or (at your option) any later version. |
Sergunb | 0:8918a71cdbe9 | 15 | * |
Sergunb | 0:8918a71cdbe9 | 16 | * This program is distributed in the hope that it will be useful, |
Sergunb | 0:8918a71cdbe9 | 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Sergunb | 0:8918a71cdbe9 | 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Sergunb | 0:8918a71cdbe9 | 19 | * GNU General Public License for more details. |
Sergunb | 0:8918a71cdbe9 | 20 | * |
Sergunb | 0:8918a71cdbe9 | 21 | * You should have received a copy of the GNU General Public License |
Sergunb | 0:8918a71cdbe9 | 22 | * along with this program; if not, write to the Free Software Foundation, |
Sergunb | 0:8918a71cdbe9 | 23 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
Sergunb | 0:8918a71cdbe9 | 24 | * |
Sergunb | 0:8918a71cdbe9 | 25 | * @author Oryx Embedded SARL (www.oryx-embedded.com) |
Sergunb | 0:8918a71cdbe9 | 26 | * @version 1.7.6 |
Sergunb | 0:8918a71cdbe9 | 27 | **/ |
Sergunb | 0:8918a71cdbe9 | 28 | |
Sergunb | 0:8918a71cdbe9 | 29 | #ifndef _F28M35X_ETH_H |
Sergunb | 0:8918a71cdbe9 | 30 | #define _F28M35X_ETH_H |
Sergunb | 0:8918a71cdbe9 | 31 | |
Sergunb | 0:8918a71cdbe9 | 32 | //Dependencies |
Sergunb | 0:8918a71cdbe9 | 33 | #include "core/nic.h" |
Sergunb | 0:8918a71cdbe9 | 34 | |
Sergunb | 0:8918a71cdbe9 | 35 | //Interrupt priority grouping |
Sergunb | 0:8918a71cdbe9 | 36 | #ifndef F28M35X_ETH_IRQ_PRIORITY_GROUPING |
Sergunb | 0:8918a71cdbe9 | 37 | #define F28M35X_ETH_IRQ_PRIORITY_GROUPING 3 |
Sergunb | 0:8918a71cdbe9 | 38 | #elif (F28M35X_ETH_IRQ_PRIORITY_GROUPING < 0) |
Sergunb | 0:8918a71cdbe9 | 39 | #error F28M35X_ETH_IRQ_PRIORITY_GROUPING parameter is not valid |
Sergunb | 0:8918a71cdbe9 | 40 | #endif |
Sergunb | 0:8918a71cdbe9 | 41 | |
Sergunb | 0:8918a71cdbe9 | 42 | //Ethernet interrupt priority |
Sergunb | 0:8918a71cdbe9 | 43 | #ifndef F28M35X_ETH_IRQ_PRIORITY |
Sergunb | 0:8918a71cdbe9 | 44 | #define F28M35X_ETH_IRQ_PRIORITY 192 |
Sergunb | 0:8918a71cdbe9 | 45 | #elif (F28M35X_ETH_IRQ_PRIORITY < 0) |
Sergunb | 0:8918a71cdbe9 | 46 | #error F28M35X_ETH_IRQ_PRIORITY parameter is not valid |
Sergunb | 0:8918a71cdbe9 | 47 | #endif |
Sergunb | 0:8918a71cdbe9 | 48 | |
Sergunb | 0:8918a71cdbe9 | 49 | //F28M35x Ethernet MAC registers |
Sergunb | 0:8918a71cdbe9 | 50 | #define MAC_RIS_R HWREG(ETH_BASE + MAC_O_RIS) |
Sergunb | 0:8918a71cdbe9 | 51 | #define MAC_IACK_R HWREG(ETH_BASE + MAC_O_IACK) |
Sergunb | 0:8918a71cdbe9 | 52 | #define MAC_IM_R HWREG(ETH_BASE + MAC_O_IM) |
Sergunb | 0:8918a71cdbe9 | 53 | #define MAC_RCTL_R HWREG(ETH_BASE + MAC_O_RCTL) |
Sergunb | 0:8918a71cdbe9 | 54 | #define MAC_TCTL_R HWREG(ETH_BASE + MAC_O_TCTL) |
Sergunb | 0:8918a71cdbe9 | 55 | #define MAC_DATA_R HWREG(ETH_BASE + MAC_O_DATA) |
Sergunb | 0:8918a71cdbe9 | 56 | #define MAC_IA0_R HWREG(ETH_BASE + MAC_O_IA0) |
Sergunb | 0:8918a71cdbe9 | 57 | #define MAC_IA1_R HWREG(ETH_BASE + MAC_O_IA1) |
Sergunb | 0:8918a71cdbe9 | 58 | #define MAC_THR_R HWREG(ETH_BASE + MAC_O_THR) |
Sergunb | 0:8918a71cdbe9 | 59 | #define MAC_MCTL_R HWREG(ETH_BASE + MAC_O_MCTL) |
Sergunb | 0:8918a71cdbe9 | 60 | #define MAC_MDV_R HWREG(ETH_BASE + MAC_O_MDV) |
Sergunb | 0:8918a71cdbe9 | 61 | #define MAC_MAR_R HWREG(ETH_BASE + 0x28) |
Sergunb | 0:8918a71cdbe9 | 62 | #define MAC_MTXD_R HWREG(ETH_BASE + MAC_O_MTXD) |
Sergunb | 0:8918a71cdbe9 | 63 | #define MAC_MRXD_R HWREG(ETH_BASE + MAC_O_MRXD) |
Sergunb | 0:8918a71cdbe9 | 64 | #define MAC_NP_R HWREG(ETH_BASE + MAC_O_NP) |
Sergunb | 0:8918a71cdbe9 | 65 | #define MAC_TR_R HWREG(ETH_BASE + MAC_O_TR) |
Sergunb | 0:8918a71cdbe9 | 66 | #define MAC_TS_R HWREG(ETH_BASE + MAC_O_TS) |
Sergunb | 0:8918a71cdbe9 | 67 | |
Sergunb | 0:8918a71cdbe9 | 68 | //F28M35x Ethernet MAC driver |
Sergunb | 0:8918a71cdbe9 | 69 | extern const NicDriver f28m35xEthDriver; |
Sergunb | 0:8918a71cdbe9 | 70 | |
Sergunb | 0:8918a71cdbe9 | 71 | //F28M35x Ethernet MAC related functions |
Sergunb | 0:8918a71cdbe9 | 72 | error_t f28m35xEthInit(NetInterface *interface); |
Sergunb | 0:8918a71cdbe9 | 73 | void f28m35xEthInitGpio(NetInterface *interface); |
Sergunb | 0:8918a71cdbe9 | 74 | |
Sergunb | 0:8918a71cdbe9 | 75 | void f28m35xEthTick(NetInterface *interface); |
Sergunb | 0:8918a71cdbe9 | 76 | |
Sergunb | 0:8918a71cdbe9 | 77 | void f28m35xEthEnableIrq(NetInterface *interface); |
Sergunb | 0:8918a71cdbe9 | 78 | void f28m35xEthDisableIrq(NetInterface *interface); |
Sergunb | 0:8918a71cdbe9 | 79 | void f28m35xEthIrqHandler(void); |
Sergunb | 0:8918a71cdbe9 | 80 | void f28m35xEthEventHandler(NetInterface *interface); |
Sergunb | 0:8918a71cdbe9 | 81 | |
Sergunb | 0:8918a71cdbe9 | 82 | error_t f28m35xEthSendPacket(NetInterface *interface, |
Sergunb | 0:8918a71cdbe9 | 83 | const NetBuffer *buffer, size_t offset); |
Sergunb | 0:8918a71cdbe9 | 84 | |
Sergunb | 0:8918a71cdbe9 | 85 | error_t f28m35xEthReceivePacket(NetInterface *interface); |
Sergunb | 0:8918a71cdbe9 | 86 | |
Sergunb | 0:8918a71cdbe9 | 87 | error_t f28m35xEthSetMulticastFilter(NetInterface *interface); |
Sergunb | 0:8918a71cdbe9 | 88 | error_t f28m35xEthUpdateMacConfig(NetInterface *interface); |
Sergunb | 0:8918a71cdbe9 | 89 | |
Sergunb | 0:8918a71cdbe9 | 90 | void f28m35xEthWritePhyReg(uint8_t phyAddr, uint8_t regAddr, uint16_t data); |
Sergunb | 0:8918a71cdbe9 | 91 | uint16_t f28m35xEthReadPhyReg(uint8_t phyAddr, uint8_t regAddr); |
Sergunb | 0:8918a71cdbe9 | 92 | |
Sergunb | 0:8918a71cdbe9 | 93 | #endif |
Sergunb | 0:8918a71cdbe9 | 94 |