Files
vhdl/lib/CPUs/MIPS/bsp/examples/libsys/mips_ps2.h
T
jens c49d7464fd Initial version
Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@706 cc03376c-175c-47c8-b038-4cd826a8556b
2010-01-31 15:12:12 +00:00

44 lines
1.1 KiB
C

#ifndef PS2_H
#define PS2_H
#include "libsys.h"
// --------------------------------------------------
// Types
// --------------------------------------------------
enum
{
ps2_type_unknown = 0,
ps2_type_keyb,
ps2_type_mouse
};
typedef struct _sps2_if_t
{
UINT32 type;
volatile UINT32 *pCTRL;
volatile UINT32 *pDATA;
} ps2_if_t;
// --------------------------------------------------
// Constants
// --------------------------------------------------
#define PS2_MODULE_PREFIX 0x1000000
#define PS2_SUCCESS LSYS_SUCCESS
#define PS2_ERROR (LSYS_ERR_BASE | PS2_MODULE_PREFIX)
#define PS2_ERR_TIMEOUT (PS2_ERROR | 0x0000001)
#define PS2_ERR_PS2_PREFIX (PS2_ERROR | 0x0010000)
// --------------------------------------------------
// Functions
// --------------------------------------------------
UINT32 PS2_get_num_if(void);
ps2_if_t *PS2_get_if(UINT32 port);
UINT32 PS2_init(UINT32 port);
void PS2_byte_write(UINT32 port, UINT8 byte);
UINT32 PS2_byte_read(UINT32 port, UINT32 timeout_ms);
UINT32 PS2_cmd(UINT32 port, UINT8 cmd, UINT32 ack_timeout_ms);
void PS2_flush(UINT32 port);
#endif // PS2_H