Skip to content

Add support for GD32F307VG #8725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
Dec 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6403b9c
Add GD32F307VG
ChazJin Oct 17, 2018
9752a9b
Re add target support for GD32F307VG
ChazJin Nov 13, 2018
55a4261
Delete added information (GD32F307VG)
ChazJin Nov 13, 2018
eb39c48
Add EMAC driver for GD32_F307VG
ChazJin Nov 13, 2018
cc94bfa
Update licence
ChazJin Nov 13, 2018
49b25c9
Update licence
ChazJin Nov 13, 2018
42bffe2
Update licence
ChazJin Nov 13, 2018
0d4bb5c
Add support for GD32F307VG
ChazJin Nov 15, 2018
d44ef27
Delete a button definition
ChazJin Nov 15, 2018
c566757
Add it to replace startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
369eec8
Delete startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
7e480f0
Add it to replace startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
6adb048
Add it to replace startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
200c28b
Add it to replace startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
37744d8
Delete startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
a4a19fa
Delete startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
218fee8
Delete startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
644cc53
Consistent with the remote repo and add GD32F307VG
ChazJin Nov 18, 2018
7dc05a4
Add GD32F307VG
ChazJin Oct 17, 2018
1afb50d
Re add target support for GD32F307VG
ChazJin Nov 13, 2018
e20ddac
Delete added information (GD32F307VG)
ChazJin Nov 13, 2018
700f3a2
Add EMAC driver for GD32_F307VG
ChazJin Nov 13, 2018
9131b3f
Update licence
ChazJin Nov 13, 2018
d2e731b
Update licence
ChazJin Nov 13, 2018
61d3bc8
Update licence
ChazJin Nov 13, 2018
bb1e4a7
Add support for GD32F307VG
ChazJin Nov 15, 2018
d2779a6
Delete a button definition
ChazJin Nov 15, 2018
c8cadd6
Add it to replace startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
0728dde
Add it to replace startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
16ff28d
Add it to replace startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
b6e455c
Add it to replace startup_gd32f30x_cl.s
ChazJin Nov 16, 2018
9ee4af6
Remove the "device_name": "GD32F307VG"
ChazJin Nov 16, 2018
2b9071a
conflicts resolve
ChazJin Nov 18, 2018
6126621
Delete startup_gd32f30x_cl.s
ChazJin Nov 18, 2018
db27eab
Delete startup_gd32f30x_cl.s
ChazJin Nov 18, 2018
2b90f34
Delete startup_gd32f30x_cl.s
ChazJin Nov 18, 2018
36a2732
Delete startup_gd32f30x_cl.s
ChazJin Nov 18, 2018
787cdbe
Delete added information (GD32F307VG)
ChazJin Nov 18, 2018
5a15f81
Error modification
ChazJin Nov 19, 2018
62e34ec
Add SPDX identifier
ChazJin Nov 21, 2018
a9ce7a6
Add SPDX identifier for GD EMAC driver
ChazJin Nov 21, 2018
95f7a97
Add MPU label and fix labels alignment
ChazJin Nov 30, 2018
881561a
Error resolve, bug fix and 2 new targets information add
ChazJin Dec 6, 2018
ca46d12
Delete GD32F450ZI and GD323103VB which are not implemented
ChazJin Dec 7, 2018
6ac625d
Style Format for GD32F30x standard peripheral files
ChazJin Dec 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/* mbed Microcontroller Library
* Copyright (c) 2018 GigaDevice Semiconductor Inc.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "gd32f30x.h"

/**
* Initializes the HW pin for enet
*
*/
void enet_bsp_init(void)
{
/* Enable GPIOs clocks */
rcu_periph_clock_enable(RCU_GPIOA);
rcu_periph_clock_enable(RCU_GPIOB);
rcu_periph_clock_enable(RCU_GPIOC);
rcu_periph_clock_enable(RCU_AF);

gpio_para_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_MAX, GPIO_PIN_8);
rcu_pll2_config(RCU_PLL2_MUL10);
rcu_osci_on(RCU_PLL2_CK);
rcu_osci_stab_wait(RCU_PLL2_CK);
rcu_ckout0_config(RCU_CKOUT0SRC_CKPLL2);
gpio_ethernet_phy_select(GPIO_ENET_PHY_RMII);

/** ETH GPIO Configuration
RMII_REF_CLK ----------------------> PA1
RMII_MDIO -------------------------> PA2
RMII_MDC --------------------------> PC1
RMII_MII_CRS_DV -------------------> PA7
RMII_MII_RXD0 ---------------------> PC4
RMII_MII_RXD1 ---------------------> PC5
RMII_MII_TX_EN --------------------> PB11
RMII_MII_TXD0 ---------------------> PB12
RMII_MII_TXD1 ---------------------> PB13
*/
/* PA1: ETH_RMII_REF_CLK */
gpio_para_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_MAX, GPIO_PIN_1);
/* PA2: ETH_MDIO */
gpio_para_init(GPIOA, GPIO_MODE_AF_PP, GPIO_OSPEED_MAX, GPIO_PIN_2);
/* PA7: ETH_RMII_CRS_DV */
gpio_para_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_MAX, GPIO_PIN_7);

/* PB11: ETH_RMII_TX_EN */
gpio_para_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_MAX, GPIO_PIN_11);
/* PB12: ETH_RMII_TXD0 */
gpio_para_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_MAX, GPIO_PIN_12);
/* PB13: ETH_RMII_TXD1 */
gpio_para_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_MAX, GPIO_PIN_13);

/* PC1: ETH_MDC */
gpio_para_init(GPIOC, GPIO_MODE_AF_PP, GPIO_OSPEED_MAX, GPIO_PIN_1);
/* PC4: ETH_RMII_RXD0 */
gpio_para_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_MAX, GPIO_PIN_4);
/* PC5: ETH_RMII_RXD1 */
gpio_para_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_MAX, GPIO_PIN_5);

/* Enable the Ethernet global Interrupt */
nvic_irq_enable(ENET_IRQn, 0x7, 0);

/* Enable ETHERNET clock */
rcu_periph_clock_enable(RCU_ENET);
rcu_periph_clock_enable(RCU_ENETTX);
rcu_periph_clock_enable(RCU_ENETRX);
}
Loading