kbddev.c File Reference

USB HID keyboard device structure and API. More...

#include <errno.h>
#include <str_error.h>
#include <stdio.h>
#include <io/keycode.h>
#include <ipc/kbd.h>
#include <async.h>
#include <fibril.h>
#include <fibril_synch.h>
#include <usb/usb.h>
#include <usb/dev/dp.h>
#include <usb/dev/request.h>
#include <usb/hid/hid.h>
#include <usb/dev/pipes.h>
#include <usb/debug.h>
#include <usb/hid/hidparser.h>
#include <usb/classes/classes.h>
#include <usb/hid/usages/core.h>
#include <usb/hid/request.h>
#include <usb/hid/hidreport.h>
#include <usb/hid/usages/led.h>
#include <usb/dev/driver.h>
#include "kbddev.h"
#include "layout.h"
#include "conv.h"
#include "kbdrepeat.h"
#include "../usbhid.h"

Go to the source code of this file.

Defines

#define NUM_LAYOUTS   3

Enumerations

enum  
enum  usb_kbd_flags

Functions

static void default_connection_handler (ddf_fun_t *fun, ipc_callid_t icallid, ipc_call_t *icall)
 Default handler for IPC methods not handled by DDF.
static void usb_kbd_check_key_changes (usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev)
 Checks if some keys were pressed or released and generates key events.
static int usb_kbd_create_function (usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev)
void usb_kbd_deinit (usb_hid_dev_t *hid_dev, void *data)
void usb_kbd_free (usb_kbd_t **kbd_dev)
 Properly destroys the USB/HID keyboard structure.
int usb_kbd_init (usb_hid_dev_t *hid_dev, void **data)
 Initialization of the USB/HID keyboard structure.
int usb_kbd_is_initialized (const usb_kbd_t *kbd_dev)
static int usb_kbd_is_lock (unsigned int key_code)
int usb_kbd_is_ready_to_destroy (const usb_kbd_t *kbd_dev)
static void usb_kbd_mark_unusable (usb_kbd_t *kbd_dev)
static usb_kbd_tusb_kbd_new (void)
 Creates a new USB/HID keyboard structure.
bool usb_kbd_polling_callback (usb_hid_dev_t *hid_dev, void *data)
static void usb_kbd_process_data (usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev)
 Processes data received from the device in form of report.
void usb_kbd_push_ev (usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev, int type, unsigned int key)
 Processes key events.
int usb_kbd_set_boot_protocol (usb_hid_dev_t *hid_dev)
static void usb_kbd_set_led (usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev)
 Handles turning of LED lights on and off.

Variables

static int active_layout = 0
static const unsigned DEFAULT_ACTIVE_MODS = KM_NUM_LOCK
 Default modifiers when the keyboard is initialized.
static const unsigned int DEFAULT_DELAY_BEFORE_FIRST_REPEAT = 500 * 1000
 Delay before a pressed key starts auto-repeating.
static const unsigned int DEFAULT_REPEAT_DELAY = 50 * 1000
 Delay between two repeats of a pressed key when auto-repeating.
static const uint8_t ERROR_ROLLOVER = 1
const char * HID_KBD_CLASS_NAME = "keyboard"
const char * HID_KBD_FUN_NAME = "keyboard"
static const uint8_t IDLE_RATE = 0
 Default idle rate for keyboards.
static layout_op_tlayout [NUM_LAYOUTS]
 Keyboard layout map.
usb_endpoint_description_t usb_hid_kbd_poll_endpoint_description
 Keyboard polling endpoint description for boot protocol class.
static const uint8_t USB_KBD_BOOT_REPORT_DESCRIPTOR [USB_KBD_BOOT_REPORT_DESCRIPTOR_SIZE]


Detailed Description

USB HID keyboard device structure and API.

Definition in file kbddev.c.


Generated on Thu Jun 2 07:45:52 2011 for HelenOS/USB by  doxygen 1.4.7