lm3s_eth_driver.h
Go to the documentation of this file.
1 /**
2  * @file lm3s_eth_driver.h
3  * @brief Luminary Stellaris LM3S Ethernet controller
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _LM3S_ETH_DRIVER_H
30 #define _LM3S_ETH_DRIVER_H
31 
32 //Dependencies
33 #include "core/nic.h"
34 
35 //Interrupt priority grouping
36 #ifndef LM3S_ETH_IRQ_PRIORITY_GROUPING
37  #define LM3S_ETH_IRQ_PRIORITY_GROUPING 3
38 #elif (LM3S_ETH_IRQ_PRIORITY_GROUPING < 0)
39  #error LM3S_ETH_IRQ_PRIORITY_GROUPING parameter is not valid
40 #endif
41 
42 //Ethernet interrupt priority
43 #ifndef LM3S_ETH_IRQ_PRIORITY
44  #define LM3S_ETH_IRQ_PRIORITY 192
45 #elif (LM3S_ETH_IRQ_PRIORITY < 0)
46  #error LM3S_ETH_IRQ_PRIORITY parameter is not valid
47 #endif
48 
49 //C++ guard
50 #ifdef __cplusplus
51  extern "C" {
52 #endif
53 
54 //Stellaris LM3S Ethernet driver
55 extern const NicDriver lm3sEthDriver;
56 
57 //Stellaris LM3S Ethernet related functions
58 error_t lm3sEthInit(NetInterface *interface);
59 void lm3sEthInitGpio(NetInterface *interface);
60 
61 void lm3sEthTick(NetInterface *interface);
62 
63 void lm3sEthEnableIrq(NetInterface *interface);
64 void lm3sEthDisableIrq(NetInterface *interface);
65 void lm3sEthEventHandler(NetInterface *interface);
66 
68  const NetBuffer *buffer, size_t offset);
69 
71 
73 
74 void lm3sEthWritePhyReg(uint8_t address, uint16_t data);
75 uint16_t lm3sEthReadPhyReg(uint8_t address);
76 
77 void lm3sEthDumpPhyReg(void);
78 
79 //C++ guard
80 #ifdef __cplusplus
81  }
82 #endif
83 
84 #endif
void lm3sEthEnableIrq(NetInterface *interface)
Enable interrupts.
error_t lm3sEthUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
void lm3sEthWritePhyReg(uint8_t address, uint16_t data)
Write PHY register.
uint16_t lm3sEthReadPhyReg(uint8_t address)
Read PHY register.
void lm3sEthEventHandler(NetInterface *interface)
Stellaris LM3S Ethernet event handler.
error_t lm3sEthReceivePacket(NetInterface *interface)
Receive a packet.
void lm3sEthDisableIrq(NetInterface *interface)
Disable interrupts.
NIC driver.
Definition: nic.h:161
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:86
void lm3sEthTick(NetInterface *interface)
Stellaris LM3S Ethernet timer handler.
const NicDriver lm3sEthDriver
Stellaris LM3S Ethernet driver.
void lm3sEthDumpPhyReg(void)
Dump PHY registers for debugging purpose.
Ipv6Addr address
error_t
Error codes.
Definition: error.h:40
uint8_t data[]
Definition: dtls_misc.h:167
#define NetInterface
Definition: net.h:34
void lm3sEthInitGpio(NetInterface *interface)
error_t lm3sEthInit(NetInterface *interface)
Stellaris LM3S Ethernet controller initialization.
error_t lm3sEthSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset)
Send a packet.
Network interface controller abstraction layer.