84static inline void hw_eth_init(
void);
100static inline void hw_eth_init(
void) {
104 __HAL_RCC_SYSCFG_CLK_ENABLE();
107 __HAL_RCC_GPIOA_CLK_ENABLE();
108 __HAL_RCC_GPIOC_CLK_ENABLE();
109 __HAL_RCC_GPIOG_CLK_ENABLE();
112 GPIO_InitStructure.
Pin = GPIO_PIN_8;
113 GPIO_InitStructure.
Mode = GPIO_MODE_AF_PP;
116 HAL_GPIO_Init(
GPIOA, &GPIO_InitStructure);
122 GPIO_InitStructure.
Mode = GPIO_MODE_AF_PP;
125 GPIO_InitStructure.
Alternate = GPIO_AF11_ETH;
128 GPIO_InitStructure.
Pin = GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7;
129 HAL_GPIO_Init(
GPIOA, &GPIO_InitStructure);
132 GPIO_InitStructure.
Pin = GPIO_PIN_11 | GPIO_PIN_13 | GPIO_PIN_14;
133 HAL_GPIO_Init(GPIOG, &GPIO_InitStructure);
136 GPIO_InitStructure.
Pin = GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5;
137 HAL_GPIO_Init(
GPIOC, &GPIO_InitStructure);
141 HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_PLLCLK, RCC_MCODIV_3);
142 #elif defined STM32F7
144 HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_PLLCLK, RCC_MCODIV_4);
#define GPIOC
Definition MK60D10.h:6918
#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
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.
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