2024-01-30 03:31:27 +00:00
|
|
|
|
#ifndef __KC_H__
|
|
|
|
|
#define __KC_H__
|
|
|
|
|
#include "KC.h"
|
|
|
|
|
#include "led.h"
|
|
|
|
|
#include "stm32f10x_iwdg.h"
|
|
|
|
|
#include "sd.h"
|
|
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#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<69>ı<EFBFBD><C4B1><EFBFBD>
|
|
|
|
|
GPIO_TypeDef* GPIO_Group;//gpio<69><6F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
enum KC_state KC_This_State;//״̬<D7B4>Լ<EFBFBD><D4BC><EFBFBD>ʼ״̬
|
|
|
|
|
};//KC˽<43><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
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(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);
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|