1 | /*
|
---|
2 | * Copyright (c) 2014 Jiri Svoboda
|
---|
3 | * All rights reserved.
|
---|
4 | *
|
---|
5 | * Redistribution and use in source and binary forms, with or without
|
---|
6 | * modification, are permitted provided that the following conditions
|
---|
7 | * are met:
|
---|
8 | *
|
---|
9 | * - Redistributions of source code must retain the above copyright
|
---|
10 | * notice, this list of conditions and the following disclaimer.
|
---|
11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
12 | * notice, this list of conditions and the following disclaimer in the
|
---|
13 | * documentation and/or other materials provided with the distribution.
|
---|
14 | * - The name of the author may not be used to endorse or promote products
|
---|
15 | * derived from this software without specific prior written permission.
|
---|
16 | *
|
---|
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
27 | */
|
---|
28 |
|
---|
29 | /** @addtogroup hdaudio
|
---|
30 | * @{
|
---|
31 | */
|
---|
32 | /** @file High Definition Audio stream format
|
---|
33 | */
|
---|
34 |
|
---|
35 | #ifndef SPEC_FMT_H
|
---|
36 | #define SPEC_FMT_H
|
---|
37 |
|
---|
38 | typedef enum {
|
---|
39 | /** Stream Type */
|
---|
40 | fmt_type = 15,
|
---|
41 | /** Sample Base Rate */
|
---|
42 | fmt_base = 14,
|
---|
43 | /** Sample Base Rate Multiple (H) */
|
---|
44 | fmt_mult_h = 13,
|
---|
45 | /** Sample Base Rate Multiple (L) */
|
---|
46 | fmt_mult_l = 11,
|
---|
47 | /** Sample Base Rate Divisor (H) */
|
---|
48 | fmt_div_h = 10,
|
---|
49 | /** Sample Base Rate Divisor (L) */
|
---|
50 | fmt_div_l = 8,
|
---|
51 | /** Bits per Sample (H) */
|
---|
52 | fmt_bits_h = 6,
|
---|
53 | /** Bits per Sample (L) */
|
---|
54 | fmt_bits_l = 4,
|
---|
55 | /** Number of Channels (H) */
|
---|
56 | fmt_chan_h = 3,
|
---|
57 | /** Number of Channels (L) */
|
---|
58 | fmt_chan_l = 0
|
---|
59 | } hda_stream_fmt_bits_t;
|
---|
60 |
|
---|
61 | /** Stream Type */
|
---|
62 | typedef enum {
|
---|
63 | /** PCM */
|
---|
64 | fmt_type_pcm = 0,
|
---|
65 | /** Non-PCM */
|
---|
66 | fmt_type_nonpcm = 1
|
---|
67 | } hda_fmt_type_t;
|
---|
68 |
|
---|
69 | /** Sample Base Rate */
|
---|
70 | typedef enum {
|
---|
71 | /** 48 kHz */
|
---|
72 | fmt_base_48khz = 0,
|
---|
73 | /** 44.1 kHz */
|
---|
74 | fmt_base_44khz = 1
|
---|
75 | } hda_fmt_base_t;
|
---|
76 |
|
---|
77 | /** Sample Base Rate Multiple */
|
---|
78 | typedef enum {
|
---|
79 | /** 48 kHz/44.1 kHz or less */
|
---|
80 | fmt_mult_x1 = 0,
|
---|
81 | /** x2 (96 kHz, 88.2 kHz, 32 kHz) */
|
---|
82 | fmt_mult_x2 = 1,
|
---|
83 | /** x3 (144 kHz) */
|
---|
84 | fmt_mult_x3 = 2,
|
---|
85 | /** x4 (192 kHz, 176.4 kHz) */
|
---|
86 | fmt_mult_x4 = 3
|
---|
87 | } hda_fmt_mult_t;
|
---|
88 |
|
---|
89 | /** Sample Base Rate Divisor */
|
---|
90 | typedef enum {
|
---|
91 | /** Divide by 1 (48 kHz, 44.1 kHz) */
|
---|
92 | fmt_div_1 = 0,
|
---|
93 | /** Divide by 2 (24 kHz, 22.05 kHz) */
|
---|
94 | fmt_div_2 = 1,
|
---|
95 | /** Divide by 3 (16 kHz, 32 kHz) */
|
---|
96 | fmt_div_3 = 2,
|
---|
97 | /** Divide by 4 (11.025 kHz) */
|
---|
98 | fmt_div_4 = 3,
|
---|
99 | /** Divide by 5 (9.6 kHz) */
|
---|
100 | fmt_div_5 = 4,
|
---|
101 | /** Divide by 6 (8 kHz) */
|
---|
102 | fmt_div_6 = 5,
|
---|
103 | /** Divide by 7 */
|
---|
104 | fmt_div_7 = 6,
|
---|
105 | /** Divide by 8 (6 kHz) */
|
---|
106 | fmt_div_8 = 7
|
---|
107 | } hda_fmt_div_t;
|
---|
108 |
|
---|
109 | /** Bits per Sample */
|
---|
110 | typedef enum {
|
---|
111 | /** 8 bits */
|
---|
112 | fmt_bits_8 = 0,
|
---|
113 | /** 16 bits */
|
---|
114 | fmt_bits_16 = 1,
|
---|
115 | /** 20 bits */
|
---|
116 | fmt_bits_20 = 2,
|
---|
117 | /** 24 bits */
|
---|
118 | fmt_bits_24 = 3,
|
---|
119 | /** 32 bits */
|
---|
120 | fmt_bits_32 = 4
|
---|
121 | } hda_fmt_bits_t;
|
---|
122 |
|
---|
123 | /** Number of Channels */
|
---|
124 | typedef enum {
|
---|
125 | fmt_chan_1 = 0,
|
---|
126 | fmt_chan_2 = 1,
|
---|
127 | fmt_chan_3 = 2,
|
---|
128 | fmt_chan_4 = 3,
|
---|
129 | fmt_chan_5 = 4,
|
---|
130 | fmt_chan_6 = 5,
|
---|
131 | fmt_chan_7 = 6,
|
---|
132 | fmt_chan_8 = 7,
|
---|
133 | fmt_chan_9 = 8,
|
---|
134 | fmt_chan_10 = 9,
|
---|
135 | fmt_chan_11 = 10,
|
---|
136 | fmt_chan_12 = 11,
|
---|
137 | fmt_chan_13 = 12,
|
---|
138 | fmt_chan_14 = 13,
|
---|
139 | fmt_chan_15 = 14,
|
---|
140 | fmt_chan_16 = 15
|
---|
141 | } hda_fmt_chan_t;
|
---|
142 |
|
---|
143 | #endif
|
---|
144 |
|
---|
145 | /** @}
|
---|
146 | */
|
---|