[1] | 1 | /**
|
---|
| 2 | ******************************************************************************
|
---|
| 3 | * File Name : LWIP.h
|
---|
| 4 | * Description : This file provides code for the configuration
|
---|
| 5 | * of the LWIP.
|
---|
| 6 | ******************************************************************************
|
---|
| 7 | * @attention
|
---|
| 8 | *
|
---|
| 9 | * <h2><center>© Copyright (c) 2021 STMicroelectronics.
|
---|
| 10 | * All rights reserved.</center></h2>
|
---|
| 11 | *
|
---|
| 12 | * This software component is licensed by ST under Ultimate Liberty license
|
---|
| 13 | * SLA0044, the "License"; You may not use this file except in compliance with
|
---|
| 14 | * the License. You may obtain a copy of the License at:
|
---|
| 15 | * www.st.com/SLA0044
|
---|
| 16 | *
|
---|
| 17 | *************************************************************************
|
---|
| 18 |
|
---|
| 19 | */
|
---|
| 20 | /* Define to prevent recursive inclusion -------------------------------------*/
|
---|
| 21 | #ifndef __mx_lwip_H
|
---|
| 22 | #define __mx_lwip_H
|
---|
| 23 | #ifdef __cplusplus
|
---|
| 24 | extern "C" {
|
---|
| 25 | #endif
|
---|
| 26 |
|
---|
| 27 | /* Includes ------------------------------------------------------------------*/
|
---|
| 28 | #include "lwip/opt.h"
|
---|
| 29 | #include "lwip/mem.h"
|
---|
| 30 | #include "lwip/memp.h"
|
---|
| 31 | #include "netif/etharp.h"
|
---|
| 32 | #include "lwip/dhcp.h"
|
---|
| 33 | #include "lwip/netif.h"
|
---|
| 34 | #include "lwip/timeouts.h"
|
---|
| 35 | #include "ethernetif.h"
|
---|
| 36 |
|
---|
| 37 |
|
---|
| 38 | /* Includes for RTOS ---------------------------------------------------------*/
|
---|
| 39 | #if WITH_RTOS
|
---|
| 40 | #include "lwip/tcpip.h"
|
---|
| 41 | #endif /* WITH_RTOS */
|
---|
| 42 | #define MAX_IP 4
|
---|
| 43 | /* USER CODE BEGIN 0 */
|
---|
| 44 | typedef struct {
|
---|
| 45 | char ipv4_addr[16];
|
---|
| 46 | char ipv4_nm[16];
|
---|
| 47 | char ipv4_gw[16];
|
---|
| 48 | struct netif netif;
|
---|
| 49 | }network_settings;
|
---|
| 50 |
|
---|
| 51 | /* ìàññèâ IP, multiIP*/
|
---|
| 52 | void LWIP_SetIP(network_settings *net, char *NewIP);
|
---|
| 53 | void LWIP_SetNetMask(network_settings *net, char *NewNetMask);
|
---|
| 54 | void LWIP_Set_Gateway(network_settings *net, char *NewGateway);
|
---|
| 55 | void LWIP_SetNetSettings(network_settings *net, char *NewIP, char *NewNetMask, char *NewGateway);
|
---|
| 56 | void LWIP_NetApply(network_settings *net);
|
---|
| 57 | void LWIP_resetIP(network_settings *net);
|
---|
| 58 | /* USER CODE END 0 */
|
---|
| 59 |
|
---|
| 60 | /* Global Variables ----------------------------------------------------------*/
|
---|
| 61 | extern ETH_HandleTypeDef heth;
|
---|
| 62 |
|
---|
| 63 | /* LWIP init function */
|
---|
| 64 | void MX_LWIP_Init(network_settings *net);
|
---|
| 65 |
|
---|
| 66 | #if !WITH_RTOS
|
---|
| 67 | /* USER CODE BEGIN 1 */
|
---|
| 68 | /* Function defined in lwip.c to:
|
---|
| 69 | * - Read a received packet from the Ethernet buffers
|
---|
| 70 | * - Send it to the lwIP stack for handling
|
---|
| 71 | * - Handle timeouts if NO_SYS_NO_TIMERS not set
|
---|
| 72 | */
|
---|
| 73 | void MX_LWIP_Process(void);
|
---|
| 74 |
|
---|
| 75 | /* USER CODE END 1 */
|
---|
| 76 | #endif /* WITH_RTOS */
|
---|
| 77 |
|
---|
| 78 | #ifdef __cplusplus
|
---|
| 79 | }
|
---|
| 80 | #endif
|
---|
| 81 | #endif /*__ mx_lwip_H */
|
---|
| 82 |
|
---|
| 83 | /**
|
---|
| 84 | * @}
|
---|
| 85 | */
|
---|
| 86 |
|
---|
| 87 | /**
|
---|
| 88 | * @}
|
---|
| 89 | */
|
---|
| 90 |
|
---|
| 91 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
---|