89static inline void hw_eth_init(
void);
105static inline void hw_eth_init(
void) {
109 __HAL_RCC_SYSCFG_CLK_ENABLE();
112 __HAL_RCC_GPIOA_CLK_ENABLE();
113 __HAL_RCC_GPIOB_CLK_ENABLE();
114 __HAL_RCC_GPIOC_CLK_ENABLE();
117 GPIO_InitStructure.
Pin = GPIO_PIN_8;
118 GPIO_InitStructure.
Mode = GPIO_MODE_AF_PP;
121 HAL_GPIO_Init(
GPIOA, &GPIO_InitStructure);
132 GPIO_InitStructure.
Mode = GPIO_MODE_AF_PP;
135 GPIO_InitStructure.
Alternate = GPIO_AF11_ETH;
138 GPIO_InitStructure.
Pin = GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7;
139 HAL_GPIO_Init(
GPIOA, &GPIO_InitStructure);
142 GPIO_InitStructure.
Pin = GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13;
143 HAL_GPIO_Init(
GPIOB, &GPIO_InitStructure);
146 GPIO_InitStructure.
Pin = GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5;
147 HAL_GPIO_Init(
GPIOC, &GPIO_InitStructure);
151 HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_PLLCLK, RCC_MCODIV_3);
152 #elif defined STM32F7
154 HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_PLLCLK, RCC_MCODIV_4);
#define GPIOC
Definition MK60D10.h:6918
#define GPIOB
Definition MK60D10.h:6914
#define GPIOA
Definition MK60D10.h:6910
#define GPIO_NOPULL
Definition stm32f1xx_hal_gpio.h:153
#define GPIO_SPEED_FREQ_VERY_HIGH
Definition stm32f2xx_hal_gpio.h:144
#define GPIO_SPEED_FREQ_HIGH
Definition stm32f1xx_hal_gpio.h:143
#define SYSCFG_PMC_MII_RMII_SEL
Definition stm32f207xx.h:11111
#define SYSCFG_ETH_RMII
Definition stm32h7xx_hal.h:153
void stm32f7xxEthInitGpio(NetInterface *interface)
Externally linked API for ETH configuration.
Definition hw_eth.h:101
void stm32f4xxEthInitGpio(NetInterface *interface)
Externally linked API for ETH configuration.
Definition hw_eth.h:94
Header file of GPIO HAL module.
Header file of RCC HAL module.
Header file of GPIO HAL module.
Header file of RCC HAL module.
This file contains all the functions prototypes for the HAL module driver.
Header file of GPIO HAL module.
Header file of RCC HAL module.
GPIO Init structure definition.
Definition stm32f1xx_hal_gpio.h:48
uint32_t Mode
Definition stm32f1xx_hal_gpio.h:52
uint32_t Alternate
Definition stm32f2xx_hal_gpio.h:61
uint32_t Pull
Definition stm32f1xx_hal_gpio.h:55
uint32_t Pin
Definition stm32f1xx_hal_gpio.h:49
uint32_t Speed
Definition stm32f1xx_hal_gpio.h:58