Isomet Modular Synthesiser (iMS) API  v1.4.2
iMS API
Auxiliary.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2 / Title : Auxiliary Functions Header
3 / Project : Isomet Modular Synthesiser System
4 /------------------------------------------------------------------------------
5 / File : $URL: http://nutmeg.qytek.lan/svn/sw/trunk/09-Isomet/iMS_SDK/API/Auxiliary/h/Auxiliary.h $
6 / Author : $Author: dave $
7 / Company : Isomet (UK) Ltd
8 / Created : 2015-04-09
9 / Last update: $Date: 2017-10-06 15:33:32 +0100 (Fri, 06 Oct 2017) $
10 / Platform :
11 / Standard : C++11
12 / Revision : $Rev: 302 $
13 /------------------------------------------------------------------------------
14 / Description:
15 /------------------------------------------------------------------------------
16 / Copyright (c) 2015 Isomet (UK) Ltd. All Rights Reserved.
17 /------------------------------------------------------------------------------
18 / Revisions :
19 / Description
20 / 2015-04-09 1.0 dc Created
21 /
22 /----------------------------------------------------------------------------*/
23 
45 
46 #ifndef IMS_AUXILIARY_H__
47 #define IMS_AUXILIARY_H__
48 
49 #include "IEventHandler.h"
50 #include "IMSSystem.h"
51 #include "FileSystem.h"
52 
53 #include <memory>
54 #include <map>
55 #include <initializer_list>
56 #include <deque>
57 
59 #if defined _WIN32 || defined __CYGWIN__
60  #ifdef __GNUC__
61  #define DLL_EXPORT __attribute__ ((dllexport))
62  #define DLL_IMPORT __attribute__ ((dllimport))
63  #else
64  #define DLL_EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
65  #define DLL_IMPORT __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
66  #endif
67  #define DLL_LOCAL
68 #else
69  #if __GNUC__ >= 4
70  #define DLL_EXPORT __attribute__ ((visibility ("default")))
71  #define DLL_IMPORT __attribute__ ((visibility ("default")))
72  #define DLL_LOCAL __attribute__ ((visibility ("hidden")))
73  #else
74  #define DLL_EXPORT
75  #define DLL_IMPORT
76  #define DLL_LOCAL
77  #endif
78 #endif
79 
80 #if defined(_EXPORTING_IMS)
81  #define LIBSPEC DLL_EXPORT
82  #define LIBLOCAL DLL_LOCAL
83  #define EXPIMP_TEMPLATE
84 #elif defined(_STATIC_IMS)
85  #define LIBSPEC
86  #define LIBLOCAL
87  #define EXPIMP_TEMPLATE
88 #else
89  #define LIBSPEC DLL_IMPORT
90  #define LIBLOCAL DLL_LOCAL
91  #define EXPIMP_TEMPLATE extern
92 #endif
93 
95 namespace iMS
96 {
106  class LIBSPEC AuxiliaryEvents
107  {
108  public:
110  enum Events {
115  Count
116  };
117  };
118 
126  class LIBSPEC Auxiliary
127  {
128  public:
131 
132  Auxiliary(const IMSSystem& ims);
148  ~Auxiliary();
150 
154  enum class LED_SOURCE : std::uint16_t
155  {
157  OFF = 0,
159  ON = 1,
161  PULS = 2,
163  NPULS = 3,
165  PIXEL_ACT = 4,
167  CTRL_ACT = 5,
169  COMMS_HEALTHY = 6,
171  COMMS_UNHEALTHY = 7,
173  RF_GATE = 8,
175  INTERLOCK = 9,
177  LASER = 10,
179  CHECKSUM = 11,
181  OVERTEMP = 12,
183  PLL_LOCK = 13
184  };
185 
189  enum class LED_SINK
190  {
192  GREEN,
194  YELLOW,
196  RED
197  };
198 
202  enum class DDS_PROFILE : std::uint16_t
203  {
205  OFF = 0,
207  EXTERNAL = 16,
209  HOST = 32
210  };
211 
215  enum class EXT_ANLG_INPUT
216  {
218  A,
220  B
221  };
222 
224 
225  bool AssignLED(const LED_SINK& sink, const LED_SOURCE& src) const;
234 
236 
237  bool SetDDSProfile(const DDS_PROFILE& prfl) const;
250  bool SetDDSProfile(const DDS_PROFILE& prfl, const std::uint16_t& select) const;
252 
254 
255  bool UpdateAnalogIn();
272  const std::map<EXT_ANLG_INPUT, Percent>& GetAnalogData() const;
279  bool UpdateAnalogOut(Percent& pct) const;
281 
283 
284  void AuxiliaryEventSubscribe(const int message, IEventHandler* handler);
308  void AuxiliaryEventUnsubscribe(const int message, const IEventHandler* handler);
310  private:
311  // Make this object non-copyable
312  Auxiliary(const Auxiliary &);
313  const Auxiliary &operator =(const Auxiliary &);
314 
315  // Declare Implementation
316  class Impl;
317  Impl * p_Impl;
318  };
319 
351  class LIBSPEC DDSScriptRegister
352  {
353  public:
357  enum class Name : std::uint8_t
358  {
360  CSR = 0,
362  FR1 = 1,
364  FR2 = 2,
366  CFR = 3,
368  CFTW0 = 4,
370  CPOW0 = 5,
372  ACR = 6,
374  LSRR = 7,
376  RDW = 8,
378  FDW = 9,
380  CW1 = 10,
382  CW2 = 11,
384  CW3 = 12,
386  CW4 = 13,
388  CW5 = 14,
390  CW6 = 15,
392  CW7 = 16,
394  CW8 = 17,
396  CW9 = 18,
398  CW10 = 19,
400  CW11 = 20,
402  CW12 = 21,
404  CW13 = 22,
406  CW14 = 23,
408  CW15 = 24,
410  UPDATE = 64
411  };
412 
415 
416  DDSScriptRegister(Name name);
433  DDSScriptRegister(Name name, const std::initializer_list<std::uint8_t>& data);
437  DDSScriptRegister &operator =(const DDSScriptRegister &);
441 
445  int append(const std::uint8_t&);
446 
449  std::vector<std::uint8_t> bytes() const;
450 
451  private:
452  // Declare Implementation
453  class Impl;
454  Impl* p_Impl;
455  };
456 
459  using DDSScript = std::vector<DDSScriptRegister>;
460 
476  class LIBSPEC DDSScriptDownload
477  {
478  public:
483  DDSScriptDownload(IMSSystem& ims, const DDSScript& script);
486 
496  const FileSystemIndex Program(const std::string& FileName, FileDefault def = FileDefault::NON_DEFAULT) const;
497  private:
498  // Make this object non-copyable
500  const DDSScriptDownload &operator =(const DDSScriptDownload &);
501 
502  // Declare Implementation
503  class Impl;
504  Impl* p_Impl;
505  };
506 }
507 
508 #undef EXPIMP_TEMPLATE
509 #undef LIBSPEC
510 #endif
Provides auxiliary additional functions not directly related to Synthesiser operation.
Definition: Auxiliary.h:126
Classes for reading, writing and managing the file system built into an iMS Synthesiser.
Provides a mechanism for transferring DDS Scripts into Filesystem memory.
Definition: Auxiliary.h:476
FileDefault
Default flag tags a file entry for execution at startup (only one per filetype)
Definition: FileSystem.h:141
Events
List of Events raised by the Auxiliary module.
Definition: Auxiliary.h:110
Non-default is the normal state for most files.
Interface Class for User Application code to receive and process events from the iMS library...
LED_SINK
Which LED to assign function to.
Definition: Auxiliary.h:189
std::vector< DDSScriptRegister > DDSScript
DDSScript stores the sequence of register writes to be loaded onto the Synthesiser. Can be manipulated using the normal container operations provided by std::vector
Definition: Auxiliary.h:459
DDS_PROFILE
Control Source for Profile input to DDS Synthesiser IC.
Definition: Auxiliary.h:202
LED_SOURCE
Selects the function to be assigned to an LED.
Definition: Auxiliary.h:154
An object representing the overall configuration of an attached iMS System and permits applications t...
Definition: IMSSystem.h:361
Previous Analog Input Update request completed; data available to be read.
Definition: Auxiliary.h:112
Create a register write to send to the DDS IC.
Definition: Auxiliary.h:351
EXT_ANLG_INPUT
Reference enum for addressing both analog inputs.
Definition: Auxiliary.h:215
int FileSystemIndex
FileSystemIndex represents the entry number for a particular file in the FileSystemTable.
Definition: FileSystem.h:150
All the different types of events that can be triggered by the Auxiliary class.
Definition: Auxiliary.h:106
The entire API is encapsulated by the iMS namespace.
Definition: Auxiliary.h:95
Type Definition for all operations that require a percentage specification.
Definition: IMSTypeDefs.h:241
Classes within this group are used to store information about an iMS System and to Connect / Disconne...
Previous Analog Input Update request completed; request failed.
Definition: Auxiliary.h:114
Interface Class for an Event Handler to be defined in User Code and subscribed to library events...
Definition: IEventHandler.h:146
Name
the abbreviated register name for each register accessible in the DDS IC
Definition: Auxiliary.h:357