stm32f2x7_eth_conf.h 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**
  2. ******************************************************************************
  3. * @file stm32f2x7_eth_conf.h
  4. * @author MCD Application Team
  5. * @version V1.1.0
  6. * @date 07-October-2011
  7. * @brief Configuration file for the STM32F2x7 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; COPYRIGHT 2011 STMicroelectronics</center></h2>
  19. ******************************************************************************
  20. */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __STM32F2x7_ETH_CONF_H
  23. #define __STM32F2x7_ETH_CONF_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f2xx.h"
  29. /* Exported types ------------------------------------------------------------*/
  30. /* Exported constants --------------------------------------------------------*/
  31. /* Uncomment the line below when using time stamping and/or IPv4 checksum offload */
  32. //#define USE_ENHANCED_DMA_DESCRIPTORS
  33. /* Uncomment the line below if you want to use user defined Delay function
  34. (for precise timing), otherwise default _eth_delay_ function defined within
  35. the Ethernet driver is used (less precise timing) */
  36. //#define USE_Delay
  37. #ifdef USE_Delay
  38. #include "main.h" /* Header file where the Delay function prototype is exported */
  39. #define _eth_delay_ Delay /* User can provide more timing precise _eth_delay_ function */
  40. #else
  41. #define PHY_RESET_DELAY ((uint32_t)0x000FFFFF)
  42. /* PHY Configuration delay */
  43. #define PHY_CONFIG_DELAY ((uint32_t)0x00FFFFFF)
  44. /* Delay when writing to Ethernet registers*/
  45. #define ETH_REG_WRITE_DELAY ((uint32_t)0x0000FFFF)
  46. void ETH_Delay(__IO uint32_t nCount);
  47. #define _eth_delay_ ETH_Delay /* Default _eth_delay_ function with less precise timing */
  48. #endif
  49. /* Uncomment the line below to allow custom configuration of the Ethernet driver buffers */
  50. //#define CUSTOM_DRIVER_BUFFERS_CONFIG
  51. #ifdef CUSTOM_DRIVER_BUFFERS_CONFIG
  52. /* Redefinition of the Ethernet driver buffers size and count */
  53. #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
  54. #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
  55. #define ETH_RXBUFNB 20 /* 20 Rx buffers of size ETH_RX_BUF_SIZE */
  56. #define ETH_TXBUFNB 5 /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
  57. #endif
  58. /* PHY configuration section **************************************************/
  59. /* PHY Reset delay */
  60. #define PHY_RESET_DELAY ((uint32_t)0x000FFFFF)
  61. /* PHY Configuration delay */
  62. #define PHY_CONFIG_DELAY ((uint32_t)0x00FFFFFF)
  63. /* The PHY status register value change from a PHY to another, so the user have
  64. to update this value depending on the used external PHY */
  65. #define PHY_SR ((uint16_t)16) /* Value for DP83848 PHY */
  66. /* The Speed and Duplex mask values change from a PHY to another, so the user
  67. have to update this value depending on the used external PHY */
  68. #define PHY_SPEED_STATUS ((uint16_t)0x0002) /* Value for DP83848 PHY */
  69. #define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /* Value for DP83848 PHY */
  70. /* Exported macro ------------------------------------------------------------*/
  71. /* Exported functions ------------------------------------------------------- */
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75. #endif /* __STM32F2x7_ETH_CONF_H */
  76. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/