source: rtems/cpukit/libmisc/mw-fb/mw_uid.h @ 50d6077

4.104.114.84.95
Last change on this file since 50d6077 was 152b1e3, checked in by Joel Sherrill <joel.sherrill@…>, on 08/30/00 at 08:21:24

2000-08-26 Rosimildo da Silva <rdasilva@…>

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