- initial import
git-svn-id: http://moon:8086/svn/mips@1 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user