stm32f4x7_eth_conf.h


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; COPYRIGHT 2011 STMicroelectronics</center></h2>
19
  ******************************************************************************
20
  */
21
22
/* Define to prevent recursive inclusion -------------------------------------*/
23
#ifndef __STM32F4x7_ETH_CONF_H
24
#define __STM32F4x7_ETH_CONF_H
25
26
#ifdef __cplusplus
27
 extern "C" {
28
#endif
29
30
/* Includes ------------------------------------------------------------------*/
31
#include "stm32f4xx.h"
32
33
/* Exported types ------------------------------------------------------------*/
34
/* Exported constants --------------------------------------------------------*/
35
36
/* Uncomment the line below when using time stamping and/or IPv4 checksum offload */
37
#define USE_ENHANCED_DMA_DESCRIPTORS
38
39
/* Uncomment the line below if you want to use user defined Delay function
40
   (for precise timing), otherwise default _eth_delay_ function defined within
41
   the Ethernet driver is used (less precise timing) */
42
#define USE_Delay
43
44
#ifdef USE_Delay
45
  #include "main.h"
46
  #define _eth_delay_    Delay     /* User can provide more timing precise _eth_delay_ function */
47
#else
48
  #define _eth_delay_    ETH_Delay /* Default _eth_delay_ function with less precise timing */
49
#endif
50
51
52
/* Uncomment the line below to allow custom configuration of the Ethernet driver buffers */    
53
#define CUSTOM_DRIVER_BUFFERS_CONFIG   
54
55
#ifdef  CUSTOM_DRIVER_BUFFERS_CONFIG
56
/* Redefinition of the Ethernet driver buffers size and count */   
57
 #define ETH_RX_BUF_SIZE    ETH_MAX_PACKET_SIZE /* buffer size for receive */
58
 #define ETH_TX_BUF_SIZE    ETH_MAX_PACKET_SIZE /* buffer size for transmit */
59
 #define ETH_RXBUFNB        4                   /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
60
 #define ETH_TXBUFNB        4                   /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
61
#endif
62
63
64
/* PHY configuration section **************************************************/
65
#ifdef USE_Delay
66
/* PHY Reset delay */ 
67
#define PHY_RESET_DELAY    ((uint32_t)0x000000FF)
68
/* PHY Configuration delay */
69
#define PHY_CONFIG_DELAY   ((uint32_t)0x00000FFF)
70
/* Delay when writing to Ethernet registers*/
71
#define ETH_REG_WRITE_DELAY ((uint32_t)0x00000001)
72
#else
73
/* PHY Reset delay */
74
#define PHY_RESET_DELAY    ((uint32_t)0x000FFFFF)
75
/* PHY Configuration delay */
76
#define PHY_CONFIG_DELAY   ((uint32_t)0x00FFFFFF)
77
/* Delay when writing to Ethernet registers*/
78
#define ETH_REG_WRITE_DELAY ((uint32_t)0x0000FFFF)
79
#endif
80
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_SPEED_STATUS            ((uint16_t)0x0004) /* Value for LAN8710A PHY */
84
#define PHY_DUPLEX_STATUS           ((uint16_t)0x0010) /* Value for LAN8710A PHY */
85
#define PHY_LINKED_STATUS           ((uint16_t)0x0004) /* Value for LAN8710A PHY */
86
87
88
/* Exported macro ------------------------------------------------------------*/
89
/* Exported functions ------------------------------------------------------- */  
90
91
#ifdef __cplusplus
92
}
93
#endif
94
95
#endif /* __STM32F4x7_ETH_CONF_H */
96
97
98
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/