root/trunk/libffado/src/fireworks/efc/efc_cmds_hardware.h

Revision 864, 4.4 kB (checked in by ppalmers, 15 years ago)

update license to GPLv2 or GPLv3 instead of GPLv2 or any later version. Update copyrights to reflect the new year

Line 
1 /*
2  * Copyright (C) 2005-2008 by Pieter Palmers
3  *
4  * This file is part of FFADO
5  * FFADO = Free Firewire (pro-)audio drivers for linux
6  *
7  * FFADO is based upon FreeBoB
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 2 of the License, or
12  * (at your option) version 3 of the License.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 #ifndef FIREWORKS_EFC_CMDS_HARDWARE_H
25 #define FIREWORKS_EFC_CMDS_HARDWARE_H
26
27 #include "efc_cmd.h"
28
29 namespace FireWorks {
30
31 #define HWINFO_NAME_SIZE_BYTES      32
32 #define HWINFO_MAX_CAPS_GROUPS      8
33 #define POLLED_MAX_NB_METERS        100
34
35 class EfcHardwareInfoCmd : public EfcCmd
36 {
37     typedef struct
38     {
39         uint8_t type;
40         uint8_t count;
41     } caps_phys_group;
42
43 public:
44     EfcHardwareInfoCmd();
45     virtual ~EfcHardwareInfoCmd() {};
46
47     virtual bool serialize( Util::Cmd::IOSSerialize& se );
48     virtual bool deserialize( Util::Cmd::IISDeserialize& de );
49
50     virtual const char* getCmdName() const
51     { return "EfcHardwareInfoCmd"; }
52    
53     virtual void showEfcCmd();
54    
55     bool hasSoftwarePhantom()
56         {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_HAS_PHANTOM);};
57     bool hasDSP()
58         {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_HAS_DSP);};
59     bool hasFPGA()
60         {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_HAS_FPGA);};
61     bool hasSpdifCoax()
62         {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_SPDIF_COAX_SUPPORTED);};
63     bool hasSpdifAESEBUXLR()
64         {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_SPDIF_AESEBUXLR_SUPPORTED);};
65     bool hasMirroring()
66         {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_MIRRORING_SUPPORTED);};
67     bool hasDynAddr()
68         {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_DYNADDR_SUPPORTED);};
69
70     uint32_t            m_flags;
71    
72     uint64_t            m_guid;
73     uint32_t            m_type;
74     uint32_t            m_version;
75     char                m_vendor_name[ HWINFO_NAME_SIZE_BYTES ];
76     char                m_model_name[ HWINFO_NAME_SIZE_BYTES ];
77
78     uint32_t            m_supported_clocks;
79
80     uint32_t            m_nb_1394_playback_channels;
81     uint32_t            m_nb_1394_record_channels;
82
83     uint32_t            m_nb_phys_audio_out;
84     uint32_t            m_nb_phys_audio_in;
85    
86     uint32_t            m_nb_out_groups;
87     caps_phys_group     out_groups[ HWINFO_MAX_CAPS_GROUPS ];
88
89     uint32_t            m_nb_in_groups;
90     caps_phys_group     in_groups[ HWINFO_MAX_CAPS_GROUPS ];
91    
92     uint32_t            m_nb_midi_out;
93     uint32_t            m_nb_midi_in;
94    
95     uint32_t            m_max_sample_rate;
96     uint32_t            m_min_sample_rate;
97    
98     uint32_t            m_dsp_version;
99     uint32_t            m_arm_version;
100
101     uint32_t            num_mix_play_chan;
102     uint32_t            num_mix_rec_chan;
103
104     // Only present when efc_version == 1 (?or >= 1?)
105     uint32_t            m_fpga_version;    // version # for FPGA
106
107     uint32_t            m_nb_1394_play_chan_2x;
108     uint32_t            m_nb_1394_rec_chan_2x;
109
110     uint32_t            m_nb_1394_play_chan_4x;
111     uint32_t            m_nb_1394_rec_chan_4x;
112
113     uint32_t            m_reserved[16];
114
115 };
116
117
118 class EfcPolledValuesCmd : public EfcCmd
119 {
120
121 public:
122     EfcPolledValuesCmd();
123     virtual ~EfcPolledValuesCmd() {};
124
125     virtual bool serialize( Util::Cmd::IOSSerialize& se );
126     virtual bool deserialize( Util::Cmd::IISDeserialize& de );
127
128     virtual const char* getCmdName() const
129     { return "EfcPolledValuesCmd"; }
130    
131     virtual void showEfcCmd();
132
133
134     uint32_t            m_status;
135    
136     uint32_t            m_detect_spdif;
137     uint32_t            m_detect_adat;
138     uint32_t            m_reserved3;
139     uint32_t            m_reserved4;
140    
141     uint32_t            m_nb_output_meters;
142     uint32_t            m_nb_input_meters;
143     uint32_t            m_reserved5;
144     uint32_t            m_reserved6;
145     int32_t             m_meters[POLLED_MAX_NB_METERS];
146
147 };
148
149 } // namespace FireWorks
150
151 #endif // FIREWORKS_EFC_CMDS_HARDWARE_H
Note: See TracBrowser for help on using the browser.