PS2 Library

Dependents:   Pong Brickbreaker

Committer:
wjohnsto
Date:
Sun Feb 27 23:34:31 2011 +0000
Revision:
0:ce15490e89e9

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wjohnsto 0:ce15490e89e9 1 /**
wjohnsto 0:ce15490e89e9 2 * PS/2 interface control class (Version 0.0.1)
wjohnsto 0:ce15490e89e9 3 *
wjohnsto 0:ce15490e89e9 4 * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems)
wjohnsto 0:ce15490e89e9 5 * http://shinta.main.jp/
wjohnsto 0:ce15490e89e9 6 */
wjohnsto 0:ce15490e89e9 7
wjohnsto 0:ce15490e89e9 8 #ifndef _PS2_H_
wjohnsto 0:ce15490e89e9 9 #define _PS2_H_
wjohnsto 0:ce15490e89e9 10
wjohnsto 0:ce15490e89e9 11 #include "mbed.h"
wjohnsto 0:ce15490e89e9 12
wjohnsto 0:ce15490e89e9 13 /**
wjohnsto 0:ce15490e89e9 14 * PS/2 interface control class.
wjohnsto 0:ce15490e89e9 15 */
wjohnsto 0:ce15490e89e9 16 class PS2 {
wjohnsto 0:ce15490e89e9 17 public:
wjohnsto 0:ce15490e89e9 18 /**
wjohnsto 0:ce15490e89e9 19 * Create.
wjohnsto 0:ce15490e89e9 20 *
wjohnsto 0:ce15490e89e9 21 * @param clk_pin Clock pin.
wjohnsto 0:ce15490e89e9 22 * @param dat_pin Data pin.
wjohnsto 0:ce15490e89e9 23 */
wjohnsto 0:ce15490e89e9 24 PS2(PinName clk_pin, PinName dat_pin);
wjohnsto 0:ce15490e89e9 25
wjohnsto 0:ce15490e89e9 26 /**
wjohnsto 0:ce15490e89e9 27 * Destory.
wjohnsto 0:ce15490e89e9 28 */
wjohnsto 0:ce15490e89e9 29 virtual ~PS2();
wjohnsto 0:ce15490e89e9 30
wjohnsto 0:ce15490e89e9 31 /**
wjohnsto 0:ce15490e89e9 32 * Get a data from a PS/2 device.
wjohnsto 0:ce15490e89e9 33 *
wjohnsto 0:ce15490e89e9 34 * @return A data from a PS/2 device.
wjohnsto 0:ce15490e89e9 35 */
wjohnsto 0:ce15490e89e9 36 virtual int getc(void) = 0;
wjohnsto 0:ce15490e89e9 37
wjohnsto 0:ce15490e89e9 38 /**
wjohnsto 0:ce15490e89e9 39 * Set timeout.
wjohnsto 0:ce15490e89e9 40 *
wjohnsto 0:ce15490e89e9 41 * @param ms Timeout ms.
wjohnsto 0:ce15490e89e9 42 */
wjohnsto 0:ce15490e89e9 43 virtual void setTimeout(int ms) = 0;
wjohnsto 0:ce15490e89e9 44 };
wjohnsto 0:ce15490e89e9 45
wjohnsto 0:ce15490e89e9 46 #endif