ascreg.h revision 1.1 1 /* $NetBSD: ascreg.h,v 1.1 2024/03/13 07:55:28 nat Exp $ */
2
3 /*-
4 * Copyright (c) 2017, 2023 Nathanial Sloss <nathanialsloss (at) yahoo.com.au>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #ifndef _SYS_ARCH_MAC68K_OBIO_ASCREG_H
30 #define _SYS_ARCH_MAC68K_OBIO_ASCREG_H
31
32 #define ASCIRQ 5
33
34 #define FIFO_A 0
35 #define FIFO_B 0x400
36 #define FIFO_LEN 0x400
37
38 #define VERLOC 0x800
39
40 #define ASCMODE 0x801
41 #define MODESTOP 0
42 #define MODEFIFO 1
43 #define MODEWAVE 2 /* not in easc */
44
45 #define ASCTRL 0x802
46 #define UNDERRUN __BIT(7)
47 #define STEREO __BIT(1)
48 #define ANAPWM __BIT(0)
49
50 #define FIFOPARAM 0x803
51 #define CLEARFIFO __BIT(7)
52 #define NONCOMP __BIT(1)
53 #define ROMCOMP __BIT(0)
54
55 #define FIFOSTATUS 0x804
56 #define A_HALF __BIT(0)
57 #define A_FULL __BIT(1)
58 #define B_HALF __BIT(2)
59 #define B_FULL __BIT(3)
60
61 #define INTVOL 0x806 /* b2-b4 Int volume. b5-b7 ext. */
62
63 #define ASCRATE 0x807
64 #define MACFREQ 0 /* 22254 Hz */
65 #define F22KHZ 2 /* 22050 Hz */
66 #define F44KHZ 3 /* 44100 Hz */
67
68 #define APLAYREC 0x80a
69 #define RECORDA __BIT(0)
70 #define REC22KHZ __BIT(1)
71
72 #define ASCTEST 0x80f
73
74 #define A_WRITEPTRHI 0xf00
75 #define A_WRITEPTRLO 0xf01
76 #define A_READPTRHI 0xf02
77 #define A_READPTRLO 0xf03
78 #define B_WRITEPTRHI 0xf20
79 #define B_WRITEPTRLO 0xf21
80 #define B_READPTRHI 0xf22
81 #define B_READPTRLO 0xf23
82
83 #define A_LEFT_VOL 0xf06
84 #define A_RIGHT_VOL 0xf07
85 #define B_LEFT_VOL 0xf26
86 #define B_RIGHT_VOL 0xf27
87
88 #define FIFOCTRLA 0xf08
89 #define FIFOCTRLB 0xf28
90 #define CDQUALITY 0x81
91 #define MACDEFAULTS 0x80
92
93 #define IRQA 0xf09
94 #define IRQB 0xf29
95 #define DISABLEHALFIRQ __BIT(0)
96
97 #endif /* !_SYS_ARCH_MAC68K_OBIO_ASCREG_H */
98