Aleksandar Kodzhabashev / Mbed 2 deprecated TrackballQuery

Dependencies:   Servo 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 #ifndef _PS2_KEYBOARD_H_
00008 #define _PS2_KEYBOARD_H_
00009 
00010 #include "PS2KB_INIT.h"
00011 #include "PS2KB.h"
00012 
00013 class PS2Keyboard {
00014 public:
00015     PS2Keyboard(PinName clk_pin, PinName dat_pin);
00016     ~PS2Keyboard();
00017     typedef enum {
00018         KeyMake,
00019         KeyBreak
00020     } Type;
00021     typedef struct {
00022         Type type;
00023         int length;
00024         char scancode[8];
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