/\* Private includes ----------------------------------------------------------\*/ /\* USER CODE BEGIN Includes \*/ #include <stdio.h> #include "w5500\_port.h" #include <string.h> // memcmp #include "app\_config.h" #ifdef UDP\_DEMO #include "udp\_demo.h" #endif /\* USER CODE END Includes \*/
/\* Reset of all peripherals, Initializes the Flash interface and the Systick. \*/ HAL\_Init();
/\* USER CODE BEGIN Init \*/
/\* USER CODE END Init \*/
/\* Configure the system clock \*/ SystemClock\_Config();
/\* USER CODE BEGIN SysInit \*/
/\* USER CODE END SysInit \*/
/\* Initialize all configured peripherals \*/ MX\_GPIO\_Init(); MX\_USART1\_UART\_Init(); MX\_SPI1\_Init(); /\* USER CODE BEGIN 2 \*/ printf("-----STM32 W5500 Ethernet Demo-----\r\n"); w5500\_restart(); // hardware restart through RESET pin wiznet\_register(); w5500\_network\_init\_static(); wiznet\_chip\_config(); /\* USER CODE END 2 \*/
/\* Infinite loop \*/ /\* USER CODE BEGIN WHILE \*/ while (1) { /\* USER CODE END WHILE \*/ //loopback\_tcpc(0, (uint8\_t\*) recv\_buff, destip, destport); /\* USER CODE BEGIN 3 \*/ #ifdef UDP\_DEMO udp\_demo(); #endif } /\* USER CODE END 3 \*/ }