| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- /*********************************************************************************************************
- * 模块名称:Relay.h
- * 摘 要:Relay模块
- * 当前版本:1.0.0
- * 作 者:liyi(COPYRIGHT 2024 - ~. All rights reserved.)
- * 完成日期:2024年07月30日
- * 内 容:
- * 注 意:
- **********************************************************************************************************
- * 取代版本:
- * 作 者:
- * 完成日期:
- * 修改内容:
- * 修改文件:
- *********************************************************************************************************/
- #ifndef _RELAY_H_
- #define _RELAY_H_
- /*********************************************************************************************************
- * 包含头文件
- *********************************************************************************************************/
- #include "gd32e230x_conf.h"
- /*********************************************************************************************************
- * 宏定义
- *********************************************************************************************************/
- #define LK_Relay_D 1
- //#define RELAY9 8
- //#define RELAY8 7
- //#define RELAY7 6
- //#define RELAY6 5
- //#define RELAY5 4
- #define RELAY4 3
- #define RELAY3 2
- #define RELAY2 1
- #define RELAY1 0
- #define RELAY_ON 1
- #define RELAY_OFF 0
- #define Data_Output_RCU_A RCU_GPIOA
- #define Data_Output_RCU_B RCU_GPIOB
- #define DB_Out4 GPIO_PIN_5 // N
- #define DB_Out3 GPIO_PIN_4 // L3
- #define DB_Out2 GPIO_PIN_3 // L2
- #define DB_Out1 GPIO_PIN_15 // L1
- #define Data_Output_IO_A GPIOA
- #define Data_Output_IO_B GPIOB
- #define DB_Out1_L gpio_bit_reset(Data_Output_IO_A, DB_Out1) // 输出低电平
- #define DB_Out1_H gpio_bit_set(Data_Output_IO_A,DB_Out1) // 输出高电平
- #define DB_Out2_L gpio_bit_reset(Data_Output_IO_B, DB_Out2) // 输出低电平
- #define DB_Out2_H gpio_bit_set(Data_Output_IO_B,DB_Out2) // 输出高电平
- #define DB_Out3_L gpio_bit_reset(Data_Output_IO_B, DB_Out3) // 输出低电平
- #define DB_Out3_H gpio_bit_set(Data_Output_IO_B,DB_Out3) // 输出高电平
- #define DB_Out4_L gpio_bit_reset(Data_Output_IO_B, DB_Out4) // 输出低电平
- #define DB_Out4_H gpio_bit_set(Data_Output_IO_B,DB_Out4) // 输出高电平
- //#define Data_Output_RCU RCU_GPIOB
- //#define Data_Output_IO GPIOB
- //#define DB_Out8 GPIO_PIN_15
- //#define DB_Out7 GPIO_PIN_14
- //#define DB_Out6 GPIO_PIN_13
- //#define DB_Out5 GPIO_PIN_12
- //#define DB_Out4 GPIO_PIN_11
- //#define DB_Out3 GPIO_PIN_10
- //#define DB_Out2 GPIO_PIN_9
- //#define DB_Out1 GPIO_PIN_8
- //#define DB_Out1_L gpio_bit_reset(Data_Output_IO, DB_Out1) // 输出低电平
- //#define DB_Out1_H gpio_bit_set(Data_Output_IO,DB_Out1) // 输出高电平
- //#define DB_Out2_L gpio_bit_reset(Data_Output_IO, DB_Out2) // 输出低电平
- //#define DB_Out2_H gpio_bit_set(Data_Output_IO,DB_Out2) // 输出高电平
- //#define DB_Out3_L gpio_bit_reset(Data_Output_IO, DB_Out3) // 输出低电平
- //#define DB_Out3_H gpio_bit_set(Data_Output_IO,DB_Out3) // 输出高电平
- //#define DB_Out4_L gpio_bit_reset(Data_Output_IO, DB_Out4) // 输出低电平
- //#define DB_Out4_H gpio_bit_set(Data_Output_IO,DB_Out4) // 输出高电平
- //#define DB_Out5_L gpio_bit_reset(Data_Output_IO, DB_Out5) // 输出低电平
- //#define DB_Out5_H gpio_bit_set(Data_Output_IO,DB_Out5) // 输出高电平
- //#define DB_Out6_L gpio_bit_reset(Data_Output_IO, DB_Out6) // 输出低电平
- //#define DB_Out6_H gpio_bit_set(Data_Output_IO,DB_Out6) // 输出高电平
- //#define DB_Out7_L gpio_bit_reset(Data_Output_IO, DB_Out7) // 输出低电平
- //#define DB_Out7_H gpio_bit_set(Data_Output_IO,DB_Out7) // 输出高电平
- //#define DB_Out8_L gpio_bit_reset(Data_Output_IO, DB_Out8) // 输出低电平
- //#define DB_Out8_H gpio_bit_set(Data_Output_IO,DB_Out8) // 输出高电平
- /*********************************************************************************************************
- * 枚举结构体
- *********************************************************************************************************/
- /*********************************************************************************************************
- * API函数声明
- *********************************************************************************************************/
- void InitRelay(void); //初始化Relay模块
- void Relayx_Onoff_state(uint8_t RLx,uint8_t st);
- #endif
|