| 12345678910111213141516171819202122232425262728293031 |
- /*********************************************************************************************************
- * 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_GPIOB);
- gpio_mode_set(GPIOB,GPIO_MODE_OUTPUT,GPIO_PUPD_PULLUP,GPIO_PIN_11);
- gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_11);
- gpio_bit_set(GPIOB,GPIO_PIN_11);
- board->led_flash = led_flash;
- }
- static void led_flash(void)
- {
- gpio_bit_toggle(GPIOB,GPIO_PIN_11);
- }
|