31#ifndef __ETHERNETMANAGER_H__
32#define __ETHERNETMANAGER_H__
36#include "EthernetApi.h"
42#include "lwip/ip_addr.h"
43#include "lwip/netif.h"
60#ifndef HIDE_FROM_DOXYGEN
105 uint32_t PhyShift(uint32_t phyOp, uint32_t phyReg, uint32_t contents);
114 uint32_t PhyRead(uint32_t phyReg);
124 uint32_t PhyWrite(uint32_t phyReg, uint32_t contents);
146 return m_phyRemoteFault;
149#ifndef HIDE_FROM_DOXYGEN
155 volatile const bool &PhyInitFailed() {
156 return m_phyInitFailed;
164 void Enable(
bool enable);
171 bool ReceivedFrameFlag();
176 void IrqHandlerPhy();
183 void IrqHandlerGmac();
259#ifndef HIDE_FROM_DOXYGEN
265 netif *MacInterface() {
266 return &m_macInterface;
276 return m_retransmissionTimeout;
286 m_retransmissionTimeout = timeout;
295 return m_retransmissionCount;
307 m_retransmissionCount = count;
342 return m_ethernetActive;
347 uint32_t m_portPhyTxen;
348 uint32_t m_pinPhyTxen;
349 uint32_t m_portPhyTxd0;
350 uint32_t m_pinPhyTxd0;
351 uint32_t m_portPhyTxd1;
352 uint32_t m_pinPhyTxd1;
353 uint32_t m_portPhyRxd0;
354 uint32_t m_pinPhyRxd0;
355 uint32_t m_portPhyRxd1;
356 uint32_t m_pinPhyRxd1;
357 uint32_t m_portPhyRxer;
358 uint32_t m_pinPhyRxer;
359 uint32_t m_portPhyRxdv;
360 uint32_t m_pinPhyRxdv;
361 uint32_t m_portPhyMdio;
362 uint32_t m_pinPhyMdio;
363 uint32_t m_portPhyMdc;
364 uint32_t m_pinPhyMdc;
365 uint32_t m_portPhyTxclk;
366 uint32_t m_pinPhyTxclk;
367 uint32_t m_portPhyInt;
368 uint32_t m_pinPhyInt;
370 uint32_t m_phyExtInt;
374 bool m_phyRemoteFault;
376 bool m_phyInitFailed;
383 bool m_ethernetActive;
386 uint8_t m_rxBuffIndex;
388 uint16_t m_txBuffIndex;
390 GMAC_RX_DESC m_rxDesc[RX_BUFF_CNT];
392 GMAC_TX_DESC m_txDesc[TX_BUFF_CNT];
394 uint8_t m_rxBuffer[RX_BUFF_CNT][RX_BUFFER_SIZE];
396 uint8_t m_txBuffer[TX_BUFF_CNT][TX_BUFFER_SIZE];
399 uint16_t m_retransmissionTimeout;
401 uint8_t m_retransmissionCount;
404 ethInt m_ethernetInterface;
409 struct netif m_macInterface;
411 struct dhcp *m_dhcpData;
428 void ConfigureGpioPerGmac(uint32_t port, uint32_t pin);
ClearCore common utility functions.
ClearCore Ethernet configuration manager.
Definition EthernetManager.h:56
IpAddress NetmaskIp()
Get the netmask IP.
volatile const bool & PhyLinkActive()
Check the link status from the PHY.
Definition EthernetManager.h:136
void DnsIp(IpAddress dns)
Set the DNS IP address used for address resolution.
void RetransmissionCount(uint8_t count)
Set the retransmission count.
Definition EthernetManager.h:306
uint8_t * MacAddress()
Get the MAC address.
IpAddress LocalIp()
Get the local IP address.
IpAddress GatewayIp()
Get the gateway IP address.
void NetmaskIp(IpAddress address)
Set the netmask IP.
void LocalIp(IpAddress ipaddr)
Set the local IP address.
IpAddress DnsIp()
Get the DNS IP address used for address resolution.
volatile const bool & EthernetActive()
A flag to indicate whether Ethernet setup has been invoked.
Definition EthernetManager.h:341
volatile const uint8_t & RetransmissionCount()
Get the retransmission count.
Definition EthernetManager.h:294
void Refresh()
Perform any necessary periodic Ethernet and LwIP updates.
void GatewayIp(IpAddress address)
Set the gateway IP address.
volatile const bool & PhyRemoteFault()
Check the remote fault status from the PHY.
Definition EthernetManager.h:145
bool DhcpBegin()
Set up DHCP connection to retrieve local IP.
void Setup()
Setup LwIP with the local network interface.
volatile const uint16_t & RetransmissionTimeout()
Get the retransmission timeout.
Definition EthernetManager.h:275
void RetransmissionTimeout(uint8_t timeout)
Set the retransmission timeout.
Definition EthernetManager.h:285
An IP Address class.
Definition IpAddress.h:41
ClearCore Board Supervisory System Manager.
Definition SysManager.h:58
Namespace to encompass the ClearCore board API.
Definition AdcManager.h:36