/*
 * key.h
 *
 *  Created on: 2022Äê3ÔÂ5ÈÕ
 *      Author: wuwen
 */

#ifndef KEY_H_
#define KEY_H_

#include "main.h"

#define KEY0 HAL_GPIO_ReadPin(KEY0_GPIO_Port, KEY0_Pin)
#define KEY1 HAL_GPIO_ReadPin(KEY1_GPIO_Port, KEY1_Pin)
#define KEY2 HAL_GPIO_ReadPin(KEY2_GPIO_Port, KEY2_Pin)
#define KEY3 HAL_GPIO_ReadPin(KEY3_GPIO_Port, KEY3_Pin)

extern struct button k1,k2,k3;

struct button
{
    int  code;
    uint8_t   lock;
    uint32_t  time;
    int  times;
};

void GEI_BUTTON_CODE(struct button *bt,uint8_t in);

#endif /* KEY_H_ */
