1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Serial Mouse Driver |
---|
5 | * |
---|
6 | * This file describes the Serial Mouse Driver for all boards. |
---|
7 | * This driver assumes that the BSP or application will provide |
---|
8 | * an implementation of the method bsp_get_serial_mouse_device() |
---|
9 | * which tells the driver what serial port device to open() and |
---|
10 | * what type of mouse is connected. |
---|
11 | * |
---|
12 | * This driver relies on the Mouse Parser Engine. |
---|
13 | */ |
---|
14 | |
---|
15 | /* |
---|
16 | * COPYRIGHT (c) 1989-2011. |
---|
17 | * On-Line Applications Research Corporation (OAR). |
---|
18 | * |
---|
19 | * The license and distribution terms for this file may be |
---|
20 | * found in the file LICENSE in this distribution or at |
---|
21 | * http://www.rtems.com/license/LICENSE. |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef __SERIAL_MOUSE_h__ |
---|
25 | #define __SERIAL_MOUSE_h__ |
---|
26 | |
---|
27 | #include <rtems/io.h> |
---|
28 | |
---|
29 | /* functions */ |
---|
30 | |
---|
31 | /** |
---|
32 | * @defgroup libmisc_serialmouse Serial Mouse Driver |
---|
33 | * @ingroup libmisc_mouse |
---|
34 | */ |
---|
35 | /**@{*/ |
---|
36 | #ifdef __cplusplus |
---|
37 | extern "C" { |
---|
38 | #endif |
---|
39 | |
---|
40 | /** |
---|
41 | * @brief Standard device file path for a PS2 mouse device. |
---|
42 | */ |
---|
43 | #define SERIAL_MOUSE_DEVICE_PS2 "/dev/psaux" |
---|
44 | |
---|
45 | /** |
---|
46 | * This macro defines the serial mouse device driver entry points. |
---|
47 | */ |
---|
48 | #define SERIAL_MOUSE_DRIVER_TABLE_ENTRY \ |
---|
49 | { serial_mouse_initialize, serial_mouse_open, serial_mouse_close, \ |
---|
50 | serial_mouse_read, serial_mouse_write, serial_mouse_control } |
---|
51 | |
---|
52 | /** |
---|
53 | * @brief The initialization of the serial mouse driver. |
---|
54 | * |
---|
55 | * This method initializes the serial mouse driver. |
---|
56 | * |
---|
57 | * @param[in] major is the mouse device major number |
---|
58 | * @param[in] minor is the mouse device minor number |
---|
59 | * @param[in] arg points to device driver arguments |
---|
60 | */ |
---|
61 | rtems_device_driver serial_mouse_initialize( |
---|
62 | rtems_device_major_number major, |
---|
63 | rtems_device_minor_number minor, |
---|
64 | void *arg |
---|
65 | ); |
---|
66 | |
---|
67 | /** |
---|
68 | * @brief Open device driver entry point for the serial mouse driver. |
---|
69 | * |
---|
70 | * This method implements the Open device driver entry |
---|
71 | * point for the serial mouse driver. |
---|
72 | * |
---|
73 | * @param[in] major is the mouse device major number |
---|
74 | * @param[in] minor is the mouse device minor number |
---|
75 | * @param[in] arg points to device driver arguments |
---|
76 | */ |
---|
77 | rtems_device_driver serial_mouse_open( |
---|
78 | rtems_device_major_number major, |
---|
79 | rtems_device_minor_number minor, |
---|
80 | void *arg |
---|
81 | ); |
---|
82 | |
---|
83 | /** |
---|
84 | * @brief Close device driver entry point for the serial mouse driver. |
---|
85 | * |
---|
86 | * This method implements the Close device driver entry |
---|
87 | * point for the serial mouse driver. |
---|
88 | * |
---|
89 | * @param[in] major is the mouse device major number |
---|
90 | * @param[in] minor is the mouse device minor number |
---|
91 | * @param[in] arg points to device driver arguments |
---|
92 | */ |
---|
93 | rtems_device_driver serial_mouse_close( |
---|
94 | rtems_device_major_number major, |
---|
95 | rtems_device_minor_number minor, |
---|
96 | void *arg |
---|
97 | ); |
---|
98 | |
---|
99 | /** |
---|
100 | * @brief Read device driver entry point for the serial mouse driver. |
---|
101 | * |
---|
102 | * This method implements the Read device driver entry |
---|
103 | * point for the serial mouse driver. |
---|
104 | * |
---|
105 | * @param[in] major is the mouse device major number |
---|
106 | * @param[in] minor is the mouse device minor number |
---|
107 | * @param[in] arg points to device driver arguments |
---|
108 | */ |
---|
109 | rtems_device_driver serial_mouse_read( |
---|
110 | rtems_device_major_number major, |
---|
111 | rtems_device_minor_number minor, |
---|
112 | void *arg |
---|
113 | ); |
---|
114 | |
---|
115 | /** |
---|
116 | * @brief Write device driver entry point for the serial mouse driver. |
---|
117 | * |
---|
118 | * This method implements the Write device driver entry |
---|
119 | * point for the serial mouse driver. |
---|
120 | * |
---|
121 | * @param[in] major is the mouse device major number |
---|
122 | * @param[in] minor is the mouse device minor number |
---|
123 | * @param[in] arg points to device driver arguments |
---|
124 | */ |
---|
125 | rtems_device_driver serial_mouse_write( |
---|
126 | rtems_device_major_number major, |
---|
127 | rtems_device_minor_number minor, |
---|
128 | void *arg |
---|
129 | ); |
---|
130 | |
---|
131 | /** |
---|
132 | * @brief IO Control device driver entry point for the serial mouse driver. |
---|
133 | * |
---|
134 | * This method implements the IO Control device driver entry |
---|
135 | * point for the serial mouse driver. |
---|
136 | * |
---|
137 | * @param[in] major is the mouse device major number |
---|
138 | * @param[in] minor is the mouse device minor number |
---|
139 | * @param[in] arg points to device driver arguments |
---|
140 | */ |
---|
141 | rtems_device_driver serial_mouse_control( |
---|
142 | rtems_device_major_number major, |
---|
143 | rtems_device_minor_number minor, |
---|
144 | void *arg |
---|
145 | ); |
---|
146 | |
---|
147 | /** |
---|
148 | * @brief Obtain serial mouse configuration information. |
---|
149 | * |
---|
150 | * This method is implemented by the BSP or application and |
---|
151 | * tells the driver what device to open() and what type of |
---|
152 | * mouse is connected. |
---|
153 | * |
---|
154 | * @param[in] name will point to a string with the device name |
---|
155 | * of the serial port with the mouse connected. |
---|
156 | * @param[in] type will point to a string with the type of mouse connected. |
---|
157 | * |
---|
158 | * @retval This method returns true on success and false on error. |
---|
159 | */ |
---|
160 | bool bsp_get_serial_mouse_device( |
---|
161 | const char **name, |
---|
162 | const char **type |
---|
163 | ); |
---|
164 | |
---|
165 | #ifdef __cplusplus |
---|
166 | } |
---|
167 | #endif |
---|
168 | /**@}*/ |
---|
169 | #endif /* __tty_drv__ */ |
---|