81static inline void hw_eth_init(
void);
90static inline void hw_eth_init(
void) {
94 __HAL_RCC_AFIO_CLK_ENABLE();
97 __HAL_RCC_GPIOA_CLK_ENABLE();
98 __HAL_RCC_GPIOB_CLK_ENABLE();
99 __HAL_RCC_GPIOC_CLK_ENABLE();
102 GPIO_InitStructure.
Pin = GPIO_PIN_8;
103 GPIO_InitStructure.
Mode = GPIO_MODE_AF_PP;
106 HAL_GPIO_Init(
GPIOA, &GPIO_InitStructure);
109 HAL_RCC_MCOConfig(RCC_MCO1, RCC_MCO1SOURCE_SYSCLK, 1);
112 __HAL_AFIO_ETH_RMII();
115 GPIO_InitStructure.
Pin = GPIO_PIN_2;
116 GPIO_InitStructure.
Mode = GPIO_MODE_AF_PP;
119 HAL_GPIO_Init(
GPIOA, &GPIO_InitStructure);
122 GPIO_InitStructure.
Pin = GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13;
123 GPIO_InitStructure.
Mode = GPIO_MODE_AF_PP;
126 HAL_GPIO_Init(
GPIOB, &GPIO_InitStructure);
129 GPIO_InitStructure.
Pin = GPIO_PIN_1;
130 GPIO_InitStructure.
Mode = GPIO_MODE_AF_PP;
133 HAL_GPIO_Init(
GPIOC, &GPIO_InitStructure);
136 GPIO_InitStructure.
Pin = GPIO_PIN_1 | GPIO_PIN_7;
140 HAL_GPIO_Init(
GPIOA, &GPIO_InitStructure);
143 GPIO_InitStructure.
Pin = GPIO_PIN_4 | GPIO_PIN_5;
147 HAL_GPIO_Init(
GPIOC, &GPIO_InitStructure);
150 __HAL_AFIO_REMAP_ETH_DISABLE();
#define GPIOC
Definition MK60D10.h:6918
#define GPIOB
Definition MK60D10.h:6914
#define GPIOA
Definition MK60D10.h:6910
#define GPIO_MODE_AF_INPUT
Definition stm32f1xx_hal_gpio.h:121
#define GPIO_NOPULL
Definition stm32f1xx_hal_gpio.h:153
#define GPIO_SPEED_FREQ_HIGH
Definition stm32f1xx_hal_gpio.h:143
void stm32f1xxEthInitGpio(NetInterface *interface)
Externally linked API for ETH configuration.
Definition hw_eth.h:86
This file contains all the functions prototypes for the HAL module driver.
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 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