/* 2012-09-16: File added by Sony Corporation */
/*
 * icx_key.h
 *
 * Copyright 20qq Sony Corporation.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef __ICX_KEY_H__
#define __ICX_KEY_H__

/* key code */
#define KEY_CODE_NONE    0x00000000
#define KEY_CODE_PLAY    0x00000100  /* KEY_AD0-0 : S1002 */
#define KEY_CODE_RIGHT   0x00000200  /* KEY_AD0-1 : S1004 */
#define KEY_CODE_LEFT    0x00000400  /* KEY_AD0-2 : S1007 */
#define KEY_CODE_UP      0x00000800  /* KEY_AD0-3 : S1010 */
#define KEY_CODE_DOWN    0x00001000  /* KEY_AD0-4 : S1012 */
#define KEY_CODE_ZAPPIN  0x00002000  /* KEY_AD0-5 : S1015 */
#define KEY_CODE_AD0_6   0x00004000  /* KEY_AD0-6 : S1018 */
#define KEY_CODE_AD0_7   0x00008000  /* KEY_AD0-7 : S1020 */
#define KEY_CODE_VOLDOWN 0x00000001  /* KEY_AD1-0 : S1003 */
#define KEY_CODE_VOLUP   0x00000002  /* KEY_AD1-1 : S1005 */
#define KEY_CODE_BACK    0x00000004  /* KEY_AD1-2 : S1008 */
#define KEY_CODE_OPTION  0x00000008  /* KEY_AD1-3 : S1011 */
#define KEY_CODE_BT      0x00000010  /* KEY_AD1-4 : S1013 */
#define KEY_CODE_AD1_5   0x00000020  /* KEY_AD1-5 : S1016 */
#define KEY_CODE_AD1_6   0x00000040  /* KEY_AD1-6 : S1019 */
#define KEY_CODE_AD1_7   0x00000080  /* KEY_AD1-7 : S1021 */

/* key value */
#define KEY_VALUE_NOT_PRESSED 0x0000FFFF

/* hold */
#define KEY_HOLD_OFF 0
#define KEY_HOLD_ON  1

/* prototypes */
void         key_init(void);
unsigned int key_get_key_code(unsigned int key_value);
unsigned int key_get_key_value(void);
unsigned int key_get_boot_key_value(void);
void         key_save_key_value(unsigned int key_value);
unsigned int key_get_hold_state(unsigned int *elapsed_time);

#endif /* __ICX_KEY_H__ */

