opmbellio.h revision 1.2.52.1 1 1.2.52.1 skrll /* $NetBSD: opmbellio.h,v 1.2.52.1 2004/08/03 10:42:56 skrll Exp $ */
2 1.2.52.1 skrll
3 1.1 oki /*
4 1.2.52.1 skrll * Copyright (c) 1995 Takuya Harakawa.
5 1.1 oki * All rights reserved.
6 1.1 oki *
7 1.1 oki * Redistribution and use in source and binary forms, with or without
8 1.1 oki * modification, are permitted provided that the following conditions
9 1.1 oki * are met:
10 1.1 oki * 1. Redistributions of source code must retain the above copyright
11 1.1 oki * notice, this list of conditions and the following disclaimer.
12 1.1 oki * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 oki * notice, this list of conditions and the following disclaimer in the
14 1.1 oki * documentation and/or other materials provided with the distribution.
15 1.1 oki * 3. All advertising materials mentioning features or use of this software
16 1.1 oki * must display the following acknowledgement:
17 1.2.52.1 skrll * This product includes software developed by Minoura Makoto.
18 1.2.52.1 skrll * 4. The name of the author may not be used to endorse or promote products
19 1.2.52.1 skrll * derived from this software without specific prior written permission
20 1.2.52.1 skrll *
21 1.2.52.1 skrll * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.2.52.1 skrll * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.2.52.1 skrll * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.2.52.1 skrll * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.2.52.1 skrll * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 1.2.52.1 skrll * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.2.52.1 skrll * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 1.2.52.1 skrll * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 1.2.52.1 skrll * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 1.2.52.1 skrll * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 1.2.52.1 skrll */
32 1.2.52.1 skrll
33 1.2.52.1 skrll /*
34 1.2.52.1 skrll * Copyright (c) 1990 The Regents of the University of California.
35 1.2.52.1 skrll * All rights reserved.
36 1.2.52.1 skrll *
37 1.2.52.1 skrll * Redistribution and use in source and binary forms, with or without
38 1.2.52.1 skrll * modification, are permitted provided that the following conditions
39 1.2.52.1 skrll * are met:
40 1.2.52.1 skrll * 1. Redistributions of source code must retain the above copyright
41 1.2.52.1 skrll * notice, this list of conditions and the following disclaimer.
42 1.2.52.1 skrll * 2. Redistributions in binary form must reproduce the above copyright
43 1.2.52.1 skrll * notice, this list of conditions and the following disclaimer in the
44 1.2.52.1 skrll * documentation and/or other materials provided with the distribution.
45 1.2.52.1 skrll * 3. Neither the name of the University nor the names of its contributors
46 1.1 oki * may be used to endorse or promote products derived from this software
47 1.1 oki * without specific prior written permission.
48 1.1 oki *
49 1.1 oki * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 1.1 oki * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 1.1 oki * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 1.1 oki * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 1.1 oki * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 1.1 oki * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 1.1 oki * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 1.1 oki * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 1.1 oki * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 1.1 oki * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 1.1 oki * SUCH DAMAGE.
60 1.1 oki *
61 1.2.52.1 skrll * $NetBSD: opmbellio.h,v 1.2.52.1 2004/08/03 10:42:56 skrll Exp $
62 1.1 oki */
63 1.1 oki
64 1.2.52.1 skrll #ifndef _X68K_OPMBELLIO_H_
65 1.2.52.1 skrll #define _X68K_OPMBELLIO_H_
66 1.1 oki #ifndef _IOCTL_
67 1.1 oki #include <sys/ioctl.h>
68 1.1 oki #endif
69 1.2.52.1 skrll #include <machine/opmreg.h>
70 1.1 oki
71 1.1 oki struct bell_info {
72 1.1 oki int volume;
73 1.1 oki int pitch;
74 1.1 oki int msec;
75 1.1 oki };
76 1.1 oki
77 1.1 oki /* default values */
78 1.1 oki #define BELL_VOLUME 100 /* percentage */
79 1.1 oki #define BELL_PITCH 440
80 1.1 oki #define BELL_DURATION 100
81 1.1 oki #define BELL_CHANNEL 7
82 1.1 oki
83 1.2.52.1 skrll /* Initial Voice Parameter; struct opm_voice */
84 1.2.52.1 skrll #define DEFAULT_BELL_VOICE { \
85 1.2.52.1 skrll /* AR DR SR RR SL OL KS ML DT1 DT2 AME */ \
86 1.2.52.1 skrll { 31, 0, 0, 0, 0, 39, 1, 1, 0, 0, 0, }, \
87 1.2.52.1 skrll { 19, 11, 0, 11, 4, 37, 0, 2, 0, 0, 0, }, \
88 1.2.52.1 skrll { 31, 15, 0, 9, 0, 55, 1, 4, 0, 0, 0, }, \
89 1.2.52.1 skrll { 19, 15, 0, 9, 0, 0, 1, 1, 0, 0, 0, }, \
90 1.2.52.1 skrll /* CON FL OP */ \
91 1.2.52.1 skrll 3, 7, 15 \
92 1.2.52.1 skrll }
93 1.2.52.1 skrll
94 1.1 oki /* limits */
95 1.1 oki #define MAXBVOLUME 100 /* 100 percent */
96 1.1 oki #define MAXBPITCH 4698
97 1.1 oki #define MINBPITCH 20
98 1.1 oki #define MAXBTIME 5000 /* 5 seconds */
99 1.1 oki
100 1.1 oki #define BELLIOCSPARAM _IOW('B', 0x1, struct bell_info)
101 1.1 oki #define BELLIOCGPARAM _IOR('B', 0x2, struct bell_info)
102 1.1 oki #define BELLIOCSVOICE _IOW('B', 0x3, struct opm_voice)
103 1.1 oki #define BELLIOCGVOICE _IOR('B', 0x4, struct opm_voice)
104 1.2.52.1 skrll
105 1.2.52.1 skrll #endif
106