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

Revision 687, 3.7 kB (checked in by ppalmers, 13 years ago)

implement Flash routines

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_CMD_FLASH_H
25 #define FIREWORKS_EFC_CMD_FLASH_H
26
27 #include "efc_cmd.h"
28 // #define EFC_CMD_FLASH_ERASE             0
29 // #define EFC_CMD_FLASH_READ              1
30 // #define EFC_CMD_FLASH_WRITE             2
31 // #define EFC_CMD_FLASH_GET_STATUS        3
32 // #define EFC_CMD_FLASH_GET_SESSION_BASE  4
33 // #define EFC_CMD_FLASH_LOCK              5
34
35 #define EFC_FLASH_SIZE_BYTES            256
36 #define EFC_FLASH_SIZE_QUADS            (EFC_FLASH_SIZE_BYTES / 4)
37
38 namespace FireWorks {
39
40 class EfcFlashEraseCmd : public EfcCmd
41 {
42 public:
43     EfcFlashEraseCmd();
44     virtual ~EfcFlashEraseCmd() {};
45
46     virtual bool serialize( Util::IOSSerialize& se );
47     virtual bool deserialize( Util::IISDeserialize& de );
48
49     virtual const char* getCmdName() const
50     { return "EfcFlashEraseCmd"; }
51
52     virtual void showEfcCmd();
53
54     uint32_t    m_address;
55 };
56
57 class EfcFlashReadCmd : public EfcCmd
58 {
59 public:
60     EfcFlashReadCmd();
61     virtual ~EfcFlashReadCmd() {};
62
63     virtual bool serialize( Util::IOSSerialize& se );
64     virtual bool deserialize( Util::IISDeserialize& de );
65
66     virtual const char* getCmdName() const
67     { return "EfcFlashReadCmd"; }
68
69     virtual void showEfcCmd();
70
71     uint32_t    m_address;
72     uint32_t    m_nb_quadlets;
73     uint32_t    m_data[EFC_FLASH_SIZE_QUADS];
74 };
75
76 class EfcFlashWriteCmd : public EfcCmd
77 {
78 public:
79     EfcFlashWriteCmd();
80     virtual ~EfcFlashWriteCmd() {};
81
82     virtual bool serialize( Util::IOSSerialize& se );
83     virtual bool deserialize( Util::IISDeserialize& de );
84
85     virtual const char* getCmdName() const
86     { return "EfcFlashWriteCmd"; }
87
88     virtual void showEfcCmd();
89
90     uint32_t    m_address;
91     uint32_t    m_nb_quadlets;
92     uint32_t    m_data[EFC_FLASH_SIZE_QUADS];
93 };
94
95 class EfcFlashLockCmd : public EfcCmd
96 {
97 public:
98     EfcFlashLockCmd();
99     virtual ~EfcFlashLockCmd() {};
100
101     virtual bool serialize( Util::IOSSerialize& se );
102     virtual bool deserialize( Util::IISDeserialize& de );
103
104     virtual const char* getCmdName() const
105     { return "EfcFlashLockCmd"; }
106
107     virtual void showEfcCmd();
108
109     bool     m_lock;
110 };
111
112 class EfcFlashGetStatusCmd : public EfcCmd
113 {
114 public:
115     EfcFlashGetStatusCmd();
116     virtual ~EfcFlashGetStatusCmd() {};
117
118     virtual bool serialize( Util::IOSSerialize& se );
119     virtual bool deserialize( Util::IISDeserialize& de );
120
121     virtual const char* getCmdName() const
122     { return "EfcFlashGetStatusCmd"; }
123
124     virtual void showEfcCmd();
125
126     bool     m_ready;
127 };
128
129 class EfcFlashGetSessionBaseCmd : public EfcCmd
130 {
131 public:
132     EfcFlashGetSessionBaseCmd();
133     virtual ~EfcFlashGetSessionBaseCmd() {};
134
135     virtual bool serialize( Util::IOSSerialize& se );
136     virtual bool deserialize( Util::IISDeserialize& de );
137
138     virtual const char* getCmdName() const
139     { return "EfcFlashGetSessionBaseCmd"; }
140
141     virtual void showEfcCmd();
142
143     uint32_t    m_address;
144 };
145
146 } // namespace FireWorks
147
148 #endif // FIREWORKS_EFC_CMD_FLASH_H
Note: See TracBrowser for help on using the browser.