stm32f4x7_eth_conf_template.h 3.8 KB

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