|
|
@ -7,7 +7,7 @@ |
|
|
|
****************************************************************************** |
|
|
|
* @attention |
|
|
|
* |
|
|
|
* Copyright (c) 2024 STMicroelectronics. |
|
|
|
* Copyright (c) 2023 STMicroelectronics. |
|
|
|
* All rights reserved. |
|
|
|
* |
|
|
|
* This software is licensed under terms that can be found in the LICENSE file |
|
|
@ -202,7 +202,7 @@ static void low_level_init(struct netif *netif) |
|
|
|
heth.Init.RxBuffLen = 1536; |
|
|
|
|
|
|
|
/* USER CODE BEGIN MACADDRESS */ |
|
|
|
|
|
|
|
|
|
|
|
/* USER CODE END MACADDRESS */ |
|
|
|
|
|
|
|
hal_eth_init_status = HAL_ETH_Init(&heth); |
|
|
@ -254,7 +254,7 @@ static void low_level_init(struct netif *netif) |
|
|
|
/* USER CODE END OS_THREAD_DEF_CREATE_CMSIS_RTOS_V1 */ |
|
|
|
|
|
|
|
/* USER CODE BEGIN PHY_PRE_CONFIG */ |
|
|
|
|
|
|
|
|
|
|
|
/* USER CODE END PHY_PRE_CONFIG */ |
|
|
|
/* Set PHY IO functions */ |
|
|
|
LAN8742_RegisterBusIO(&LAN8742, &LAN8742_IOCtx); |
|
|
@ -309,7 +309,7 @@ static void low_level_init(struct netif *netif) |
|
|
|
netif_set_link_up(netif); |
|
|
|
|
|
|
|
/* USER CODE BEGIN PHY_POST_CONFIG */ |
|
|
|
|
|
|
|
|
|
|
|
/* USER CODE END PHY_POST_CONFIG */ |
|
|
|
} |
|
|
|
|
|
|
@ -321,7 +321,7 @@ static void low_level_init(struct netif *netif) |
|
|
|
#endif /* LWIP_ARP || LWIP_ETHERNET */ |
|
|
|
|
|
|
|
/* USER CODE BEGIN LOW_LEVEL_INIT */ |
|
|
|
|
|
|
|
|
|
|
|
/* USER CODE END LOW_LEVEL_INIT */ |
|
|
|
} |
|
|
|
|
|
|
@ -454,7 +454,7 @@ static err_t low_level_output_arp_off(struct netif *netif, struct pbuf *q, const |
|
|
|
errval = ERR_OK; |
|
|
|
|
|
|
|
/* USER CODE BEGIN 5 */ |
|
|
|
|
|
|
|
|
|
|
|
/* USER CODE END 5 */ |
|
|
|
|
|
|
|
return errval; |
|
|
@ -546,7 +546,7 @@ void pbuf_free_custom(struct pbuf *p) |
|
|
|
* @brief Returns the current time in milliseconds |
|
|
|
* when LWIP_TIMERS == 1 and NO_SYS == 1 |
|
|
|
* @param None |
|
|
|
* @retval Current Time value |
|
|
|
* @retval Time |
|
|
|
*/ |
|
|
|
u32_t sys_now(void) |
|
|
|
{ |
|
|
@ -611,7 +611,11 @@ void HAL_ETH_MspInit(ETH_HandleTypeDef* ethHandle) |
|
|
|
HAL_NVIC_SetPriority(ETH_IRQn, 5, 0); |
|
|
|
HAL_NVIC_EnableIRQ(ETH_IRQn); |
|
|
|
/* USER CODE BEGIN ETH_MspInit 1 */ |
|
|
|
|
|
|
|
#define ETH_RST_Pin GPIO_PIN_3 |
|
|
|
#define ETH_RST_GPIO_Port GPIOD |
|
|
|
HAL_GPIO_WritePin(ETH_RST_GPIO_Port,ETH_RST_Pin,GPIO_PIN_RESET); |
|
|
|
HAL_Delay(50); |
|
|
|
HAL_GPIO_WritePin(ETH_RST_GPIO_Port,ETH_RST_Pin,GPIO_PIN_SET); |
|
|
|
/* USER CODE END ETH_MspInit 1 */ |
|
|
|
} |
|
|
|
} |
|
|
@ -738,7 +742,7 @@ void ethernet_link_thread(void const * argument) |
|
|
|
|
|
|
|
struct netif *netif = (struct netif *) argument; |
|
|
|
/* USER CODE BEGIN ETH link init */ |
|
|
|
|
|
|
|
netif->link_callback(netif); |
|
|
|
/* USER CODE END ETH link init */ |
|
|
|
|
|
|
|
for(;;) |
|
|
@ -869,6 +873,17 @@ void HAL_ETH_TxFreeCallback(uint32_t * buff) |
|
|
|
} |
|
|
|
|
|
|
|
/* USER CODE BEGIN 8 */ |
|
|
|
/** |
|
|
|
* @brief This function notify user about link status changement. |
|
|
|
* @param netif: the network interface |
|
|
|
* @retval None |
|
|
|
*/ |
|
|
|
__weak void ethernetif_notify_conn_changed(struct netif *netif) |
|
|
|
{ |
|
|
|
/* NOTE : This is function could be implemented in user file |
|
|
|
when the callback is needed, |
|
|
|
*/ |
|
|
|
|
|
|
|
} |
|
|
|
/* USER CODE END 8 */ |
|
|
|
|