stm32f4x7_eth_bsp.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4x7_eth_bsp.h
  4. * @author MCD Application Team
  5. * @version V1.1.0
  6. * @date 31-July-2013
  7. * @brief Header for stm32f4x7_eth_bsp.c file.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2>
  12. *
  13. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  14. * You may not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at:
  16. *
  17. * http://www.st.com/software_license_agreement_liberty_v2
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an "AS IS" BASIS,
  21. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. *
  25. ******************************************************************************
  26. */
  27. /* Define to prevent recursive inclusion -------------------------------------*/
  28. #ifndef __STM32F4x7_ETH_BSP_H
  29. #define __STM32F4x7_ETH_BSP_H
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. #include "netif.h"
  34. /* Exported types ------------------------------------------------------------*/
  35. /* Exported constants --------------------------------------------------------*/
  36. #define DP83848_PHY_ADDRESS ((uint16_t) 0x01)
  37. /* Specific defines for EXTI line, used to manage Ethernet link status */
  38. #define ETH_LINK_EXTI_LINE EXTI_Line14
  39. #define ETH_LINK_EXTI_PORT_SOURCE EXTI_PortSourceGPIOB
  40. #define ETH_LINK_EXTI_PIN_SOURCE EXTI_PinSource14
  41. #define ETH_LINK_EXTI_IRQn EXTI15_10_IRQn
  42. /* PB14 */
  43. #define ETH_LINK_PIN GPIO_Pin_14
  44. #define ETH_LINK_GPIO_PORT GPIOB
  45. #define ETH_LINK_GPIO_CLK RCC_AHB1Periph_GPIOB
  46. /* Ethernet Flags for EthStatus variable */
  47. #define ETH_INIT_FLAG 0x01 /* Ethernet Init Flag */
  48. #define ETH_LINK_FLAG 0x10 /* Ethernet Link Flag */
  49. /* Exported macro ------------------------------------------------------------*/
  50. /* Exported functions ------------------------------------------------------- */
  51. void ETH_BSP_Config(void);
  52. uint32_t Eth_Link_PHYITConfig(uint16_t PHYAddress);
  53. void Eth_Link_EXTIConfig(void);
  54. void Eth_Link_ITHandler(uint16_t PHYAddress);
  55. void ETH_link_callback(struct netif *netif);
  56. extern __IO uint32_t EthStatus; /* Ìṩ¸øÖ÷³ÌÐòʹÓà */
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* __STM32F4x7_ETH_BSP_H */
  61. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/