| 123456789101112131415161718192021222324252627282930313233343536373839 |
- /*********************************************************************************************************
- * Module : Beep.c
- * Abstract : Beep modules is generated alarms!
- * Version : 1.0.0
- * Author : Leopul(COPYRIGHT 2025 - 2027 Leopul. All rights reserved.)
- * Complete : 2025-02-16
- * Content : None
- * Note : None
- *********************************************************************************************************/
- #include "Beep.h"
- #include "gd32e230x_conf.h"
- #include "main.h"
- static void beep(void)
- {
- gpio_bit_toggle(GPIOB, GPIO_PIN_1);
- }
- static void clear_beep(void)
- {
- gpio_bit_reset(GPIOB, GPIO_PIN_1);
- }
- void beep_init(void)
- {
- rcu_periph_clock_enable(RCU_GPIOB);
-
- gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_1);
- gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_1);
- gpio_bit_reset(GPIOB, GPIO_PIN_1);
-
- sts_data_t *data = get_sts();
- data->beep = beep;
- data->clear_beep = clear_beep;
- }
|