libdrmconf 0.12.1
A library to program DMR radios.
Loading...
Searching...
No Matches
openuv380_codeplug.hh
1#ifndef OPENUV380_CODEPLUG_HH
2#define OPENUV380_CODEPLUG_HH
3
4#include "opengd77base_codeplug.hh"
5#include "opengd77_extension.hh"
6
7
13class OpenUV380Codeplug: public OpenGD77BaseCodeplug
14{
15 Q_OBJECT
16
17public:
19 explicit OpenUV380Codeplug(QObject *parent=nullptr);
20
21public:
22 void clearGeneralSettings();
23 bool encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
24 bool decodeGeneralSettings(Context &ctx, const ErrorStack &err=ErrorStack());
25
26 void clearDTMFSettings();
27 bool encodeDTMFSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
28 bool decodeDTMFSettings(Context &ctx, const ErrorStack &err=ErrorStack());
29
30 void clearAPRSSettings();
31 bool encodeAPRSSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
32 bool decodeAPRSSettings(Context &ctx, const ErrorStack &err=ErrorStack());
33
34 void clearContacts();
35 bool encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
36 bool createContacts(Context &ctx, const ErrorStack &err=ErrorStack());
37
38 void clearDTMFContacts();
39 bool encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
40 bool createDTMFContacts(Context &ctx, const ErrorStack &err=ErrorStack());
41
42 void clearChannels();
43 bool encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
44 bool createChannels(Context &ctx, const ErrorStack &err=ErrorStack());
45 bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack());
46
47 void clearBootSettings();
48 bool encodeBootSettings(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
49 bool decodeBootSettings(Context &ctx, const ErrorStack &err=ErrorStack());
50
51 void clearVFOSettings();
52
53 void clearZones();
54 bool encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
55 bool createZones(Context &ctx, const ErrorStack &err=ErrorStack());
56 bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack());
57
58 void clearGroupLists();
59 bool encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack());
60 bool createGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
61 bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack());
62
63public:
65 struct Limit: public Element::Limit {
67 static constexpr unsigned int channelBanks() { return 8; }
68 };
69
70protected:
72 struct ImageIndex {
74 static constexpr unsigned int settings() { return FLASH; }
75 static constexpr unsigned int dtmfSettings() { return FLASH; }
76 static constexpr unsigned int aprsSettings() { return FLASH; }
77 static constexpr unsigned int dtmfContacts() { return FLASH; }
78 static constexpr unsigned int channelBank0() { return FLASH; }
79 static constexpr unsigned int bootSettings() { return FLASH; }
80 static constexpr unsigned int vfoA() { return FLASH; }
81 static constexpr unsigned int vfoB() { return FLASH; }
82 static constexpr unsigned int zoneBank() { return FLASH; }
83 static constexpr unsigned int channelBank1() { return FLASH; }
84 static constexpr unsigned int contacts() { return FLASH; }
85 static constexpr unsigned int groupLists() { return FLASH; }
87 };
88
90 struct Offset {
92 static constexpr unsigned int settings() { return 0x00000080; }
93 static constexpr unsigned int dtmfSettings() { return 0x00001470; }
94 static constexpr unsigned int aprsSettings() { return 0x00001588; }
95 static constexpr unsigned int dtmfContacts() { return 0x00002f88; }
96 static constexpr unsigned int channelBank0() { return 0x00003780; } // Channels 1-128
97 static constexpr unsigned int bootSettings() { return 0x00007518; }
98 static constexpr unsigned int vfoA() { return 0x00007590; }
99 static constexpr unsigned int vfoB() { return 0x000075c8; }
100 static constexpr unsigned int zoneBank() { return 0x00008010; }
101 static constexpr unsigned int channelBank1() { return 0x0009b1b0; } // Channels 129-1024
102 static constexpr unsigned int contacts() { return 0x000a7620; }
103 static constexpr unsigned int groupLists() { return 0x000ad620; }
105 };
106};
107
108#endif // OPENUV380_CODEPLUG_HH
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:41
Represents, encodes and decodes the device specific codeplug for Open MD-UV380 firmware.
Definition openuv380_codeplug.hh:14
OpenUV380Codeplug(QObject *parent=nullptr)
Constructs an empty codeplug for the Open MD-UV380.
Definition openuv380_codeplug.cc:14
Internal used image indices.
Definition openuv380_codeplug.hh:72
Some Limits for this codeplug.
Definition openuv380_codeplug.hh:65
static constexpr unsigned int channelBanks()
Number of channel banks.
Definition openuv380_codeplug.hh:67
Some offsets.
Definition openuv380_codeplug.hh:90