Isomet Modular Synthesiser (iMS) API  v1.4.2
iMS API
SystemFunc.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2 / Title : System Functions Header
3 / Project : Isomet Modular Synthesiser System
4 /------------------------------------------------------------------------------
5 / File : $URL: http://nutmeg.qytek.lan/svn/sw/trunk/09-Isomet/iMS_SDK/API/SystemFunc/h/SystemFunc.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 / Date Version Author Description
20 / 2015-04-09 1.0 dc Created
21 /
22 /----------------------------------------------------------------------------*/
23 
34 
35 #ifndef IMS_SYSTEMFUNC_H__
36 #define IMS_SYSTEMFUNC_H__
37 
38 #include "IMSSystem.h"
39 #include "IEventHandler.h"
40 #include "SignalPath.h"
41 #include "Auxiliary.h"
42 
43 #include <cstdint>
44 #include <list>
45 #include <memory>
46 
48 #if defined _WIN32 || defined __CYGWIN__
49  #ifdef __GNUC__
50  #define DLL_EXPORT __attribute__ ((dllexport))
51  #define DLL_IMPORT __attribute__ ((dllimport))
52  #else
53  #define DLL_EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
54  #define DLL_IMPORT __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
55  #endif
56  #define DLL_LOCAL
57 #else
58  #if __GNUC__ >= 4
59  #define DLL_EXPORT __attribute__ ((visibility ("default")))
60  #define DLL_IMPORT __attribute__ ((visibility ("default")))
61  #define DLL_LOCAL __attribute__ ((visibility ("hidden")))
62  #else
63  #define DLL_EXPORT
64  #define DLL_IMPORT
65  #define DLL_LOCAL
66  #endif
67 #endif
68 
69 #if defined(_EXPORTING_IMS)
70  #define LIBSPEC DLL_EXPORT
71  #define LIBLOCAL DLL_LOCAL
72  #define EXPIMP_TEMPLATE
73 #elif defined(_STATIC_IMS)
74  #define LIBSPEC
75  #define LIBLOCAL
76  #define EXPIMP_TEMPLATE
77 #else
78  #define LIBSPEC DLL_IMPORT
79  #define LIBLOCAL DLL_LOCAL
80  #define EXPIMP_TEMPLATE extern
81 #endif
82 
84 namespace iMS
85 {
95  class LIBSPEC SystemFuncEvents
96  {
97  public:
99  enum Events {
102  MASTER_CLOCK_REF_FREQ,
103  MASTER_CLOCK_REF_MODE,
104  MASTER_CLOCK_REF_STATUS,
105  SYNTH_TEMPERATURE_1,
106  SYNTH_TEMPERATURE_2,
107  Count
108  };
109  };
110 
111  // Forward declaration
112  struct StartupConfiguration;
113 
121  class LIBSPEC SystemFunc
122  {
123  public:
126 
127  SystemFunc(const IMSSystem& ims);
143  ~SystemFunc();
145 
150  enum class UpdateClockSource
151  {
153  INTERNAL,
155  EXTERNAL
156  };
161  enum class TemperatureSensor
162  {
164  TEMP_SENSOR_1,
166  TEMP_SENSOR_2
167  };
171  enum class PLLLockReference
172  {
174  INTERNAL,
176  EXTERNAL_FIXED,
178  EXTERNAL_AUTO,
182  EXTERNAL_FAILOVER
183  };
188  enum class PLLLockStatus
189  {
191  EXTERNAL_NOSIGNAL = 0,
193  INTERNAL_UNLOCKED = 4,
195  INTERNAL_LOCKED = 5,
197  EXTERNAL_VALID_UNLOCKED = 8,
199  EXTERNAL_LOCKED = 9
200  };
232 
233  enum class NHFLocalReset
237  {
239  NO_ACTION = 0,
241  RESET_ON_COMMS_UNHEALTHY = 1
242  };
245  bool ClearNHF();
253  bool ConfigureNHF(bool Enabled, int milliSeconds, NHFLocalReset reset);
255 
263 
264  bool EnableAmplifier(bool en);
275  bool EnableExternal(bool enable);
276 
283  bool EnableRFChannels(bool chan1_2, bool chan3_4);
285 
295  bool GetChecksumErrorCount(bool Reset = true);
299 
300  bool SetDDSUpdateClockSource(UpdateClockSource src = UpdateClockSource::INTERNAL);
314 
316 
317  bool StoreStartupConfig(const StartupConfiguration& cfg);
331 
333 
334  bool ReadSystemTemperature(SystemFunc::TemperatureSensor sensor);
347 
366 
367  bool SetClockReferenceMode(SystemFunc::PLLLockReference mode, kHz ExternalFixedFreq = kHz(1000.0));
383  bool GetClockReferenceStatus();
395  bool GetClockReferenceFrequency();
404  bool GetClockReferenceMode();
406 
408 
409  void SystemFuncEventSubscribe(const int message, IEventHandler* handler);
433  void SystemFuncEventUnsubscribe(const int message, const IEventHandler* handler);
435  private:
436  // Makes this object non-copyable
437  SystemFunc(const SystemFunc &);
438  const SystemFunc &operator =(const SystemFunc &);
439 
440  class Impl;
441  Impl * p_Impl;
442  };
443 
459  struct LIBSPEC StartupConfiguration
460  {
462  Percent RFAmplitudeWiper1{ 0.0 };
464  Percent RFAmplitudeWiper2{ 0.0 };
466  Percent DDSPower{ 0.0 };
470  bool RFGate{ false };
472  bool RFBias12{ false };
474  bool RFBias34{ false };
476  bool ExtEquipmentEnable{ false };
484  std::uint8_t LocalToneIndex{ 0 };
486  Degrees PhaseTuneCh1{ 0.0 };
488  Degrees PhaseTuneCh2{ 0.0 };
490  Degrees PhaseTuneCh3{ 0.0 };
492  Degrees PhaseTuneCh4{ 0.0 };
494  bool ChannelReversal{ false };
502  bool XYCompEnable{ false };
510  std::uint8_t GPOutput{ 0 };
514  bool CommsHealthyCheckEnabled{ false };
516  unsigned int CommsHealthyCheckTimerMilliseconds{ 500 };
518  SignalPath::SYNC_SRC SyncDigitalSource { SignalPath::SYNC_SRC::IMAGE_DIG };
520  SignalPath::SYNC_SRC SyncAnalogASource { SignalPath::SYNC_SRC::IMAGE_ANLG_A };
522  SignalPath::SYNC_SRC SyncAnalogBSource { SignalPath::SYNC_SRC::IMAGE_ANLG_B };
526  kHz ExtClockFrequency{ 1000.0 };
527  };
528 
529 }
530 
531 #undef EXPIMP_TEMPLATE
532 #undef LIBSPEC
533 #endif
PLLLockReference
Synthesiser Master Clock Reference Mode.
Definition: SystemFunc.h:171
Connect RF mixer inputs to digital pot wiper 1.
ToneBufferControl
Selects Control Source for the Local Tone Buffer.
Definition: SignalPath.h:167
Type Definition for all operations that require an angle specification in degrees.
Definition: IMSTypeDefs.h:314
PLLLockStatus
Synthesiser Master Clock Status Cast the status value reported to application code from a GetMasterCl...
Definition: SystemFunc.h:188
Do nothing other than set the NHF bit on future responses.
Illuminates when RF Gate to power amplifier is enabled and interlock is not set.
The Synthesiser stores in its non-volatile memory a set of configuration values that are preloaded on...
Definition: SystemFunc.h:459
Events
List of Events raised by the Signal Path module.
Definition: SystemFunc.h:99
Local Tone Buffer not used. Synthesiser outputs from Image data.
Use the Compensation Look-up Path.
Interface Class for User Application code to receive and process events from the iMS library...
NHFLocalReset
The action to perform at the iMS System when a Not Healthy condition is registered.
Definition: SystemFunc.h:236
TemperatureSensor
There are two available temperature sensors in the Synthesiser System.
Definition: SystemFunc.h:161
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
Classes for controlling the flow of data and RF signals through the Synthesiser.
Do not use the Compensation Look-up Path.
Illuminates when interlock is active (overtemperature, user disabled or no connection to amplifier/ac...
All the different types of events that can be triggered by the SystemFunc class.
Definition: SystemFunc.h:95
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...
UpdateClockSource
Determines whether DDS Synthesiser IC should have its update signal driven by the Synthesiser interna...
Definition: SystemFunc.h:150
Master Clock uses internal precision frequency reference.
The number of Errors accumulated on the Pixel Interface.
Definition: SystemFunc.h:101
Drive Update Signal internally (default)
Provides System Management functions not directly related to RF signal generation or signal path cont...
Definition: SystemFunc.h:121
AmplitudeControl
Selects Amplitude Control source for each of the 4 RF Channel outputs.
Definition: SignalPath.h:142
Type Definition for all operations that require a frequency specification in kiloHertz.
Definition: IMSTypeDefs.h:148
Classes for performing various auxiliary actions not directly related to driving Acousto-Optic device...
Compensation
Controls whether to use the Compensation Look-Up Table path for pixel data.
Definition: SignalPath.h:189
SYNC_SRC
Selects a source of Synchronous Output Data.
Definition: SignalPath.h:200