#ifndef __KC_H__ #define __KC_H__ #include "KC.h" #include "led.h" #include "stm32f10x_iwdg.h" #include "sd.h" #include #include "de_dev.h" #include "de_demo.h" enum KC_state { KC_Close, KC_Open, Floating_input, ERR }; struct KC_pdata { uint16_t GPIO_NUM;//gpio的编号 GPIO_TypeDef* GPIO_Group;//gpio的主号 enum KC_state KC_This_State;//状态以及初始状态 };//KC私有数据 struct KC_OPS{ bool (*Set_GPIO)(struct KC_pdata* self); bool (*Reset_GPIO)(struct KC_pdata* self); enum KC_state (*Read_KC_State)(struct KC_pdata* self); }; #define KC_MaxNum 22 extern U_BOOT_DEVICE(KC1); extern U_BOOT_DEVICE(KC2); extern U_BOOT_DEVICE(KC3); extern U_BOOT_DEVICE(KC4); extern U_BOOT_DEVICE(KC5); extern U_BOOT_DEVICE(KC8); extern U_BOOT_DEVICE(KC9); extern U_BOOT_DEVICE(PW5V); extern U_BOOT_DEVICE(MCU_RUN); extern U_BOOT_DEVICE(YX1); extern U_BOOT_DEVICE(YX2); extern U_BOOT_DEVICE(PW3_3V); extern U_BOOT_DEVICE(CAN2_STB); extern U_BOOT_DEVICE(CAN2_EN); extern U_BOOT_DEVICE(ELS_ON); extern U_BOOT_DEVICE(ELS_OFF); extern U_BOOT_DEVICE(CAN1_STB); extern U_BOOT_DEVICE(HV_DSG_CHECJ); extern U_BOOT_DEVICE(HV_DSG_CHECJ_2); extern U_BOOT_DEVICE(CONG_RX); extern U_BOOT_DEVICE(CONG_TX); bool KC_Set_GPIO(struct udevice* dev); bool KC_ReSet_GPIO(struct udevice* dev); enum KC_state KC_Read_GPIO(struct udevice* dev); void Init_KC_GPIO(void); #endif