Sergey Pastor / 1

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lm3s_eth.h Source File

lm3s_eth.h

Go to the documentation of this file.
00001 /**
00002  * @file lm3s_eth.h
00003  * @brief Luminary Stellaris LM3S Ethernet controller
00004  *
00005  * @section License
00006  *
00007  * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
00008  *
00009  * This file is part of CycloneTCP Open.
00010  *
00011  * This program is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU General Public License
00013  * as published by the Free Software Foundation; either version 2
00014  * of the License, or (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software Foundation,
00023  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00024  *
00025  * @author Oryx Embedded SARL (www.oryx-embedded.com)
00026  * @version 1.7.6
00027  **/
00028 
00029 #ifndef _LM3S_ETH_H
00030 #define _LM3S_ETH_H
00031 
00032 //Dependencies
00033 #include "core/nic.h"
00034 
00035 //Interrupt priority grouping
00036 #ifndef LM3S_ETH_IRQ_PRIORITY_GROUPING
00037    #define LM3S_ETH_IRQ_PRIORITY_GROUPING 3
00038 #elif (LM3S_ETH_IRQ_PRIORITY_GROUPING < 0)
00039    #error LM3S_ETH_IRQ_PRIORITY_GROUPING parameter is not valid
00040 #endif
00041 
00042 //Ethernet interrupt priority
00043 #ifndef LM3S_ETH_IRQ_PRIORITY
00044    #define LM3S_ETH_IRQ_PRIORITY 192
00045 #elif (LM3S_ETH_IRQ_PRIORITY < 0)
00046    #error LM3S_ETH_IRQ_PRIORITY parameter is not valid
00047 #endif
00048 
00049 //Stellaris LM3S Ethernet driver
00050 extern const NicDriver lm3sEthDriver;
00051 
00052 //Stellaris LM3S Ethernet related functions
00053 error_t lm3sEthInit(NetInterface *interface);
00054 void lm3sEthInitGpio(NetInterface *interface);
00055 
00056 void lm3sEthTick(NetInterface *interface);
00057 
00058 void lm3sEthEnableIrq(NetInterface *interface);
00059 void lm3sEthDisableIrq(NetInterface *interface);
00060 void lm3sEthEventHandler(NetInterface *interface);
00061 
00062 error_t lm3sEthSendPacket(NetInterface *interface,
00063    const NetBuffer *buffer, size_t offset);
00064 
00065 error_t lm3sEthReceivePacket(NetInterface *interface);
00066 
00067 error_t lm3sEthSetMulticastFilter(NetInterface *interface);
00068 
00069 void lm3sEthWritePhyReg(uint8_t address, uint16_t data);
00070 uint16_t lm3sEthReadPhyReg(uint8_t address);
00071 
00072 void lm3sEthDumpPhyReg(void);
00073 
00074 #endif
00075