/********************************************************************************************************* * Module : led * Abstract : * Version : 1.0.0 * Author : Leopul(COPYRIGHT 2025 ~ 2027 Leopul. All rights reserved.) * Complete : 2025-04-09 * Content : None * Note : None *********************************************************************************************************/ #include "led.h" #include "common.h" #include "gd32e23x.h" static void led_flash(void); void led_init(void) { board_t * board = get_board(); rcu_periph_clock_enable(RCU_GPIOC); gpio_mode_set(GPIOC,GPIO_MODE_OUTPUT,GPIO_PUPD_PULLUP,GPIO_PIN_13); gpio_output_options_set(GPIOC, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13); gpio_bit_set(GPIOC,GPIO_PIN_13); board->led_flash = led_flash; } static void led_flash(void) { gpio_bit_toggle(GPIOC,GPIO_PIN_13); }