stm32f4x7_eth_conf.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4x7_eth_conf.h
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date 31-October-2011
  7. * @brief Configuration file for the STM32F4x7 Ethernet driver.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  12. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  13. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  14. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  15. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  16. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  17. *
  18. * <h2><center>&copy; Portions COPYRIGHT 2011 STMicroelectronics</center></h2>
  19. ******************************************************************************
  20. */
  21. /**
  22. ******************************************************************************
  23. * <h2><center>&copy; Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.</center></h2>
  24. * @file stm32f4x7_eth_conf.h
  25. * @author CMP Team
  26. * @version V1.0.0
  27. * @date 28-December-2012
  28. * @brief Configuration file for the STM32F4x7 Ethernet driver.
  29. * Modified to support the STM32F4DISCOVERY, STM32F4DIS-BB and
  30. * STM32F4DIS-LCD modules.
  31. ******************************************************************************
  32. * @attention
  33. *
  34. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  35. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  36. * TIME. AS A RESULT, Embest SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
  37. * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
  38. * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
  39. * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  40. ******************************************************************************
  41. */
  42. /* Define to prevent recursive inclusion -------------------------------------*/
  43. #ifndef __STM32F4x7_ETH_CONF_H
  44. #define __STM32F4x7_ETH_CONF_H
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. /* Includes ------------------------------------------------------------------*/
  49. #include "stm32f4xx.h"
  50. /* Exported types ------------------------------------------------------------*/
  51. /* Exported constants --------------------------------------------------------*/
  52. /* Uncomment the line below when using time stamping and/or IPv4 checksum offload */
  53. #define USE_ENHANCED_DMA_DESCRIPTORS
  54. /* Uncomment the line below if you want to use user defined Delay function
  55. (for precise timing), otherwise default _eth_delay_ function defined within
  56. the Ethernet driver is used (less precise timing) */
  57. //#define USE_Delay
  58. #ifdef USE_Delay
  59. #include "main.h" /* Header file where the Delay function prototype is exported */
  60. #define _eth_delay_ Delay /* User can provide more timing precise _eth_delay_ function */
  61. #else
  62. #define _eth_delay_ ETH_Delay /* Default _eth_delay_ function with less precise timing */
  63. #endif
  64. /* Uncomment the line below to allow custom configuration of the Ethernet driver buffers */
  65. //#define CUSTOM_DRIVER_BUFFERS_CONFIG
  66. #ifdef CUSTOM_DRIVER_BUFFERS_CONFIG
  67. /* Redefinition of the Ethernet driver buffers size and count */
  68. #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
  69. #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
  70. #define ETH_RXBUFNB 20 /* 20 Rx buffers of size ETH_RX_BUF_SIZE */
  71. #define ETH_TXBUFNB 5 /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
  72. #endif
  73. /* PHY configuration section **************************************************/
  74. /* PHY Reset delay */
  75. #define PHY_RESET_DELAY ((uint32_t)0x000FFFFF)
  76. /* PHY Configuration delay */
  77. #define PHY_CONFIG_DELAY ((uint32_t)0x00FFFFFF)
  78. /* The PHY status register value change from a PHY to another, so the user have
  79. to update this value depending on the used external PHY */
  80. #define PHY_SR ((uint16_t)31) /* Value for DP83848 PHY */
  81. /* The Speed and Duplex mask values change from a PHY to another, so the user
  82. have to update this value depending on the used external PHY */
  83. #define PHY_DUPLEX_SPEED_STATUS_MASK ((uint16_t)0x001C)
  84. #define PHY_100BTX_FULL (18)
  85. #define PHY_100BTX_HALF (8)
  86. #define PHY_10M_FULL (14)
  87. #define PHY_10M_HALF (4)
  88. /* Exported macro ------------------------------------------------------------*/
  89. /* Exported functions ------------------------------------------------------- */
  90. #ifdef __cplusplus
  91. }
  92. #endif
  93. #endif /* __STM32F4x7_ETH_CONF_H */
  94. /*********** Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.*****END OF FILE****/