motu: the 4pre channel layout within packets is now believed to be correct. Thanks...
[ffado.git] / libffado / src / fireworks / efc / efc_cmds_hardware.h
blob4b1d746deecdf017dfb1a83089d79b21d91d8b45
1 /*
2 * Copyright (C) 2005-2008 by Pieter Palmers
4 * This file is part of FFADO
5 * FFADO = Free Firewire (pro-)audio drivers for linux
7 * FFADO is based upon FreeBoB
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.
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.
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/>.
24 #ifndef FIREWORKS_EFC_CMDS_HARDWARE_H
25 #define FIREWORKS_EFC_CMDS_HARDWARE_H
27 #include "efc_cmd.h"
29 namespace FireWorks {
31 #define HWINFO_NAME_SIZE_BYTES 32
32 #define HWINFO_MAX_CAPS_GROUPS 8
33 #define POLLED_MAX_NB_METERS 100
35 class EfcHardwareInfoCmd : public EfcCmd
37 typedef struct
39 uint8_t type;
40 uint8_t count;
41 } caps_phys_group;
43 public:
44 EfcHardwareInfoCmd();
45 virtual ~EfcHardwareInfoCmd() {};
47 virtual bool serialize( Util::Cmd::IOSSerialize& se );
48 virtual bool deserialize( Util::Cmd::IISDeserialize& de );
50 virtual const char* getCmdName() const
51 { return "EfcHardwareInfoCmd"; }
53 virtual void showEfcCmd();
55 bool hasPlaybackRouting() const
56 {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_HAS_PLAYBACK_ROUTING);};
57 bool hasSoftwarePhantom() const
58 {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_HAS_PHANTOM);};
59 bool hasDSP() const
60 {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_HAS_DSP);};
61 bool hasFPGA() const
62 {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_HAS_FPGA);};
63 bool hasOpticalInterface() const
64 {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_OPTICAL_INTERFACE_SUPPORTED);};
65 bool hasSpdifAESEBUXLR() const
66 {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_SPDIF_AESEBUXLR_SUPPORTED);};
67 bool hasMirroring() const
68 {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_MIRRORING_SUPPORTED);};
69 bool hasDynAddr() const
70 {return EFC_CMD_HW_CHECK_FLAG(m_flags, EFC_CMD_HW_DYNADDR_SUPPORTED);};
72 uint32_t m_flags;
74 uint64_t m_guid;
75 uint32_t m_type;
76 uint32_t m_version;
77 char m_vendor_name[ HWINFO_NAME_SIZE_BYTES ];
78 char m_model_name[ HWINFO_NAME_SIZE_BYTES ];
80 uint32_t m_supported_clocks;
82 uint32_t m_nb_1394_playback_channels;
83 uint32_t m_nb_1394_record_channels;
85 uint32_t m_nb_phys_audio_out;
86 uint32_t m_nb_phys_audio_in;
88 uint32_t m_nb_out_groups;
89 caps_phys_group out_groups[ HWINFO_MAX_CAPS_GROUPS ];
91 uint32_t m_nb_in_groups;
92 caps_phys_group in_groups[ HWINFO_MAX_CAPS_GROUPS ];
94 uint32_t m_nb_midi_out;
95 uint32_t m_nb_midi_in;
97 uint32_t m_max_sample_rate;
98 uint32_t m_min_sample_rate;
100 uint32_t m_dsp_version;
101 uint32_t m_arm_version;
103 uint32_t num_mix_play_chan;
104 uint32_t num_mix_rec_chan;
106 // Only present when efc_version == 1 (?or >= 1?)
107 uint32_t m_fpga_version; // version # for FPGA
109 uint32_t m_nb_1394_play_chan_2x;
110 uint32_t m_nb_1394_rec_chan_2x;
112 uint32_t m_nb_1394_play_chan_4x;
113 uint32_t m_nb_1394_rec_chan_4x;
115 uint32_t m_reserved[16];
120 class EfcPolledValuesCmd : public EfcCmd
123 public:
124 EfcPolledValuesCmd();
125 virtual ~EfcPolledValuesCmd() {};
127 virtual bool serialize( Util::Cmd::IOSSerialize& se );
128 virtual bool deserialize( Util::Cmd::IISDeserialize& de );
130 virtual const char* getCmdName() const
131 { return "EfcPolledValuesCmd"; }
133 virtual void showEfcCmd();
136 uint32_t m_status;
138 uint32_t m_detect_spdif;
139 uint32_t m_detect_adat;
140 uint32_t m_reserved3;
141 uint32_t m_reserved4;
143 uint32_t m_nb_output_meters;
144 uint32_t m_nb_input_meters;
145 uint32_t m_reserved5;
146 uint32_t m_reserved6;
147 int32_t m_meters[POLLED_MAX_NB_METERS];
151 } // namespace FireWorks
153 #endif // FIREWORKS_EFC_CMDS_HARDWARE_H