![](/media/cache/profiles/1006ff12c465532f8c574aeaa4461b16.50x50_q85.jpg)
A test program for PS2 library.
Diff: mylib/PS2/PS2Keyboard.h
- Revision:
- 4:47b51250a168
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mylib/PS2/PS2Keyboard.h Wed Oct 13 10:50:55 2010 +0000 @@ -0,0 +1,34 @@ +/** + * PS/2 keyboard interface control class (Version 0.0.1) + * + * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems) + * http://shinta.main.jp/ + */ +#ifndef _PS2_KEYBOARD_H_ +#define _PS2_KEYBOARD_H_ + +#include "PS2KB_INIT.h" +#include "PS2KB.h" + +class PS2Keyboard { +public: + PS2Keyboard(PinName clk_pin, PinName dat_pin); + ~PS2Keyboard(); + typedef enum { + KeyMake, + KeyBreak + } Type; + typedef struct { + Type type; + int length; + char scancode[8]; + } keyboard_event_t; + bool processing(keyboard_event_t *p); +private: + PS2KB_INIT ps2kb_init; + PS2KB ps2kb; + int count; + char scancode[8]; +}; + +#endif