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

Revision 639, 3.7 kB (checked in by ppalmers, 17 years ago)

- Introduce a generic infrastructure for FFADODevices to present the clock sources they support and their state
- Implement this infrastructure for BeBoB devices
- Implement this infrastructure for ECHO Fireworks devices

Line 
1 /*
2  * Copyright (C) 2007 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 library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License version 2.1, as published by the Free Software Foundation;
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21  * MA 02110-1301 USA
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
44 public:
45     EfcHardwareInfoCmd();
46     virtual ~EfcHardwareInfoCmd() {};
47
48     virtual bool serialize( Util::IOSSerialize& se );
49     virtual bool deserialize( Util::IISDeserialize& de );
50
51     virtual const char* getCmdName() const
52     { return "EfcHardwareInfoCmd"; }
53    
54     virtual void showEfcCmd();
55
56     uint32_t            m_flags;
57    
58     uint64_t            m_guid;
59     uint32_t            m_type;
60     uint32_t            m_version;
61     char                m_vendor_name[ HWINFO_NAME_SIZE_BYTES ];
62     char                m_model_name[ HWINFO_NAME_SIZE_BYTES ];
63
64     uint32_t            m_supported_clocks;
65
66     uint32_t            m_nb_1394_playback_channels;
67     uint32_t            m_nb_1394_record_channels;
68
69     uint32_t            m_nb_phys_audio_out;
70     uint32_t            m_nb_phys_audio_in;
71    
72     uint32_t            m_nb_out_groups;
73     caps_phys_group     out_groups[ HWINFO_MAX_CAPS_GROUPS ];
74
75     uint32_t            m_nb_in_groups;
76     caps_phys_group     in_groups[ HWINFO_MAX_CAPS_GROUPS ];
77    
78     uint32_t            m_nb_midi_out;
79     uint32_t            m_nb_midi_in;
80    
81     uint32_t            m_max_sample_rate;
82     uint32_t            m_min_sample_rate;
83    
84     uint32_t            m_dsp_version;
85     uint32_t            m_arm_version;
86
87     uint32_t            num_mix_play_chan;
88     uint32_t            num_mix_rec_chan;
89
90     // Only present when efc_version == 1 (?or >= 1?)
91     uint32_t            m_fpga_version;    // version # for FPGA
92
93     uint32_t            m_nb_1394_play_chan_2x;
94     uint32_t            m_nb_1394_rec_chan_2x;
95
96     uint32_t            m_nb_1394_play_chan_4x;
97     uint32_t            m_nb_1394_rec_chan_4x;
98
99     uint32_t            m_reserved[16];
100
101 };
102
103
104 class EfcPolledValuesCmd : public EfcCmd
105 {
106
107 public:
108     EfcPolledValuesCmd();
109     virtual ~EfcPolledValuesCmd() {};
110
111     virtual bool serialize( Util::IOSSerialize& se );
112     virtual bool deserialize( Util::IISDeserialize& de );
113
114     virtual const char* getCmdName() const
115     { return "EfcPolledValuesCmd"; }
116    
117     virtual void showEfcCmd();
118
119
120     uint32_t            m_status;
121    
122     uint32_t            m_detect_spdif;
123     uint32_t            m_detect_adat;
124     uint32_t            m_reserved3;
125     uint32_t            m_reserved4;
126    
127     uint32_t            m_nb_output_meters;
128     uint32_t            m_nb_input_meters;
129     uint32_t            m_reserved5;
130     uint32_t            m_reserved6;
131     int32_t             m_meters[POLLED_MAX_NB_METERS];
132
133 };
134
135 } // namespace FireWorks
136
137 #endif // FIREWORKS_EFC_CMDS_HARDWARE_H
Note: See TracBrowser for help on using the browser.