/** ##########################################################################
**     Filename  : keyboard_drive_cfg.c
**     Project   : RGB LED
**     Module    :
**     Processor : Cypress CY8C4147AZI-S475
**     Version   : V1.0
**     Compiler  : PSoC Creator 4.2
**     Date/Time : 2019/10/08
**     Abstract  :
**
**     Contents  :
**
**
**     (c) Copyright dmdz Co.,Ltd
**  --------------------------------------------------------------------------
**               R E V I S I O N   H I S T O R Y
**  --------------------------------------------------------------------------
**  Date       Ver   Author             Description

**  ---------  ----  -----------------  --------------------------------------
** #########################################################################*/

/*****************************************************************************
* I N C L U D E   F I L E S
*****************************************************************************/
#include "key_adc_mid.h"



//各通道，各物理按键的消抖时间，长按时间，卡滞时间的配置
const key_adc_time_cfg_s g_key_adc_mid_time_cfg[KEY_ADC_ID_MAX] =
{
	{KEY_ADC_LONGPRESS_TIME,KEY_STUCK_TIMEOUT_20S},
	{KEY_ADC_LONGPRESS_TIME,KEY_STUCK_TIMEOUT_20S},

	{KEY_ADC_LONGPRESS_TIME,KEY_STUCK_TIMEOUT_5MIN},

	{KEY_ADC_LONGPRESS_TIME,KEY_STUCK_TIMEOUT_5MIN},
	{KEY_ADC_LONGPRESS_TIME,KEY_STUCK_TIMEOUT_5MIN},
	{KEY_ADC_LONGPRESS_TIME,KEY_STUCK_TIMEOUT_5MIN},
	{KEY_ADC_LONGPRESS_TIME,KEY_STUCK_TIMEOUT_5MIN},
	{KEY_ADC_LONGPRESS_TIME,KEY_STUCK_TIMEOUT_20S},

};






/*****************************************************************************
|Prototype		: void key_adc_driver_get_result(void)
|Called by		: None
|Preconditions		: None
|Input parameters	: channel AD邏輯通道  sub_id 內部的key排序
|Output parameters	: None
|Return value		: None
|Description		:
*****************************************************************************/
key_adc_result_e key_adc_mid_get_drv_state(u8 key_id)
{
	key_adc_result_e l_result=KEY_ADC_RESULT_IDLE;
	switch(key_id)
	{
			case KEY_ADC_ID_S11:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_1,0u);
			break;
			case KEY_ADC_ID_S12:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_1,1u);   //
			break;
			case KEY_ADC_ID_S13:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_1,2u);	 //
			break;
			case KEY_ADC_ID_S9:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_2,0u);	//
			break;
			case KEY_ADC_ID_S10:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_2,1u);	//
			break;
			case KEY_ADC_ID_S14:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_2,2u);	//
			break;
			case KEY_ADC_ID_S7:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_3,0u);	//
			break;
			case KEY_ADC_ID_S8:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_3,1u);	//
			break;
			#if 0
			case KEY_ADC_ID_S9:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_4,1u);	//
			break;
			case KEY_ADC_ID_S4:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_5,0u);   //
			break;
			case KEY_ADC_ID_S3:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_5,1u);	 //
			break;
			case KEY_ADC_ID_S1:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_5,2u);	//
			break;
			case KEY_ADC_ID_S2:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_2,0u);	//
			break;
			case KEY_ADC_ID_S5:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_2,1u);	//
			break;
			case KEY_ADC_ID_S6:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_2,2u);	//
			break;

			case KEY_ADC_ID_S7:
				l_result = key_adc_driver_get_result(KEY_ADC_CHANNEL_ID_2,3u);	//
			break;
			#endif

		default:
			//code
		break;
	}
	return l_result;
}
