![](/media/cache/profiles/1006ff12c465532f8c574aeaa4461b16.50x50_q85.jpg)
A test program for PS2 library.
Diff: mylib/PS2/PS2.h
- Revision:
- 4:47b51250a168
diff -r a3ba8d3e3958 -r 47b51250a168 mylib/PS2/PS2.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mylib/PS2/PS2.h Wed Oct 13 10:50:55 2010 +0000 @@ -0,0 +1,46 @@ +/** + * PS/2 interface control class (Version 0.0.1) + * + * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems) + * http://shinta.main.jp/ + */ + +#ifndef _PS2_H_ +#define _PS2_H_ + +#include "mbed.h" + +/** + * PS/2 interface control class. + */ +class PS2 { +public: + /** + * Create. + * + * @param clk_pin Clock pin. + * @param dat_pin Data pin. + */ + PS2(PinName clk_pin, PinName dat_pin); + + /** + * Destory. + */ + virtual ~PS2(); + + /** + * Get a data from a PS/2 device. + * + * @return A data from a PS/2 device. + */ + virtual int getc(void) = 0; + + /** + * Set timeout. + * + * @param ms Timeout ms. + */ + virtual void setTimeout(int ms) = 0; +}; + +#endif