OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [mw/] [src/] [drivers/] [mou_null.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 673 markom
/*
2
 * Copyright (c) 1999 Greg Haerr <greg@censoft.com>
3
 *
4
 * NULL Mouse Driver
5
 */
6
#include <stdio.h>
7
#include "device.h"
8
 
9
#define SCALE           3       /* default scaling factor for acceleration */
10
#define THRESH          5       /* default threshhold for acceleration */
11
 
12
static int      NUL_Open(MOUSEDEVICE *pmd);
13
static void     NUL_Close(void);
14
static int      NUL_GetButtonInfo(void);
15
static void     NUL_GetDefaultAccel(int *pscale,int *pthresh);
16
static int      NUL_Read(MWCOORD *dx, MWCOORD *dy, MWCOORD *dz, int *bp);
17
static int      NUL_Poll(void);
18
 
19
MOUSEDEVICE mousedev = {
20
        NUL_Open,
21
        NUL_Close,
22
        NUL_GetButtonInfo,
23
        NUL_GetDefaultAccel,
24
        NUL_Read,
25
        NUL_Poll
26
};
27
 
28
/*
29
 * Poll for events
30
 */
31
 
32
static int
33
NUL_Poll(void)
34
{
35
  return 0;
36
}
37
 
38
/*
39
 * Open up the mouse device.
40
 */
41
static int
42
NUL_Open(MOUSEDEVICE *pmd)
43
{
44
        return -2;      /* no mouse*/
45
}
46
 
47
/*
48
 * Close the mouse device.
49
 */
50
static void
51
NUL_Close(void)
52
{
53
}
54
 
55
/*
56
 * Get mouse buttons supported
57
 */
58
static int
59
NUL_GetButtonInfo(void)
60
{
61
        return 0;
62
}
63
 
64
/*
65
 * Get default mouse acceleration settings
66
 */
67
static void
68
NUL_GetDefaultAccel(int *pscale,int *pthresh)
69
{
70
        *pscale = SCALE;
71
        *pthresh = THRESH;
72
}
73
 
74
/*
75
 * Attempt to read bytes from the mouse and interpret them.
76
 * Returns -1 on error, 0 if either no bytes were read or not enough
77
 * was read for a complete state, or 1 if the new state was read.
78
 * When a new state is read, the current buttons and x and y deltas
79
 * are returned.  This routine does not block.
80
 */
81
static int
82
NUL_Read(MWCOORD *dx, MWCOORD *dy, MWCOORD *dz, int *bp)
83
{
84
        return 0;
85
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.