| 1234567891011121314151617181920212223242526272829303132333435363738 |
- /*********************************************************************************************************
- * Module : Fans.c
- * Abstract : Fans modules is used to cool down the device!
- * Version : 1.0.0
- * Author : Leopul(COPYRIGHT 2025 - 2027 Leopul. All rights reserved.)
- * Complete : 2025-02-16
- * Content : None
- * Note : None
- *********************************************************************************************************/
- #include "Fan.h"
- #include "gd32e230x_conf.h"
- #include "main.h"
- void fans_init(void)
- {
- rcu_periph_clock_enable(RCU_GPIOB);
- gpio_mode_set(GPIOB, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_6);
- gpio_output_options_set(GPIOB, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_6);
- gpio_bit_reset(GPIOB, GPIO_PIN_6);
-
- sts_data_t *data = get_sts();
- data->fans = fans_on_off;
- }
- void fans_on_off(unsigned char status)
- {
- if(status == FANS_OFF)
- {
- gpio_bit_reset(GPIOB, GPIO_PIN_6);
- }else if(status == FANS_ON)
- {
- gpio_bit_set(GPIOB, GPIO_PIN_6);
- }else{
-
- }
- }
|