![](/media/cache/profiles/1006ff12c465532f8c574aeaa4461b16.50x50_q85.jpg)
A test program for PS2 library.
mylib/PS2/PS2.h@4:47b51250a168, 2010-10-13 (annotated)
- Committer:
- shintamainjp
- Date:
- Wed Oct 13 10:50:55 2010 +0000
- Revision:
- 4:47b51250a168
First version.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shintamainjp | 4:47b51250a168 | 1 | /** |
shintamainjp | 4:47b51250a168 | 2 | * PS/2 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 | |
shintamainjp | 4:47b51250a168 | 8 | #ifndef _PS2_H_ |
shintamainjp | 4:47b51250a168 | 9 | #define _PS2_H_ |
shintamainjp | 4:47b51250a168 | 10 | |
shintamainjp | 4:47b51250a168 | 11 | #include "mbed.h" |
shintamainjp | 4:47b51250a168 | 12 | |
shintamainjp | 4:47b51250a168 | 13 | /** |
shintamainjp | 4:47b51250a168 | 14 | * PS/2 interface control class. |
shintamainjp | 4:47b51250a168 | 15 | */ |
shintamainjp | 4:47b51250a168 | 16 | class PS2 { |
shintamainjp | 4:47b51250a168 | 17 | public: |
shintamainjp | 4:47b51250a168 | 18 | /** |
shintamainjp | 4:47b51250a168 | 19 | * Create. |
shintamainjp | 4:47b51250a168 | 20 | * |
shintamainjp | 4:47b51250a168 | 21 | * @param clk_pin Clock pin. |
shintamainjp | 4:47b51250a168 | 22 | * @param dat_pin Data pin. |
shintamainjp | 4:47b51250a168 | 23 | */ |
shintamainjp | 4:47b51250a168 | 24 | PS2(PinName clk_pin, PinName dat_pin); |
shintamainjp | 4:47b51250a168 | 25 | |
shintamainjp | 4:47b51250a168 | 26 | /** |
shintamainjp | 4:47b51250a168 | 27 | * Destory. |
shintamainjp | 4:47b51250a168 | 28 | */ |
shintamainjp | 4:47b51250a168 | 29 | virtual ~PS2(); |
shintamainjp | 4:47b51250a168 | 30 | |
shintamainjp | 4:47b51250a168 | 31 | /** |
shintamainjp | 4:47b51250a168 | 32 | * Get a data from a PS/2 device. |
shintamainjp | 4:47b51250a168 | 33 | * |
shintamainjp | 4:47b51250a168 | 34 | * @return A data from a PS/2 device. |
shintamainjp | 4:47b51250a168 | 35 | */ |
shintamainjp | 4:47b51250a168 | 36 | virtual int getc(void) = 0; |
shintamainjp | 4:47b51250a168 | 37 | |
shintamainjp | 4:47b51250a168 | 38 | /** |
shintamainjp | 4:47b51250a168 | 39 | * Set timeout. |
shintamainjp | 4:47b51250a168 | 40 | * |
shintamainjp | 4:47b51250a168 | 41 | * @param ms Timeout ms. |
shintamainjp | 4:47b51250a168 | 42 | */ |
shintamainjp | 4:47b51250a168 | 43 | virtual void setTimeout(int ms) = 0; |
shintamainjp | 4:47b51250a168 | 44 | }; |
shintamainjp | 4:47b51250a168 | 45 | |
shintamainjp | 4:47b51250a168 | 46 | #endif |