A test program for PS2 library.

Dependencies:   mbed

Committer:
shintamainjp
Date:
Wed Oct 13 10:50:55 2010 +0000
Revision:
4:47b51250a168
First version.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shintamainjp 4:47b51250a168 1 /**
shintamainjp 4:47b51250a168 2 * PS/2 keyboard interface control class (Version 0.0.1)
shintamainjp 4:47b51250a168 3 *
shintamainjp 4:47b51250a168 4 * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems)
shintamainjp 4:47b51250a168 5 * http://shinta.main.jp/
shintamainjp 4:47b51250a168 6 */
shintamainjp 4:47b51250a168 7 #ifndef _PS2_KEYBOARD_H_
shintamainjp 4:47b51250a168 8 #define _PS2_KEYBOARD_H_
shintamainjp 4:47b51250a168 9
shintamainjp 4:47b51250a168 10 #include "PS2KB_INIT.h"
shintamainjp 4:47b51250a168 11 #include "PS2KB.h"
shintamainjp 4:47b51250a168 12
shintamainjp 4:47b51250a168 13 class PS2Keyboard {
shintamainjp 4:47b51250a168 14 public:
shintamainjp 4:47b51250a168 15 PS2Keyboard(PinName clk_pin, PinName dat_pin);
shintamainjp 4:47b51250a168 16 ~PS2Keyboard();
shintamainjp 4:47b51250a168 17 typedef enum {
shintamainjp 4:47b51250a168 18 KeyMake,
shintamainjp 4:47b51250a168 19 KeyBreak
shintamainjp 4:47b51250a168 20 } Type;
shintamainjp 4:47b51250a168 21 typedef struct {
shintamainjp 4:47b51250a168 22 Type type;
shintamainjp 4:47b51250a168 23 int length;
shintamainjp 4:47b51250a168 24 char scancode[8];
shintamainjp 4:47b51250a168 25 } keyboard_event_t;
shintamainjp 4:47b51250a168 26 bool processing(keyboard_event_t *p);
shintamainjp 4:47b51250a168 27 private:
shintamainjp 4:47b51250a168 28 PS2KB_INIT ps2kb_init;
shintamainjp 4:47b51250a168 29 PS2KB ps2kb;
shintamainjp 4:47b51250a168 30 int count;
shintamainjp 4:47b51250a168 31 char scancode[8];
shintamainjp 4:47b51250a168 32 };
shintamainjp 4:47b51250a168 33
shintamainjp 4:47b51250a168 34 #endif