Macros | |
#define | IFNAME0 's' |
#define | IFNAME1 't' |
#define | ETH_DMA_TRANSMIT_TIMEOUT (20U) |
Functions | |
LWIP_MEMPOOL_DECLARE (RX_POOL, 10, sizeof(struct pbuf_custom), "Zero-copy RX PBUF pool") | |
int32_t | ETH_PHY_IO_Init (void) |
Initializes the MDIO interface GPIO and clocks. More... | |
int32_t | ETH_PHY_IO_DeInit (void) |
De-Initializes the MDIO interface . More... | |
int32_t | ETH_PHY_IO_ReadReg (uint32_t DevAddr, uint32_t RegAddr, uint32_t *pRegVal) |
Read a PHY register through the MDIO interface. More... | |
int32_t | ETH_PHY_IO_WriteReg (uint32_t DevAddr, uint32_t RegAddr, uint32_t RegVal) |
Write a value to a PHY register through the MDIO interface. More... | |
int32_t | ETH_PHY_IO_GetTick (void) |
Get the time in millisecons used for internal PHY driver process. More... | |
void | pbuf_free_custom (struct pbuf *p) |
Custom Rx pbuf free callback. More... | |
void | Error_Handler (void) |
This function is executed in case of error occurrence. More... | |
void | HAL_ETH_MspInit (ETH_HandleTypeDef *ethHandle) |
void | HAL_ETH_MspDeInit (ETH_HandleTypeDef *ethHandle) |
static void | low_level_init (struct netif *netif) |
In this function, the hardware should be initialized. Called from ethernetif_init(). More... | |
static err_t | low_level_output (struct netif *netif, struct pbuf *p) |
static struct pbuf * | low_level_input (struct netif *netif) |
void | ethernetif_input (struct netif *netif) |
static err_t | low_level_output_arp_off (struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr) |
err_t | ethernetif_init (struct netif *netif) |
u32_t | sys_jiffies (void) |
Returns the current time in milliseconds when LWIP_TIMERS == 1 and NO_SYS == 1. More... | |
u32_t | sys_now (void) |
Returns the current time in milliseconds when LWIP_TIMERS == 1 and NO_SYS == 1. More... | |
void | ethernet_link_check_state (struct netif *netif) |
Check the ETH link state then update ETH driver and netif link accordingly. More... | |
Variables | |
ETH_HandleTypeDef | heth |
ETH_TxPacketConfig | TxConfig |
lan8742_Object_t | LAN8742 |
lan8742_IOCtx_t | LAN8742_IOCtx |
#define ETH_DMA_TRANSMIT_TIMEOUT (20U) |
#define IFNAME0 's' |
#define IFNAME1 't' |
This function is executed in case of error occurrence.
None |
int32_t ETH_PHY_IO_DeInit | ( | void | ) |
De-Initializes the MDIO interface .
None |
0 | if OK, -1 if ERROR |
int32_t ETH_PHY_IO_GetTick | ( | void | ) |
Get the time in millisecons used for internal PHY driver process.
Time | value |
int32_t ETH_PHY_IO_Init | ( | void | ) |
Initializes the MDIO interface GPIO and clocks.
None |
0 | if OK, -1 if ERROR |
References heth.
int32_t ETH_PHY_IO_ReadReg | ( | uint32_t | DevAddr, |
uint32_t | RegAddr, | ||
uint32_t * | pRegVal | ||
) |
Read a PHY register through the MDIO interface.
DevAddr | PHY port address |
RegAddr | PHY register address |
pRegVal | pointer to hold the register value |
0 | if OK -1 if Error |
References heth.
int32_t ETH_PHY_IO_WriteReg | ( | uint32_t | DevAddr, |
uint32_t | RegAddr, | ||
uint32_t | RegVal | ||
) |
Write a value to a PHY register through the MDIO interface.
DevAddr | PHY port address |
RegAddr | PHY register address |
RegVal | Value to be written |
0 | if OK -1 if Error |
References heth.
void ethernet_link_check_state | ( | struct netif * | netif | ) |
err_t ethernetif_init | ( | struct netif * | netif | ) |
Should be called at the beginning of the program to set up the network interface. It calls the function low_level_init() to do the actual setup of the hardware.
This function should be passed as a parameter to netif_add().
netif | the lwip network interface structure for this ethernetif |
References IFNAME0, IFNAME1, low_level_init(), low_level_output(), and low_level_output_arp_off().
void ethernetif_input | ( | struct netif * | netif | ) |
This function should be called when a packet is ready to be read from the interface. It uses the function low_level_input() that should handle the actual reception of bytes from the network interface. Then the type of the received packet is determined and the appropriate input function is called.
netif | the lwip network interface structure for this ethernetif |
References err, low_level_input(), and p.
void HAL_ETH_MspDeInit | ( | ETH_HandleTypeDef * | ethHandle | ) |
ETH GPIO Configuration PG11 ---—> ETH_TX_EN PG12 ---—> ETH_TXD1 PG13 ---—> ETH_TXD0 PC1 ---—> ETH_MDC PA2 ---—> ETH_MDIO PA1 ---—> ETH_REF_CLK PA7 ---—> ETH_CRS_DV PC4 ---—> ETH_RXD0 PC5 ---—> ETH_RXD1
void HAL_ETH_MspInit | ( | ETH_HandleTypeDef * | ethHandle | ) |
ETH GPIO Configuration PG11 ---—> ETH_TX_EN PG12 ---—> ETH_TXD1 PG13 ---—> ETH_TXD0 PC1 ---—> ETH_MDC PA2 ---—> ETH_MDIO PA1 ---—> ETH_REF_CLK PA7 ---—> ETH_CRS_DV PC4 ---—> ETH_RXD0 PC5 ---—> ETH_RXD1
|
static |
In this function, the hardware should be initialized. Called from ethernetif_init().
netif | the already initialized lwip network interface structure for this ethernetif |
References Error_Handler(), ethernet_link_check_state(), heth, LAN8742, LAN8742_IOCtx, and TxConfig.
|
static |
Should allocate a pbuf and transfer the bytes of the incoming packet from the interface into the pbuf.
netif | the lwip network interface structure for this ethernetif |
References heth, p, and pbuf_free_custom().
|
static |
This function should do the actual transmission of the packet. The packet is contained in the pbuf that is passed to the function. This pbuf might be chained.
netif | the lwip network interface structure for this ethernetif |
p | the MAC packet to send (e.g. IP packet including MAC addresses and type) |
References ETH_DMA_TRANSMIT_TIMEOUT, heth, p, and TxConfig.
|
static |
This function has to be completed by user in case of ARP OFF.
netif | the lwip network interface structure for this ethernetif |
LWIP_MEMPOOL_DECLARE | ( | RX_POOL | , |
10 | , | ||
sizeof(struct pbuf_custom) | , | ||
"Zero-copy RX PBUF pool" | |||
) |
void pbuf_free_custom | ( | struct pbuf * | p | ) |
Custom Rx pbuf free callback.
pbuf | pbuf to be freed |
None |
References p.
u32_t sys_jiffies | ( | void | ) |
Returns the current time in milliseconds when LWIP_TIMERS == 1 and NO_SYS == 1.
None |
Current | Time value |
u32_t sys_now | ( | void | ) |
Returns the current time in milliseconds when LWIP_TIMERS == 1 and NO_SYS == 1.
None |
Current | Time value |
ETH_HandleTypeDef heth |
< IAR Compiler
lan8742_Object_t LAN8742 |
lan8742_IOCtx_t LAN8742_IOCtx |
ETH_TxPacketConfig TxConfig |