main_lwip.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /**
  2. ******************************************************************************
  3. * @file main_lwip.h
  4. * @author MCD Application Team
  5. * @version V1.1.0
  6. * @date 31-July-2013
  7. * @brief This file contains all the functions prototypes for the main.c
  8. * file.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2>
  13. *
  14. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  15. * You may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at:
  17. *
  18. * http://www.st.com/software_license_agreement_liberty_v2
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an "AS IS" BASIS,
  22. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. ******************************************************************************
  27. */
  28. /* Define to prevent recursive inclusion -------------------------------------*/
  29. #ifndef __MAIN_LWIP_H
  30. #define __MAIN_LWIP_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* Includes ------------------------------------------------------------------*/
  35. #include "stm32f4xx.h"
  36. #include "stm32f4x7_eth_bsp.h"
  37. /* Exported types ------------------------------------------------------------*/
  38. /* Exported constants --------------------------------------------------------*/
  39. //#define USE_LCD /* enable LCD */
  40. //#define USE_DHCP /* enable DHCP, if disabled static address is used */
  41. /* Uncomment SERIAL_DEBUG to enables retarget of printf to serial port (COM1 on STM32 evalboard)
  42. for debug purpose */
  43. //#define SERIAL_DEBUG
  44. /* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
  45. #define MAC_ADDR0 2
  46. #define MAC_ADDR1 0
  47. #define MAC_ADDR2 0
  48. #define MAC_ADDR3 0
  49. #define MAC_ADDR4 0
  50. #define MAC_ADDR5 0
  51. /*Static IP ADDRESS: IP_ADDR0.IP_ADDR1.IP_ADDR2.IP_ADDR3 */
  52. #if 0
  53. /* IPµØÖ· */
  54. #define IP_ADDR0 g_tParam.lwip_ip[0]
  55. #define IP_ADDR1 g_tParam.lwip_ip[1]
  56. #define IP_ADDR2 g_tParam.lwip_ip[2]
  57. #define IP_ADDR3 g_tParam.lwip_ip[3]
  58. /*NETMASK*/
  59. #define NETMASK_ADDR0 g_tParam.lwip_net_mask[0]
  60. #define NETMASK_ADDR1 g_tParam.lwip_net_mask[1]
  61. #define NETMASK_ADDR2 g_tParam.lwip_net_mask[2]
  62. #define NETMASK_ADDR3 g_tParam.lwip_net_mask[3]
  63. /*Gateway Address*/
  64. #define GW_ADDR0 g_tParam.lwip_gateway[0]
  65. #define GW_ADDR1 g_tParam.lwip_gateway[1]
  66. #define GW_ADDR2 g_tParam.lwip_gateway[2]
  67. #define GW_ADDR3 g_tParam.lwip_gateway[3]
  68. #else
  69. #define IP_ADDR0 192
  70. #define IP_ADDR1 168
  71. #define IP_ADDR2 0
  72. #define IP_ADDR3 12
  73. /*NETMASK*/
  74. #define NETMASK_ADDR0 255
  75. #define NETMASK_ADDR1 255
  76. #define NETMASK_ADDR2 255
  77. #define NETMASK_ADDR3 0
  78. /*Gateway Address*/
  79. #define GW_ADDR0 192
  80. #define GW_ADDR1 168
  81. #define GW_ADDR2 0
  82. #define GW_ADDR3 1
  83. #endif
  84. /* MII and RMII mode selection, for STM324xG-EVAL Board(MB786) RevB ***********/
  85. //#define RMII_MODE // User have to provide the 50 MHz clock by soldering a 50 MHz
  86. // oscillator (ref SM7745HEV-50.0M or equivalent) on the U3
  87. // footprint located under CN3 and also removing jumper on JP5.
  88. // This oscillator is not provided with the board.
  89. // For more details, please refer to STM3240G-EVAL evaluation
  90. // board User manual (UM1461).
  91. #define MII_MODE
  92. /* Uncomment the define below to clock the PHY from external 25MHz crystal (only for MII mode) */
  93. #ifdef MII_MODE
  94. #define PHY_CLOCK_MCO
  95. #endif
  96. /* STM324xG-EVAL jumpers setting
  97. +==========================================================================================+
  98. + Jumper | MII mode configuration | RMII mode configuration +
  99. +==========================================================================================+
  100. + JP5 | 2-3 provide 25MHz clock by MCO(PA8) | Not fitted +
  101. + | 1-2 provide 25MHz clock by ext. Crystal | +
  102. + -----------------------------------------------------------------------------------------+
  103. + JP6 | 2-3 | 1-2 +
  104. + -----------------------------------------------------------------------------------------+
  105. + JP8 | Open | Close +
  106. +==========================================================================================+
  107. */
  108. /* Exported macro ------------------------------------------------------------*/
  109. /* Exported functions ------------------------------------------------------- */
  110. void Time_Update(void);
  111. void Delay(uint32_t nCount);
  112. #ifdef __cplusplus
  113. }
  114. #endif
  115. #endif /* __MAIN_H */
  116. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/