2025-04-26 16:03:23 +08:00

76 lines
3.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*****************************************************************************
** Filename : keyboard_drive_cfg.c
** Project :
** Module :
** Processor : Freescale S12Z
** Date/Time : 2019-09-04, 9:00
** Abstract :
** Contents :
** Author : Lyj
** http :
** mail :
** --------------------------------------------------------------------------
**
** --------------------------------------------------------------------------
******************************************************************************/
/*****************************************************************************
* Include Files
*****************************************************************************/
#include "gpio.h"
#include "key_com_cfg.h"
#include "key_adc_mid.h"
/*****************************************************************************
* Defines
*****************************************************************************/
/*GEELY:The de-bounce time shall be 20 ms for pulling a switch and 20 ms for releasing a switch. At 5 ms sample
rate this is equal to 4 samples before switching the state of a switch.*/
/*****************************************************************************
* Macros
*****************************************************************************/
/*****************************************************************************
* Type Defines
*****************************************************************************/
/*****************************************************************************
*Static Variable
*****************************************************************************/
/*****************************************************************************
*Global Variable
*****************************************************************************/
/*****************************************************************************
*Constant
*****************************************************************************/
/*****************************************************************************
** --------------------------------------------------------------------------
** 下述代码是基于Freescale mc9s12g BSP,其他单片机则需要修改
** --------------------------------------------------------------------------
******************************************************************************/
#if 1
/*各种按键的时间相关*/
const u16 g_key_cfg_times[KEY_TIME_CFG_ID_TOTAL] =
{
//目前没有使用这三个
KEY_DIGITAL_DITHERING_TIME,/*第一个参数是数字按键的消抖时间单位是和key app调用周期相关*/
KEY_DIGITAL_LONGDOWN_TIMEOUT,/*第二个参数是数字按键的消卡滞时间单位是和key app调用周期相关*/
KEY_STUCK_TIMEOUT_20S,/*第二个参数是数字按键的消卡滞时间单位是和key app调用周期相关*/
KEY_DIGITAL_FAULT_TIMEOUT, /*故障检测*/
KEY_ADC_DEBOUNCE_TIME,/*第三个参数是ad按键的消抖时间单位是和key adc mid 调用周期相关*/
KEY_ADC_LONGPRESS_TIME,/*第四个参数是ad按键的卡滞时间单位是和key adc mid调用周期相关*/
KEY_ADC_STICKPRESS_TIME,/*第四个参数是ad按键的卡滞时间单位是和key adc mid调用周期相关*/
KEY_ADC_FAULT_TIME, /*故障检测*/
KEY_ADC_OTHER_FAULT_TIME, /*其它范围的错误*/
};
#endif