Markus Pilz / Mbed 2 deprecated PS2toUSBHIDAdapter

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PS2Keyboard.h Source File

PS2Keyboard.h

00001 /**
00002  * PS/2 keyboard interface control class (Version 0.0.1)
00003  *
00004  * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems)
00005  * http://shinta.main.jp/
00006  *
00007  * modified by pilzm
00008  */
00009 #ifndef _PS2_KEYBOARD_H_
00010 #define _PS2_KEYBOARD_H_
00011 
00012 #include "PS2KB_INIT.h"
00013 #include "PS2KB.h"
00014 
00015 class PS2Keyboard {
00016 public:
00017     PS2Keyboard(PinName clk_pin, PinName dat_pin);
00018     ~PS2Keyboard();
00019     typedef enum {
00020         KeyMake,
00021         KeyBreak
00022     } Type;
00023     typedef struct {
00024         int scancode;
00025     } keyboard_event_t;
00026     bool processing(keyboard_event_t *p);
00027 private:
00028     PS2KB_INIT ps2kb_init;
00029     PS2KB ps2kb;
00030     int count;
00031     char scancode[8];
00032 };
00033 
00034 #endif