source: rtems/cpukit/libmisc/mw-fb/mw_uid.h @ 957d886

4.104.114.84.95
Last change on this file since 957d886 was 957d886, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/06 at 21:42:23

2006-09-11 Joel Sherrill <joel@…>

  • libmisc/mw-fb/mw_fb.c, libmisc/mw-fb/mw_fb.h, libmisc/mw-fb/mw_uid.c, libmisc/mw-fb/mw_uid.h: Remove warning.
  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*
2 * Copyright (c) 2000 - Rosimildo da Silva
3 *
4 * MODULE DESCRIPTION:
5 * This module defines the interface for input devices used by MicroWindows
6 * in an embedded system environment.
7 *
8 * $Id$
9 */
10
11#ifndef _MW_UID_H
12#define _MW_UID_H
13
14#ifdef  __cplusplus
15extern "C" {
16#endif
17
18/* 0x41XX  -- IOCLT functions for the Micro Input Devices commands */
19#define MW_UID_REGISTER_DEVICE     0x4100
20#define MW_UID_UNREGISTER_DEVICE   0x4101
21
22
23/* devices supported by MicroWindows */
24enum MW_INPUT_DEVICE_TYPE
25{
26    MV_UID_INVALID   = 0,
27    MV_UID_REL_POS   = 1,   /* mouse        */
28    MV_UID_ABS_POS   = 2,   /* touch-screen */
29    MV_UID_KBD       = 3,   /* keyboard     */
30    MV_UID_TIMER     = 4    /* timer -- not used */
31};
32
33
34/* matching MicroWindows */
35#define MV_BUTTON_RIGHT                 0x01
36#define MV_BUTTON_CENTER                0x02
37#define MV_BUTTON_LEFT                  0x04
38
39/* modifiers of the keyboard type devices */
40#define MV_KEY_MODIFIER_SHIFT_DOWN      0x10
41#define MV_KEY_MODIFIER_ALT_DOWN        0x20
42
43/* indication of the LEDS */
44#define MV_KEY_MODIFIER_CAPS_ON         0x04
45#define MV_KEY_MODIFIER_NUN_LOCK_ON     0x02
46#define MV_KEY_SCROLL_LOCK_ON           0x01
47
48/* keyboard modes -- default ASCII     */
49#define MV_KEY_MODE_ASCII               0x01
50/*
51 * This mode one event is sent when a key is pressed,
52 * and another one is send when a key is released.
53 */
54#define MV_KEY_MODE_SCANCODE            0x00
55
56
57/* these defines match with the linux keyboard range
58   for ioctls functions for the keyboard interface.
59   0x4BXX --- keyboard related functions
60 */
61#define MV_KDGKBMODE    0x4B44   /* gets current keyboard mode */
62#define MV_KDSKBMODE    0x4B45   /* sets current keyboard mode */
63
64/*
65 * Message generated by input devices controlled by MicroWindows.
66 */
67struct MW_UID_MESSAGE
68{
69  enum MW_INPUT_DEVICE_TYPE type;  /* device type */
70  union
71  {
72     /* fired when keyboard events are raised */
73     struct kbd_t {
74        unsigned short code;        /* keycode or scancode        */
75        unsigned char  modifiers;   /* key modifiers              */
76        unsigned char  mode;        /* current Kbd mode           */
77    } kbd;
78
79    /* fired when position events are raised, mouse, touch screen, etc */
80    struct pos_t {
81        unsigned short btns; /* indicates which buttons are pressed */
82        short x;             /* x location */
83        short y;             /* y location */
84        short z;             /* z location, 0 for 2D */
85    } pos;
86
87    /* fired by a timer device periodically */
88    struct timer_t {
89        unsigned long  frt;   /* free running timer */
90        unsigned long  seq;   /* sequence number */
91    } tmr;
92
93  } m;
94};
95
96
97/*
98 * API for creating/closing/accessing the message queue used by the micro
99 * input device interface. All functions in this interface returns a
100 * zero ( 0 ) on success. One exception for that is the "read" routine
101 * that returns the number of bytes read. Negaive numbers indicate errors
102 *
103 * The implementation of the message queue for RTEMS uses a POSIX message
104 * queue interface. It should be very portable among systems with a POSIX
105 * support.
106 */
107
108/* creates the message queue that holds events from the input devices */
109extern int uid_open_queue( const char *q_name, int flags, size_t max_msgs );
110
111/* closes message queue */
112extern int uid_close_queue( void );
113
114/*
115 * reads a message from the queue. It waits up to the specified
116 * timeout in mili-seconds.
117 */
118extern int uid_read_message( struct MW_UID_MESSAGE *m, unsigned long timeout );
119
120/* write a message to the queue */
121extern int uid_write_message( struct MW_UID_MESSAGE *m );
122
123
124/* register device to insert data to the queue */
125extern int uid_register_device( int fd, const char *q_name );
126
127/* unregister device to stop adding messages to the queue */
128extern int uid_unregister_device( int fd );
129
130/* set the keyboard */
131extern int uid_set_kbd_mode( int fd, int mode, int *old_mode );
132
133#ifdef  __cplusplus
134}
135#endif
136
137#endif /* _MW_UID_H */
Note: See TracBrowser for help on using the repository browser.