Skip to content

Commit e0fb062

Browse files
authored
Merge pull request #3649 from adustm/STM32F7_folderstruct
[STM32F7] Modify folder structure
2 parents 15cbf66 + 0e70959 commit e0fb062

File tree

93 files changed

+1673
-9754
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1673
-9754
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#include "stm32f7xx_hal.h"
2+
3+
/**
4+
* Override HAL Eth Init function
5+
*/
6+
void HAL_ETH_MspInit(ETH_HandleTypeDef* heth)
7+
{
8+
GPIO_InitTypeDef GPIO_InitStructure;
9+
if (heth->Instance == ETH) {
10+
/* Disable DCache for STM32F7 family */
11+
SCB_DisableDCache();
12+
13+
/* Enable GPIOs clocks */
14+
__HAL_RCC_GPIOA_CLK_ENABLE();
15+
__HAL_RCC_GPIOB_CLK_ENABLE();
16+
__HAL_RCC_GPIOC_CLK_ENABLE();
17+
__HAL_RCC_GPIOG_CLK_ENABLE();
18+
19+
/** ETH GPIO Configuration
20+
RMII_REF_CLK ----------------------> PA1
21+
RMII_MDIO -------------------------> PA2
22+
RMII_MDC --------------------------> PC1
23+
RMII_MII_CRS_DV -------------------> PA7
24+
RMII_MII_RXD0 ---------------------> PC4
25+
RMII_MII_RXD1 ---------------------> PC5
26+
RMII_MII_RXER ---------------------> PG2
27+
RMII_MII_TX_EN --------------------> PG11
28+
RMII_MII_TXD0 ---------------------> PG13
29+
RMII_MII_TXD1 ---------------------> PB13
30+
*/
31+
/* Configure PA1, PA2 and PA7 */
32+
GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;
33+
GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
34+
GPIO_InitStructure.Pull = GPIO_NOPULL;
35+
GPIO_InitStructure.Alternate = GPIO_AF11_ETH;
36+
GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7;
37+
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
38+
39+
/* Configure PB13 */
40+
GPIO_InitStructure.Pin = GPIO_PIN_13;
41+
HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);
42+
43+
/* Configure PC1, PC4 and PC5 */
44+
GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5;
45+
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
46+
47+
/* Configure PG2, PG11 and PG13 */
48+
GPIO_InitStructure.Pin = GPIO_PIN_2 | GPIO_PIN_11 | GPIO_PIN_13;
49+
HAL_GPIO_Init(GPIOG, &GPIO_InitStructure);
50+
51+
/* Enable the Ethernet global Interrupt */
52+
HAL_NVIC_SetPriority(ETH_IRQn, 0x7, 0);
53+
HAL_NVIC_EnableIRQ(ETH_IRQn);
54+
55+
/* Enable ETHERNET clock */
56+
__HAL_RCC_ETH_CLK_ENABLE();
57+
}
58+
}
59+
60+
/**
61+
* Override HAL Eth DeInit function
62+
*/
63+
void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
64+
{
65+
if (heth->Instance == ETH) {
66+
/* Peripheral clock disable */
67+
__HAL_RCC_ETH_CLK_DISABLE();
68+
69+
/** ETH GPIO Configuration
70+
RMII_REF_CLK ----------------------> PA1
71+
RMII_MDIO -------------------------> PA2
72+
RMII_MDC --------------------------> PC1
73+
RMII_MII_CRS_DV -------------------> PA7
74+
RMII_MII_RXD0 ---------------------> PC4
75+
RMII_MII_RXD1 ---------------------> PC5
76+
RMII_MII_RXER ---------------------> PG2
77+
RMII_MII_TX_EN --------------------> PG11
78+
RMII_MII_TXD0 ---------------------> PG13
79+
RMII_MII_TXD1 ---------------------> PB13
80+
*/
81+
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7);
82+
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13);
83+
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5);
84+
HAL_GPIO_DeInit(GPIOG, GPIO_PIN_2 | GPIO_PIN_11 | GPIO_PIN_13);
85+
86+
/* Disable the Ethernet global Interrupt */
87+
NVIC_DisableIRQ(ETH_IRQn);
88+
}
89+
}

targets/TARGET_STM/TARGET_STM32F7/TARGET_F746_F756/TARGET_NUCLEO_F746ZG/device/stm32f746xx.h

Lines changed: 0 additions & 9473 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F7/TARGET_F746_F756/TARGET_NUCLEO_F746ZG/device/stm32f7xx.h

Lines changed: 0 additions & 230 deletions
This file was deleted.

0 commit comments

Comments
 (0)