Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of PS2 by
PS2.h@0:62b62530a82f, 2012-10-11 (annotated)
- Committer:
- pprasad7
- Date:
- Thu Oct 11 20:15:09 2012 +0000
- Revision:
- 0:62b62530a82f
PS/2 Input;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pprasad7 | 0:62b62530a82f | 1 | /** |
pprasad7 | 0:62b62530a82f | 2 | * PS/2 interface control class (Version 0.0.1) |
pprasad7 | 0:62b62530a82f | 3 | * |
pprasad7 | 0:62b62530a82f | 4 | * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems) |
pprasad7 | 0:62b62530a82f | 5 | * http://shinta.main.jp/ |
pprasad7 | 0:62b62530a82f | 6 | */ |
pprasad7 | 0:62b62530a82f | 7 | |
pprasad7 | 0:62b62530a82f | 8 | #ifndef _PS2_H_ |
pprasad7 | 0:62b62530a82f | 9 | #define _PS2_H_ |
pprasad7 | 0:62b62530a82f | 10 | |
pprasad7 | 0:62b62530a82f | 11 | #include "mbed.h" |
pprasad7 | 0:62b62530a82f | 12 | |
pprasad7 | 0:62b62530a82f | 13 | /** |
pprasad7 | 0:62b62530a82f | 14 | * PS/2 interface control class. |
pprasad7 | 0:62b62530a82f | 15 | */ |
pprasad7 | 0:62b62530a82f | 16 | class PS2 { |
pprasad7 | 0:62b62530a82f | 17 | public: |
pprasad7 | 0:62b62530a82f | 18 | /** |
pprasad7 | 0:62b62530a82f | 19 | * Create. |
pprasad7 | 0:62b62530a82f | 20 | * |
pprasad7 | 0:62b62530a82f | 21 | * @param clk_pin Clock pin. |
pprasad7 | 0:62b62530a82f | 22 | * @param dat_pin Data pin. |
pprasad7 | 0:62b62530a82f | 23 | */ |
pprasad7 | 0:62b62530a82f | 24 | PS2(PinName clk_pin, PinName dat_pin); |
pprasad7 | 0:62b62530a82f | 25 | |
pprasad7 | 0:62b62530a82f | 26 | /** |
pprasad7 | 0:62b62530a82f | 27 | * Destory. |
pprasad7 | 0:62b62530a82f | 28 | */ |
pprasad7 | 0:62b62530a82f | 29 | virtual ~PS2(); |
pprasad7 | 0:62b62530a82f | 30 | |
pprasad7 | 0:62b62530a82f | 31 | /** |
pprasad7 | 0:62b62530a82f | 32 | * Get a data from a PS/2 device. |
pprasad7 | 0:62b62530a82f | 33 | * |
pprasad7 | 0:62b62530a82f | 34 | * @return A data from a PS/2 device. |
pprasad7 | 0:62b62530a82f | 35 | */ |
pprasad7 | 0:62b62530a82f | 36 | virtual int getc(void) = 0; |
pprasad7 | 0:62b62530a82f | 37 | |
pprasad7 | 0:62b62530a82f | 38 | /** |
pprasad7 | 0:62b62530a82f | 39 | * Set timeout. |
pprasad7 | 0:62b62530a82f | 40 | * |
pprasad7 | 0:62b62530a82f | 41 | * @param ms Timeout ms. |
pprasad7 | 0:62b62530a82f | 42 | */ |
pprasad7 | 0:62b62530a82f | 43 | virtual void setTimeout(int ms) = 0; |
pprasad7 | 0:62b62530a82f | 44 | }; |
pprasad7 | 0:62b62530a82f | 45 | |
pprasad7 | 0:62b62530a82f | 46 | #endif |