/**
******************************************************************************************************************************************************************************************
*@file                       user_keyboard.h
*@author         
*@data                       
*@version                    v1.0
*@par Copyright(c):
*
*@par History:
*     version:author,date,desc
*     v1.0   :create this file
*
*******************************************************************************************************************************************************************************************
*/
#ifndef USER_KEYBOARD_H_
#define USER_KEYBOARD_H_

#define TIMER_CONTROL_REG_TIMER_ENABLE_Pos								(0)
#define TIMER_CONTROL_REG_TIMER_ENABLE_Mask								(0x01U<<TIMER_CONTROL_REG_TIMER_ENABLE_Pos) 

#define KPC_CTRL_KPC_ENABLE_Pos                (0)
#define KPC_CTRL_KPC_ENABLE_Mask               (0x01U<<KPC_CTRL_KPC_ENABLE_Pos)

#define KPC_CFG1_KPC_SEL_Pos                   (0)
#define KPC_CFG1_KPC_SEL_Mask                  (0x01U<<KPC_CFG1_KPC_SEL_Pos)

#define KPC_CFG2_KSPW_Pos                      (0)
#define KPC_CFG2_KSPW_Mask                     (0x01U<<KPC_CFG2_KSPW_Pos)

#define KPC_STAT_KPC_STAT_Pos                  (0)
#define KPC_STAT_KPC_STAT_Mask                 (0x01U<<KPC_STAT_KPC_STAT_Pos)

#define KPC_INT_CTL_INT_MASK_Pos               (1)
#define KPC_INT_CTL_INT_MASK_Mask              (0x01U<<KPC_INT_CTL_INT_MASK_Pos)             
#define KPC_INT_CTL_INT_EN_Pos                 (0)
#define KPC_INT_CTL_INT_EN_Mask                (0x01U<<KPC_INT_CTL_INT_EN_Pos)  

#define KPC_DATA_KPC_DATA_Pos                  (0)
#define KPC_DATA_KPC_DATA_Mask                 (0x01U<<KPC_DATA_KPC_DATA_Pos)

typedef enum
{
    KB_INTERVAL_4MS,
	KB_INTERVAL_6MS,
	KB_INTERVAL_8MS,
	KB_INTERVAL_12MS,
	KB_INTERVAL_16MS,
	KB_INTERVAL_24MS,
	KB_INTERVAL_32MS,
	KB_INTERVAL_48MS,
	KB_INTERVAL_64MS,

	KB_INTERVAL_MAX,

}kb_scan_interval_t;

typedef void (*kb_callbcak_t)(uint16_t io_state);

typedef struct
{
    uint32_t gpio_map;
	kb_scan_interval_t  scan_interval;
	kb_callbcak_t      cbk;
}keyboard_param_t;




#endif
