lm3s_eth_driver.c File Reference

Luminary Stellaris LM3S Ethernet controller. More...

#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/sysctl.h"
#include "core/net.h"
#include "drivers/mac/lm3s_eth_driver.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

error_t lm3sEthInit (NetInterface *interface)
 Stellaris LM3S Ethernet controller initialization. More...
 
__weak_func void lm3sEthInitGpio (NetInterface *interface)
 GPIO configuration. More...
 
void lm3sEthTick (NetInterface *interface)
 Stellaris LM3S Ethernet timer handler. More...
 
void lm3sEthEnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void lm3sEthDisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void ETH_IRQHandler (void)
 Stellaris LM3S Ethernet interrupt service routine. More...
 
void lm3sEthEventHandler (NetInterface *interface)
 Stellaris LM3S Ethernet event handler. More...
 
error_t lm3sEthSendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send a packet. More...
 
error_t lm3sEthReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t lm3sEthUpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void lm3sEthWritePhyReg (uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t lm3sEthReadPhyReg (uint8_t address)
 Read PHY register. More...
 
void lm3sEthDumpPhyReg (void)
 Dump PHY registers for debugging purpose. More...
 

Variables

const NicDriver lm3sEthDriver
 Stellaris LM3S Ethernet driver. More...
 

Detailed Description

Luminary Stellaris LM3S Ethernet controller.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file lm3s_eth_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 32 of file lm3s_eth_driver.c.

Function Documentation

◆ ETH_IRQHandler()

void ETH_IRQHandler ( void  )

Stellaris LM3S Ethernet interrupt service routine.

Definition at line 235 of file lm3s_eth_driver.c.

◆ lm3sEthDisableIrq()

void lm3sEthDisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 224 of file lm3s_eth_driver.c.

◆ lm3sEthDumpPhyReg()

void lm3sEthDumpPhyReg ( void  )

Dump PHY registers for debugging purpose.

Definition at line 639 of file lm3s_eth_driver.c.

◆ lm3sEthEnableIrq()

void lm3sEthEnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 212 of file lm3s_eth_driver.c.

◆ lm3sEthEventHandler()

void lm3sEthEventHandler ( NetInterface interface)

Stellaris LM3S Ethernet event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 297 of file lm3s_eth_driver.c.

◆ lm3sEthInit()

error_t lm3sEthInit ( NetInterface interface)

Stellaris LM3S Ethernet controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 107 of file lm3s_eth_driver.c.

◆ lm3sEthInitGpio()

__weak_func void lm3sEthInitGpio ( NetInterface interface)

GPIO configuration.

Parameters
[in]interfaceUnderlying network interface

Definition at line 180 of file lm3s_eth_driver.c.

◆ lm3sEthReadPhyReg()

uint16_t lm3sEthReadPhyReg ( uint8_t  address)

Read PHY register.

Parameters
[in]addressPHY register address
Returns
Register value

Definition at line 620 of file lm3s_eth_driver.c.

◆ lm3sEthReceivePacket()

error_t lm3sEthReceivePacket ( NetInterface interface)

Receive a packet.

Returns
Error code

Definition at line 452 of file lm3s_eth_driver.c.

◆ lm3sEthSendPacket()

error_t lm3sEthSendPacket ( NetInterface interface,
const NetBuffer buffer,
size_t  offset,
NetTxAncillary ancillary 
)

Send a packet.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
[in]ancillaryAdditional options passed to the stack along with the packet
Returns
Error code

Definition at line 396 of file lm3s_eth_driver.c.

◆ lm3sEthTick()

void lm3sEthTick ( NetInterface interface)

Stellaris LM3S Ethernet timer handler.

This routine is periodically called by the TCP/IP stack to handle periodic operations such as polling the link state

Parameters
[in]interfaceUnderlying network interface

Definition at line 202 of file lm3s_eth_driver.c.

◆ lm3sEthUpdateMacAddrFilter()

error_t lm3sEthUpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 550 of file lm3s_eth_driver.c.

◆ lm3sEthWritePhyReg()

void lm3sEthWritePhyReg ( uint8_t  address,
uint16_t  data 
)

Write PHY register.

Parameters
[in]addressPHY register address
[in]dataRegister value

Definition at line 600 of file lm3s_eth_driver.c.

Variable Documentation

◆ lm3sEthDriver

const NicDriver lm3sEthDriver
Initial value:
=
{
NULL,
NULL,
NULL,
}
#define ETH_MTU
Definition: ethernet.h:116
void lm3sEthEventHandler(NetInterface *interface)
Stellaris LM3S Ethernet event handler.
error_t lm3sEthSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
void lm3sEthTick(NetInterface *interface)
Stellaris LM3S Ethernet timer handler.
void lm3sEthEnableIrq(NetInterface *interface)
Enable interrupts.
error_t lm3sEthUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
void lm3sEthDisableIrq(NetInterface *interface)
Disable interrupts.
error_t lm3sEthInit(NetInterface *interface)
Stellaris LM3S Ethernet controller initialization.
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:83
#define TRUE
Definition: os_port.h:50
#define FALSE
Definition: os_port.h:46

Stellaris LM3S Ethernet driver.

Definition at line 80 of file lm3s_eth_driver.c.