/* driver/hid/usb/hid/keyb.h
 *
 * (c) 2002 Simtec Electronics
 *
 * Ben Dooks
 *
 * USB HID Keyboard driver
 *
 * $Id: keyb.h,v 1.5 2003/08/08 11:17:17 ben Exp $
 *
 * This Library file is part of the Simtec Electronics USB stack development
 *   suite.
 * Specific licence is granted to use this file by third parties for the
 *   development of USB device drivers.
 *
*/

#ifndef __USB_HID_KEYB_H
#define __USB_HID_KEYB_H "$Id: keyb.h,v 1.5 2003/08/08 11:17:17 ben Exp $"

extern int hid_keyb_init(struct hid_dev *dev);

extern struct hid_report_proc_s hid_keyb_proc;

/* key states:
 *
 * KEY_STATE_UP      -> the key is not pressed
 * KEY_STATE_DOWN    -> the key is pressed
 *
 * KEY_STATE_NEWUP     -> key was released in the last report
 * KEY_STATE_NEWDOWN   -> key was pressed in the last report
 *
 * KEY_STATE_FROMARRAY -> the key state is part of an array
*/

#define KEY_STATE_UP               ((unsigned char)0)
#define KEY_STATE_DOWN             ((unsigned char)1)

#define KEY_STATE_NEWDOWN          ((unsigned char)2)
#define KEY_STATE_NEWUP            ((unsigned char)4)
#define KEY_STATE_FROMARRAY        ((unsigned char)128)

#define KEY_STATE_NEWMASK          (KEY_STATE_NEWDOWN|KEY_STATE_NEWUP)
#define KEY_STATE_MASK             (KEY_STATE_DOWN)

struct hid_state_keyb {
  int              key_size;        /* maximum number of keys */
  unsigned char    *key_matrix;     /* key matrix of KEY_STATE values */
};

#define KEYLED_SCROLLLOCK  (0x00)
#define KEYLED_NUMLOCK     (0x01)
#define KEYLED_CAPSLOCK    (0x02)


extern int hid_keyb_setled(int led, int states);

#endif /* __USB_HID_KEYB_H */
