萤火工场 GD32VW553-IOT-V2 简易点灯

分享作者:62ewg3j2_3425
作者昵称:巫山1204
评测品牌:萤火工场
评测型号:GD32VW553-IOT-V2
发布时间:2026-06-25 10:24:32
1
概要
GD32VW553是兆易创新的国产RISC-V物联网开发板,上架于iCEasy商城,板载WiFi蓝牙双模,配置精简实用、做工扎实,适配单片机入门与科创实训。 本次通过经典点灯实验实测,旨在验证该开发板的上手难度、官方工程适配度及硬件运行稳定性,为新手选购提供真实参考。
开源口碑分享内容


/*!

\file main.c

\brief led spark with systick, USART print and key example


\version 2026-02-04, V1.6.0, firmware for GD32VW55x

*/


/*

Copyright (c) 2026, GigaDevice Semiconductor Inc.


Redistribution and use in source and binary forms, with or without modification,

are permitted provided that the following conditions are met:


1. Redistributions of source code must retain the above copyright notice, this

list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,

this list of conditions and the following disclaimer in the documentation

and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors

may be used to endorse or promote products derived from this software without

specific prior written permission.


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"

AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED

WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.

IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,

INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT

NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR

PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,

WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)

ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY

OF SUCH DAMAGE.

*/


#include "gd32vw55x.h"

#include "systick.h"

#include <stdio.h>

#include "main.h"

#include "gd32vw553h_eval.h"


#define LED1_PIN GPIO_PIN_2

#define LED1_GPIO_PORT GPIOB

#define LED1_GPIO_CLK RCU_GPIOB



/*!

\brief toggle the led every 500ms

\param[in] none

\param[out] none

\retval none

*/

void led_spark(void)

{

static __IO uint32_t timingdelaylocal = 0U;


if(timingdelaylocal) {


if(timingdelaylocal < 500U) {

gd_eval_led_on(LED1);

//gd_eval_led_on(LED3);

} else {

gd_eval_led_off(LED1);

//gd_eval_led_off(LED3);

}


timingdelaylocal--;

} else {

timingdelaylocal = 1000U;

}

}


/*!

\brief main function

\param[in] none

\param[out] none

\retval none

*/

int main(void)

{

#ifdef __FIRMWARE_VERSION_DEFINE

uint32_t fw_ver = 0;

#endif /* __FIRMWARE_VERSION_DEFINE */


/* configure systick */

systick_config();

eclic_priority_group_set(ECLIC_PRIGROUP_LEVEL3_PRIO1);

/* initilize the LEDs, USART and key */

gd_eval_led_init(LED1);

gd_eval_led_init(LED2);

gd_eval_led_init(LED3);

gd_eval_com_init(EVAL_COM0);

gd_eval_key_init(KEY_TAMPER_WAKEUP, KEY_MODE_GPIO);


#ifdef __FIRMWARE_VERSION_DEFINE

fw_ver = gd32vw55x_firmware_version_get();

/* print firmware version */

printf("\r\nGD32VW55X series firmware version: V%d.%d.%d", (uint8_t)(fw_ver >> 24), (uint8_t)(fw_ver >> 16), (uint8_t)(fw_ver >> 8));

#endif /* __FIRMWARE_VERSION_DEFINE */


/* print out the clock frequency of system, AHB, APB1 and APB2 */

printf("\r\nCK_SYS is %d\r\n", rcu_clock_freq_get(CK_SYS));

printf("\r\nCK_AHB is %d\r\n", rcu_clock_freq_get(CK_AHB));

printf("\r\nCK_APB1 is %d\r\n", rcu_clock_freq_get(CK_APB1));

printf("\r\nCK_APB2 is %d\r\n", rcu_clock_freq_get(CK_APB2));


while(1) {

if(RESET == gd_eval_key_state_get(KEY_TAMPER_WAKEUP)) {

delay_1ms(50);

if(SET == gd_eval_key_state_get(KEY_TAMPER_WAKEUP)) {

gd_eval_led_toggle(LED1);

}

}

}

}


全部评论
暂无评论
0/144