root/trunk/libffado/src/rme/rme_avdevice.h

Revision 1239, 2.9 kB (checked in by ppalmers, 16 years ago)
Line 
1 /*
2  * Copyright (C) 2005-2008 by Jonathan Woithe
3  * Copyright (C) 2005-2008 by Pieter Palmers
4  *
5  * This file is part of FFADO
6  * FFADO = Free Firewire (pro-)audio drivers for linux
7  *
8  * FFADO is based upon FreeBoB.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 2 of the License, or
13  * (at your option) version 3 of the License.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24
25 #ifndef RMEDEVICE_H
26 #define RMEDEVICE_H
27
28 #include "ffadodevice.h"
29
30 #include "debugmodule/debugmodule.h"
31 #include "libavc/avc_definitions.h"
32
33 // #include "libstreaming/rme/RmeStreamProcessor.h"
34
35 /* RME Fireface register definitions */
36 #define RME_REG_DDS_CONTROL       0xfc88f000
37
38 class ConfigRom;
39 class Ieee1394Service;
40
41 namespace Rme {
42
43 // Note: the values in this enum do not have to correspond to the unit
44 // version reported by the respective devices.  It just so happens that they
45 // currently do for the Fireface-800 and Fireface-400.
46 enum ERmeModel {
47     RME_MODEL_NONE          = 0x0000,
48     RME_MODEL_FIREFACE800   = 0x0001,
49     RME_MODEL_FIREFACE400   = 0x0002,
50 };
51
52 // struct to define the supported devices
53 struct VendorModelEntry {
54     unsigned int vendor_id;
55     unsigned int unit_version;
56     enum ERmeModel model;
57     char *vendor_name;
58     char *model_name;
59 };
60
61 class RmeDevice : public FFADODevice {
62 public:
63
64     RmeDevice( DeviceManager& d,
65                std::auto_ptr<ConfigRom>( configRom ));
66     virtual ~RmeDevice();
67
68     static bool probe( ConfigRom& configRom, bool generic = false );
69     static FFADODevice * createDevice( DeviceManager& d,
70                                         std::auto_ptr<ConfigRom>( configRom ));
71     static int getConfigurationId( );
72     virtual bool discover();
73
74     virtual void showDevice();
75
76     virtual bool setSamplingFrequency( int samplingFrequency );
77     virtual int getSamplingFrequency( );
78
79     virtual ClockSourceVector getSupportedClockSources();
80     virtual bool setActiveClockSource(ClockSource);
81     virtual ClockSource getActiveClockSource();
82
83     virtual int getStreamCount();
84     virtual Streaming::StreamProcessor *getStreamProcessorByIndex(int i);
85
86     virtual bool prepare();
87     virtual bool lock();
88     virtual bool unlock();
89
90     virtual bool startStreamByIndex(int i);
91     virtual bool stopStreamByIndex(int i);
92
93     unsigned int readRegister(unsigned int reg);
94     signed int writeRegister(unsigned int reg, quadlet_t data);
95
96 protected:
97     struct VendorModelEntry *m_model;
98     enum ERmeModel m_rme_model;
99
100     signed int m_ddsFreq;
101 };
102
103 }
104
105 #endif
Note: See TracBrowser for help on using the browser.