-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathokFrontPanelDLL.cpp
executable file
·1500 lines (1300 loc) · 71.1 KB
/
okFrontPanelDLL.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//------------------------------------------------------------------------
// okFrontPanelDLL.c
//
// This is the import source for the FrontPanel API DLL. If you are
// building an application using the DLL, this source should be included
// within your C++/C project. It includes methods that will
// automatically load the DLL and map function calls to the DLL entry
// points.
//
// This library is not necessary when you call the DLL methods from
// another application or language such as LabVIEW or VisualBasic.
//
// This methods in this DLL correspond closely with the C++ API.
// Therefore, the C++ API documentation serves as the documentation for
// this DLL.
//
//
// NOTE: Before any API function calls are made, you MUST call:
// okFrontPanelDLL_LoadLib
//
// When you are finished using the API methods, you should call:
// okFrontPanelDLL_FreeLib
//
// The current DLL version can be retrieved by calling:
// okFrontPanelDLL_GetVersionString
//
//------------------------------------------------------------------------
// Copyright (c) 2005-2009 Opal Kelly Incorporated
// $Rev: 925 $ $Date: 2011-02-25 17:09:05 -0800 (Fri, 25 Feb 2011) $
//------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include "okFrontPanelDLL.h"
#if defined(_WIN32)
#if !defined(okLIB_NAME)
#define okLIB_NAME "okFrontPanel.dll"
#endif
#elif defined(__APPLE__)
#include <dlfcn.h>
#define okLIB_NAME "libokFrontPanel.dylib"
#elif defined(__linux__)
#include <dlfcn.h>
#define okLIB_NAME "./libokFrontPanel.so"
#endif
typedef void DLL;
static DLL *hLib = NULL;
static DLL_EP dll_entrypoint(DLL *dll, const char *name);
static DLL *dll_load(const char *libname);
static void dll_unload(DLL *dll);
static char VERSION_STRING[32];
#ifdef __cplusplus
#include <string>
//------------------------------------------------------------------------
// okCPLL22150 C++ wrapper class
//------------------------------------------------------------------------
bool okCPLL22150::to_bool(Bool x)
{ return( (x==TRUE)?(true):(false) ); }
Bool okCPLL22150::from_bool(bool x)
{ return( (x==true)?(TRUE):(FALSE) ); }
okCPLL22150::okCPLL22150()
{ h=okPLL22150_Construct(); }
void okCPLL22150::SetCrystalLoad(double capload)
{ okPLL22150_SetCrystalLoad(h, capload); }
void okCPLL22150::SetReference(double freq, bool extosc)
{ okPLL22150_SetReference(h, freq, from_bool(extosc)); }
double okCPLL22150::GetReference()
{ return(okPLL22150_GetReference(h)); }
bool okCPLL22150::SetVCOParameters(int p, int q)
{ return(to_bool(okPLL22150_SetVCOParameters(h,p,q))); }
int okCPLL22150::GetVCOP()
{ return(okPLL22150_GetVCOP(h)); }
int okCPLL22150::GetVCOQ()
{ return(okPLL22150_GetVCOQ(h)); }
double okCPLL22150::GetVCOFrequency()
{ return(okPLL22150_GetVCOFrequency(h)); }
void okCPLL22150::SetDiv1(DividerSource divsrc, int n)
{ okPLL22150_SetDiv1(h, (ok_DividerSource)divsrc, n); }
void okCPLL22150::SetDiv2(DividerSource divsrc, int n)
{ okPLL22150_SetDiv2(h, (ok_DividerSource)divsrc, n); }
okCPLL22150::DividerSource okCPLL22150::GetDiv1Source()
{ return((DividerSource) okPLL22150_GetDiv1Source(h)); }
okCPLL22150::DividerSource okCPLL22150::GetDiv2Source()
{ return((DividerSource) okPLL22150_GetDiv2Source(h)); }
int okCPLL22150::GetDiv1Divider()
{ return(okPLL22150_GetDiv1Divider(h)); }
int okCPLL22150::GetDiv2Divider()
{ return(okPLL22150_GetDiv2Divider(h)); }
void okCPLL22150::SetOutputSource(int output, okCPLL22150::ClockSource clksrc)
{ okPLL22150_SetOutputSource(h, output, (ok_ClockSource_22150)clksrc); }
void okCPLL22150::SetOutputEnable(int output, bool enable)
{ okPLL22150_SetOutputEnable(h, output, to_bool(enable)); }
okCPLL22150::ClockSource okCPLL22150::GetOutputSource(int output)
{ return( (ClockSource)okPLL22150_GetOutputSource(h, output)); }
double okCPLL22150::GetOutputFrequency(int output)
{ return(okPLL22150_GetOutputFrequency(h, output)); }
bool okCPLL22150::IsOutputEnabled(int output)
{ return(to_bool(okPLL22150_IsOutputEnabled(h, output))); }
void okCPLL22150::InitFromProgrammingInfo(unsigned char *buf)
{ okPLL22150_InitFromProgrammingInfo(h, buf); }
void okCPLL22150::GetProgrammingInfo(unsigned char *buf)
{ okPLL22150_GetProgrammingInfo(h, buf); }
//------------------------------------------------------------------------
// okCPLL22393 C++ wrapper class
//------------------------------------------------------------------------
bool okCPLL22393::to_bool(Bool x)
{ return( (x==TRUE)?(true):(false) ); }
Bool okCPLL22393::from_bool(bool x)
{ return( (x==true)?(TRUE):(FALSE) ); }
okCPLL22393::okCPLL22393()
{ h=okPLL22393_Construct(); }
void okCPLL22393::SetCrystalLoad(double capload)
{ okPLL22393_SetCrystalLoad(h, capload); }
void okCPLL22393::SetReference(double freq)
{ okPLL22393_SetReference(h, freq); }
double okCPLL22393::GetReference()
{ return(okPLL22393_GetReference(h)); }
bool okCPLL22393::SetPLLParameters(int n, int p, int q, bool enable)
{ return(to_bool(okPLL22393_SetPLLParameters(h, n, p, q, from_bool(enable)))); }
bool okCPLL22393::SetPLLLF(int n, int lf)
{ return(to_bool(okPLL22393_SetPLLLF(h, n, lf))); }
bool okCPLL22393::SetOutputDivider(int n, int div)
{ return(to_bool(okPLL22393_SetOutputDivider(h, n, div))); }
bool okCPLL22393::SetOutputSource(int n, okCPLL22393::ClockSource clksrc)
{ return(to_bool(okPLL22393_SetOutputSource(h, n, (ok_ClockSource_22393)clksrc))); }
void okCPLL22393::SetOutputEnable(int n, bool enable)
{ okPLL22393_SetOutputEnable(h, n, from_bool(enable)); }
int okCPLL22393::GetPLLP(int n)
{ return(okPLL22393_GetPLLP(h, n)); }
int okCPLL22393::GetPLLQ(int n)
{ return(okPLL22393_GetPLLQ(h, n)); }
double okCPLL22393::GetPLLFrequency(int n)
{ return(okPLL22393_GetPLLFrequency(h, n)); }
int okCPLL22393::GetOutputDivider(int n)
{ return(okPLL22393_GetOutputDivider(h, n)); }
okCPLL22393::ClockSource okCPLL22393::GetOutputSource(int n)
{ return((ClockSource) okPLL22393_GetOutputSource(h, n)); }
double okCPLL22393::GetOutputFrequency(int n)
{ return(okPLL22393_GetOutputFrequency(h, n)); }
bool okCPLL22393::IsOutputEnabled(int n)
{ return(to_bool(okPLL22393_IsOutputEnabled(h, n))); }
bool okCPLL22393::IsPLLEnabled(int n)
{ return(to_bool(okPLL22393_IsPLLEnabled(h, n))); }
void okCPLL22393::InitFromProgrammingInfo(unsigned char *buf)
{ okPLL22393_InitFromProgrammingInfo(h, buf); }
void okCPLL22393::GetProgrammingInfo(unsigned char *buf)
{ okPLL22393_GetProgrammingInfo(h, buf); }
//------------------------------------------------------------------------
// okCFrontPanel C++ wrapper class
//------------------------------------------------------------------------
bool okCFrontPanel::to_bool(Bool x)
{ return( (x==TRUE)?(true):(false) ); }
Bool okCFrontPanel::from_bool(bool x)
{ return( (x==true)?(TRUE):(FALSE) ); }
okCFrontPanel::okCFrontPanel()
{ h=okFrontPanel_Construct(); }
okCFrontPanel::~okCFrontPanel()
{ okFrontPanel_Destruct(h); }
int okCFrontPanel::GetHostInterfaceWidth()
{ return(okFrontPanel_GetHostInterfaceWidth(h)); }
bool okCFrontPanel::IsHighSpeed()
{ return(to_bool(okFrontPanel_IsHighSpeed(h))); }
okCFrontPanel::BoardModel okCFrontPanel::GetBoardModel()
{ return((okCFrontPanel::BoardModel)okFrontPanel_GetBoardModel(h)); }
std::string okCFrontPanel::GetBoardModelString(okCFrontPanel::BoardModel m)
{
char str[MAX_BOARDMODELSTRING_LENGTH];
okFrontPanel_GetBoardModelString(h, (ok_BoardModel)m, str);
return(std::string(str));
}
int okCFrontPanel::GetDeviceCount()
{ return(okFrontPanel_GetDeviceCount(h)); }
okCFrontPanel::BoardModel okCFrontPanel::GetDeviceListModel(int num)
{ return((okCFrontPanel::BoardModel)okFrontPanel_GetDeviceListModel(h, num)); }
std::string okCFrontPanel::GetDeviceListSerial(int num)
{
char str[MAX_SERIALNUMBER_LENGTH+1];
okFrontPanel_GetDeviceListSerial(h, num, str);
return(std::string(str));
}
void okCFrontPanel::EnableAsynchronousTransfers(bool enable)
{ okFrontPanel_EnableAsynchronousTransfers(h, to_bool(enable)); }
okCFrontPanel::ErrorCode okCFrontPanel::OpenBySerial(std::string str)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_OpenBySerial(h, str.c_str())); }
bool okCFrontPanel::IsOpen()
{ return(to_bool(okFrontPanel_IsOpen(h))); }
int okCFrontPanel::GetDeviceMajorVersion()
{ return(okFrontPanel_GetDeviceMajorVersion(h)); }
int okCFrontPanel::GetDeviceMinorVersion()
{ return(okFrontPanel_GetDeviceMinorVersion(h)); }
std::string okCFrontPanel::GetSerialNumber()
{
char str[MAX_SERIALNUMBER_LENGTH+1];
okFrontPanel_GetSerialNumber(h, str);
return(std::string(str));
}
std::string okCFrontPanel::GetDeviceID()
{
char str[MAX_DEVICEID_LENGTH+1];
okFrontPanel_GetDeviceID(h, str);
return(std::string(str));
}
void okCFrontPanel::SetDeviceID(const std::string str)
{ okFrontPanel_SetDeviceID(h, str.c_str()); }
okCFrontPanel::ErrorCode okCFrontPanel::SetBTPipePollingInterval(int interval)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_SetBTPipePollingInterval(h, interval)); }
void okCFrontPanel::SetTimeout(int timeout)
{ okFrontPanel_SetTimeout(h, timeout); }
okCFrontPanel::ErrorCode okCFrontPanel::ResetFPGA()
{ return((okCFrontPanel::ErrorCode) okFrontPanel_ResetFPGA(h)); }
okCFrontPanel::ErrorCode okCFrontPanel::ConfigureFPGAFromMemory(unsigned char *data, const unsigned long length, void(*callback)(int, int, void *), void *arg)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_ConfigureFPGAFromMemory(h, data, length)); }
okCFrontPanel::ErrorCode okCFrontPanel::ConfigureFPGA(const std::string strFilename, void (*callback)(int, int, void *), void *arg)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_ConfigureFPGA(h, strFilename.c_str())); }
okCFrontPanel::ErrorCode okCFrontPanel::WriteI2C(const int addr, int length, unsigned char *data)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_WriteI2C(h, addr, length, data)); }
okCFrontPanel::ErrorCode okCFrontPanel::ReadI2C(const int addr, int length, unsigned char *data)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_ReadI2C(h, addr, length, data)); }
okCFrontPanel::ErrorCode okCFrontPanel::GetPLL22150Configuration(okCPLL22150& pll)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_GetPLL22150Configuration(h, pll.h)); }
okCFrontPanel::ErrorCode okCFrontPanel::SetPLL22150Configuration(okCPLL22150& pll)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_SetPLL22150Configuration(h, pll.h)); }
okCFrontPanel::ErrorCode okCFrontPanel::GetEepromPLL22150Configuration(okCPLL22150& pll)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_GetEepromPLL22150Configuration(h, pll.h)); }
okCFrontPanel::ErrorCode okCFrontPanel::SetEepromPLL22150Configuration(okCPLL22150& pll)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_SetEepromPLL22150Configuration(h, pll.h)); }
okCFrontPanel::ErrorCode okCFrontPanel::GetPLL22393Configuration(okCPLL22393& pll)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_GetPLL22393Configuration(h, pll.h)); }
okCFrontPanel::ErrorCode okCFrontPanel::SetPLL22393Configuration(okCPLL22393& pll)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_SetPLL22393Configuration(h, pll.h)); }
okCFrontPanel::ErrorCode okCFrontPanel::GetEepromPLL22393Configuration(okCPLL22393& pll)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_GetEepromPLL22393Configuration(h, pll.h)); }
okCFrontPanel::ErrorCode okCFrontPanel::SetEepromPLL22393Configuration(okCPLL22393& pll)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_SetEepromPLL22393Configuration(h, pll.h)); }
okCFrontPanel::ErrorCode okCFrontPanel::LoadDefaultPLLConfiguration()
{ return((okCFrontPanel::ErrorCode) okFrontPanel_LoadDefaultPLLConfiguration(h)); }
bool okCFrontPanel::IsFrontPanelEnabled()
{ return(to_bool(okFrontPanel_IsFrontPanelEnabled(h))); }
bool okCFrontPanel::IsFrontPanel3Supported()
{ return(to_bool(okFrontPanel_IsFrontPanel3Supported(h))); }
// void UnregisterAll();
// void AddEventHandler(okCEventHandler *handler);
void okCFrontPanel::UpdateWireIns()
{ okFrontPanel_UpdateWireIns(h); }
okCFrontPanel::ErrorCode okCFrontPanel::SetWireInValue(int ep, UINT32 val, UINT32 mask)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_SetWireInValue(h, ep, val, mask)); }
void okCFrontPanel::UpdateWireOuts()
{ okFrontPanel_UpdateWireOuts(h); }
UINT32 okCFrontPanel::GetWireOutValue(int epAddr)
{ return(okFrontPanel_GetWireOutValue(h, epAddr)); }
okCFrontPanel::ErrorCode okCFrontPanel::ActivateTriggerIn(int epAddr, int bit)
{ return((okCFrontPanel::ErrorCode) okFrontPanel_ActivateTriggerIn(h, epAddr, bit)); }
void okCFrontPanel::UpdateTriggerOuts()
{ okFrontPanel_UpdateTriggerOuts(h); }
bool okCFrontPanel::IsTriggered(int epAddr, UINT32 mask)
{ return(to_bool(okFrontPanel_IsTriggered(h, epAddr, mask))); }
long okCFrontPanel::GetLastTransferLength()
{ return(okFrontPanel_GetLastTransferLength(h)); }
long okCFrontPanel::WriteToPipeIn(int epAddr, long length, unsigned char *data)
{ return(okFrontPanel_WriteToPipeIn(h, epAddr, length, data)); }
long okCFrontPanel::ReadFromPipeOut(int epAddr, long length, unsigned char *data)
{ return(okFrontPanel_ReadFromPipeOut(h, epAddr, length, data)); }
long okCFrontPanel::WriteToBlockPipeIn(int epAddr, int blockSize, long length, unsigned char *data)
{ return(okFrontPanel_WriteToBlockPipeIn(h, epAddr, blockSize, length, data)); }
long okCFrontPanel::ReadFromBlockPipeOut(int epAddr, int blockSize, long length, unsigned char *data)
{ return(okFrontPanel_ReadFromBlockPipeOut(h, epAddr, blockSize, length, data)); }
#endif // __cplusplus
//------------------------------------------------------------------------
// Function prototypes
//------------------------------------------------------------------------
typedef void (DLL_ENTRY *OKFRONTPANELDLL_GETVERSION_FN) (char *, char *);
typedef okPLL22150_HANDLE (DLL_ENTRY *OKPLL22150_CONSTRUCT_FN) (void);
typedef void (DLL_ENTRY *OKPLL22150_DESTRUCT_FN) (okPLL22150_HANDLE);
typedef void (DLL_ENTRY *OKPLL22150_SETCRYSTALLOAD_FN) (okPLL22150_HANDLE, double);
typedef void (DLL_ENTRY *OKPLL22150_SETREFERENCE_FN) (okPLL22150_HANDLE, double, Bool);
typedef double (DLL_ENTRY *OKPLL22150_GETREFERENCE_FN) (okPLL22150_HANDLE);
typedef Bool (DLL_ENTRY *OKPLL22150_SETVCOPARAMETERS_FN) (okPLL22150_HANDLE, int, int);
typedef int (DLL_ENTRY *OKPLL22150_GETVCOP_FN) (okPLL22150_HANDLE);
typedef int (DLL_ENTRY *OKPLL22150_GETVCOQ_FN) (okPLL22150_HANDLE);
typedef double (DLL_ENTRY *OKPLL22150_GETVCOFREQUENCY_FN) (okPLL22150_HANDLE);
typedef void (DLL_ENTRY *OKPLL22150_SETDIV1_FN) (okPLL22150_HANDLE, ok_DividerSource, int);
typedef void (DLL_ENTRY *OKPLL22150_SETDIV2_FN) (okPLL22150_HANDLE, ok_DividerSource, int);
typedef ok_DividerSource (DLL_ENTRY *OKPLL22150_GETDIV1SOURCE_FN) (okPLL22150_HANDLE);
typedef ok_DividerSource (DLL_ENTRY *OKPLL22150_GETDIV2SOURCE_FN) (okPLL22150_HANDLE);
typedef int (DLL_ENTRY *OKPLL22150_GETDIV1DIVIDER_FN) (okPLL22150_HANDLE);
typedef int (DLL_ENTRY *OKPLL22150_GETDIV2DIVIDER_FN) (okPLL22150_HANDLE);
typedef void (DLL_ENTRY *OKPLL22150_SETOUTPUTSOURCE_FN) (okPLL22150_HANDLE, int, ok_ClockSource_22150);
typedef void (DLL_ENTRY *OKPLL22150_SETOUTPUTENABLE_FN) (okPLL22150_HANDLE, int, Bool);
typedef ok_ClockSource_22150 (DLL_ENTRY *OKPLL22150_GETOUTPUTSOURCE_FN) (okPLL22150_HANDLE, int);
typedef double (DLL_ENTRY *OKPLL22150_GETOUTPUTFREQUENCY_FN) (okPLL22150_HANDLE, int);
typedef Bool (DLL_ENTRY *OKPLL22150_ISOUTPUTENABLED_FN) (okPLL22150_HANDLE, int);
typedef void (DLL_ENTRY *OKPLL22150_INITFROMPROGRAMMINGINFO_FN) (okPLL22150_HANDLE, unsigned char *);
typedef void (DLL_ENTRY *OKPLL22150_GETPROGRAMMINGINFO_FN) (okPLL22150_HANDLE, unsigned char *);
typedef okPLL22393_HANDLE (DLL_ENTRY *OKPLL22393_CONSTRUCT_FN) (void);
typedef void (DLL_ENTRY *OKPLL22393_DESTRUCT_FN) (okPLL22393_HANDLE);
typedef void (DLL_ENTRY *OKPLL22393_SETCRYSTALLOAD_FN) (okPLL22393_HANDLE, double);
typedef void (DLL_ENTRY *OKPLL22393_SETREFERENCE_FN) (okPLL22393_HANDLE, double);
typedef double (DLL_ENTRY *OKPLL22393_GETREFERENCE_FN) (okPLL22393_HANDLE);
typedef Bool (DLL_ENTRY *OKPLL22393_SETPLLPARAMETERS_FN) (okPLL22393_HANDLE, int, int, int, Bool);
typedef Bool (DLL_ENTRY *OKPLL22393_SETPLLLF_FN) (okPLL22393_HANDLE, int, int);
typedef Bool (DLL_ENTRY *OKPLL22393_SETOUTPUTDIVIDER_FN) (okPLL22393_HANDLE, int, int);
typedef Bool (DLL_ENTRY *OKPLL22393_SETOUTPUTSOURCE_FN) (okPLL22393_HANDLE, int, ok_ClockSource_22393);
typedef void (DLL_ENTRY *OKPLL22393_SETOUTPUTENABLE_FN) (okPLL22393_HANDLE, int, Bool);
typedef int (DLL_ENTRY *OKPLL22393_GETPLLP_FN) (okPLL22393_HANDLE, int);
typedef int (DLL_ENTRY *OKPLL22393_GETPLLQ_FN) (okPLL22393_HANDLE, int);
typedef double (DLL_ENTRY *OKPLL22393_GETPLLFREQUENCY_FN) (okPLL22393_HANDLE, int);
typedef int (DLL_ENTRY *OKPLL22393_GETOUTPUTDIVIDER_FN) (okPLL22393_HANDLE, int);
typedef ok_ClockSource_22393 (DLL_ENTRY *OKPLL22393_GETOUTPUTSOURCE_FN) (okPLL22393_HANDLE, int);
typedef double (DLL_ENTRY *OKPLL22393_GETOUTPUTFREQUENCY_FN) (okPLL22393_HANDLE, int);
typedef Bool (DLL_ENTRY *OKPLL22393_ISOUTPUTENABLED_FN) (okPLL22393_HANDLE, int);
typedef Bool (DLL_ENTRY *OKPLL22393_ISPLLENABLED_FN) (okPLL22393_HANDLE, int);
typedef void (DLL_ENTRY *OKPLL22393_INITFROMPROGRAMMINGINFO_FN) (okPLL22393_HANDLE, unsigned char *);
typedef void (DLL_ENTRY *OKPLL22393_GETPROGRAMMINGINFO_FN) (okPLL22393_HANDLE, unsigned char *);
typedef okFrontPanel_HANDLE (DLL_ENTRY *okFrontPanel_CONSTRUCT_FN) (void);
typedef void (DLL_ENTRY *okFrontPanel_DESTRUCT_FN) (okFrontPanel_HANDLE);
typedef int (DLL_ENTRY *okFrontPanel_GETHOSTINTERFACEWIDTH_FN) (okFrontPanel_HANDLE);
typedef Bool (DLL_ENTRY *okFrontPanel_ISHIGHSPEED_FN) (okFrontPanel_HANDLE);
typedef ok_BoardModel (DLL_ENTRY *okFrontPanel_GETBOARDMODEL_FN) (okFrontPanel_HANDLE);
typedef void (DLL_ENTRY *okFrontPanel_GETBOARDMODELSTRING_FN) (okFrontPanel_HANDLE, ok_BoardModel, char *);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_WRITEI2C_FN) (okFrontPanel_HANDLE, const int, int, unsigned char *);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_READI2C_FN) (okFrontPanel_HANDLE, const int, int, unsigned char *);
typedef int (DLL_ENTRY *okFrontPanel_GETDEVICECOUNT_FN) (okFrontPanel_HANDLE);
typedef ok_BoardModel (DLL_ENTRY *okFrontPanel_GETDEVICELISTMODEL_FN) (okFrontPanel_HANDLE, int);
typedef void (DLL_ENTRY *okFrontPanel_GETDEVICELISTSERIAL_FN) (okFrontPanel_HANDLE, int, char *);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_OPENBYSERIAL_FN) (okFrontPanel_HANDLE, const char *);
typedef Bool (DLL_ENTRY *okFrontPanel_ISOPEN_FN) (okFrontPanel_HANDLE);
typedef void (DLL_ENTRY *okFrontPanel_ENABLEASYNCHRONOUSTRANSFERS_FN) (okFrontPanel_HANDLE, Bool);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_SETBTPIPEPOLLINGINTERVAL_FN) (okFrontPanel_HANDLE, int);
typedef void (DLL_ENTRY *okFrontPanel_SETTIMEOUT_FN) (okFrontPanel_HANDLE, int);
typedef int (DLL_ENTRY *okFrontPanel_GETDEVICEMAJORVERSION_FN) (okFrontPanel_HANDLE);
typedef int (DLL_ENTRY *okFrontPanel_GETDEVICEMINORVERSION_FN) (okFrontPanel_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_RESETFPGA_FN) (okFrontPanel_HANDLE);
typedef void (DLL_ENTRY *okFrontPanel_GETSERIALNUMBER_FN) (okFrontPanel_HANDLE, char *);
typedef void (DLL_ENTRY *okFrontPanel_GETDEVICEID_FN) (okFrontPanel_HANDLE, char *);
typedef void (DLL_ENTRY *okFrontPanel_SETDEVICEID_FN) (okFrontPanel_HANDLE, const char *);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_CONFIGUREFPGA_FN) (okFrontPanel_HANDLE, const char *);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_CONFIGUREFPGAFROMMEMORY_FN) (okFrontPanel_HANDLE, unsigned char *, unsigned long);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_GETPLL22150CONFIGURATION_FN) (okFrontPanel_HANDLE, okPLL22150_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_SETPLL22150CONFIGURATION_FN) (okFrontPanel_HANDLE, okPLL22150_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_GETEEPROMPLL22150CONFIGURATION_FN) (okFrontPanel_HANDLE, okPLL22150_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_SETEEPROMPLL22150CONFIGURATION_FN) (okFrontPanel_HANDLE, okPLL22150_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_GETPLL22393CONFIGURATION_FN) (okFrontPanel_HANDLE, okPLL22393_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_SETPLL22393CONFIGURATION_FN) (okFrontPanel_HANDLE, okPLL22393_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_GETEEPROMPLL22393CONFIGURATION_FN) (okFrontPanel_HANDLE, okPLL22393_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_SETEEPROMPLL22393CONFIGURATION_FN) (okFrontPanel_HANDLE, okPLL22393_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_LOADDEFAULTPLLCONFIGURATION_FN) (okFrontPanel_HANDLE);
typedef Bool (DLL_ENTRY *okFrontPanel_ISFRONTPANELENABLED_FN) (okFrontPanel_HANDLE);
typedef Bool (DLL_ENTRY *okFrontPanel_ISFRONTPANEL3SUPPORTED_FN) (okFrontPanel_HANDLE);
typedef void (DLL_ENTRY *okFrontPanel_UPDATEWIREINS_FN) (okFrontPanel_HANDLE);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_SETWIREINVALUE_FN) (okFrontPanel_HANDLE, int, UINT32, UINT32);
typedef void (DLL_ENTRY *okFrontPanel_UPDATEWIREOUTS_FN) (okFrontPanel_HANDLE);
typedef UINT32 (DLL_ENTRY *okFrontPanel_GETWIREOUTVALUE_FN) (okFrontPanel_HANDLE, int);
typedef ok_ErrorCode (DLL_ENTRY *okFrontPanel_ACTIVATETRIGGERIN_FN) (okFrontPanel_HANDLE, int, int);
typedef void (DLL_ENTRY *okFrontPanel_UPDATETRIGGEROUTS_FN) (okFrontPanel_HANDLE);
typedef Bool (DLL_ENTRY *okFrontPanel_ISTRIGGERED_FN) (okFrontPanel_HANDLE, int, UINT32);
typedef long (DLL_ENTRY *okFrontPanel_GETLASTTRANSFERLENGTH_FN) (okFrontPanel_HANDLE);
typedef long (DLL_ENTRY *okFrontPanel_WRITETOPIPEIN_FN) (okFrontPanel_HANDLE, int, long, unsigned char *);
typedef long (DLL_ENTRY *okFrontPanel_WRITETOBLOCKPIPEIN_FN) (okFrontPanel_HANDLE, int, long, int, unsigned char *);
typedef long (DLL_ENTRY *okFrontPanel_READFROMPIPEOUT_FN) (okFrontPanel_HANDLE, int, long, unsigned char *);
typedef long (DLL_ENTRY *okFrontPanel_READFROMBLOCKPIPEOUT_FN) (okFrontPanel_HANDLE, int, long, int, unsigned char *);
//------------------------------------------------------------------------
// Function pointers
//------------------------------------------------------------------------
OKFRONTPANELDLL_GETVERSION_FN _okFrontPanelDLL_GetVersion = NULL;
OKPLL22393_CONSTRUCT_FN _okPLL22393_Construct = NULL;
OKPLL22393_DESTRUCT_FN _okPLL22393_Destruct = NULL;
OKPLL22393_SETCRYSTALLOAD_FN _okPLL22393_SetCrystalLoad = NULL;
OKPLL22393_SETREFERENCE_FN _okPLL22393_SetReference = NULL;
OKPLL22393_GETREFERENCE_FN _okPLL22393_GetReference = NULL;
OKPLL22393_SETPLLPARAMETERS_FN _okPLL22393_SetPLLParameters = NULL;
OKPLL22393_SETPLLLF_FN _okPLL22393_SetPLLLF = NULL;
OKPLL22393_SETOUTPUTDIVIDER_FN _okPLL22393_SetOutputDivider = NULL;
OKPLL22393_SETOUTPUTSOURCE_FN _okPLL22393_SetOutputSource = NULL;
OKPLL22393_SETOUTPUTENABLE_FN _okPLL22393_SetOutputEnable = NULL;
OKPLL22393_GETPLLP_FN _okPLL22393_GetPLLP = NULL;
OKPLL22393_GETPLLQ_FN _okPLL22393_GetPLLQ = NULL;
OKPLL22393_GETPLLFREQUENCY_FN _okPLL22393_GetPLLFrequency = NULL;
OKPLL22393_GETOUTPUTDIVIDER_FN _okPLL22393_GetOutputDivider = NULL;
OKPLL22393_GETOUTPUTSOURCE_FN _okPLL22393_GetOutputSource = NULL;
OKPLL22393_GETOUTPUTFREQUENCY_FN _okPLL22393_GetOutputFrequency = NULL;
OKPLL22393_ISOUTPUTENABLED_FN _okPLL22393_IsOutputEnabled = NULL;
OKPLL22393_ISPLLENABLED_FN _okPLL22393_IsPLLEnabled = NULL;
OKPLL22393_INITFROMPROGRAMMINGINFO_FN _okPLL22393_InitFromProgrammingInfo = NULL;
OKPLL22393_GETPROGRAMMINGINFO_FN _okPLL22393_GetProgrammingInfo = NULL;
OKPLL22150_CONSTRUCT_FN _okPLL22150_Construct = NULL;
OKPLL22150_DESTRUCT_FN _okPLL22150_Destruct = NULL;
OKPLL22150_SETCRYSTALLOAD_FN _okPLL22150_SetCrystalLoad = NULL;
OKPLL22150_SETREFERENCE_FN _okPLL22150_SetReference = NULL;
OKPLL22150_GETREFERENCE_FN _okPLL22150_GetReference = NULL;
OKPLL22150_SETVCOPARAMETERS_FN _okPLL22150_SetVCOParameters = NULL;
OKPLL22150_GETVCOP_FN _okPLL22150_GetVCOP = NULL;
OKPLL22150_GETVCOQ_FN _okPLL22150_GetVCOQ = NULL;
OKPLL22150_GETVCOFREQUENCY_FN _okPLL22150_GetVCOFrequency = NULL;
OKPLL22150_SETDIV1_FN _okPLL22150_SetDiv1 = NULL;
OKPLL22150_SETDIV2_FN _okPLL22150_SetDiv2 = NULL;
OKPLL22150_GETDIV1SOURCE_FN _okPLL22150_GetDiv1Source = NULL;
OKPLL22150_GETDIV2SOURCE_FN _okPLL22150_GetDiv2Source = NULL;
OKPLL22150_GETDIV1DIVIDER_FN _okPLL22150_GetDiv1Divider = NULL;
OKPLL22150_GETDIV2DIVIDER_FN _okPLL22150_GetDiv2Divider = NULL;
OKPLL22150_SETOUTPUTSOURCE_FN _okPLL22150_SetOutputSource = NULL;
OKPLL22150_SETOUTPUTENABLE_FN _okPLL22150_SetOutputEnable = NULL;
OKPLL22150_GETOUTPUTSOURCE_FN _okPLL22150_GetOutputSource = NULL;
OKPLL22150_GETOUTPUTFREQUENCY_FN _okPLL22150_GetOutputFrequency = NULL;
OKPLL22150_ISOUTPUTENABLED_FN _okPLL22150_IsOutputEnabled = NULL;
OKPLL22150_INITFROMPROGRAMMINGINFO_FN _okPLL22150_InitFromProgrammingInfo = NULL;
OKPLL22150_GETPROGRAMMINGINFO_FN _okPLL22150_GetProgrammingInfo = NULL;
okFrontPanel_CONSTRUCT_FN _okFrontPanel_Construct = NULL;
okFrontPanel_DESTRUCT_FN _okFrontPanel_Destruct = NULL;
okFrontPanel_GETHOSTINTERFACEWIDTH_FN _okFrontPanel_GetHostInterfaceWidth = NULL;
okFrontPanel_ISHIGHSPEED_FN _okFrontPanel_IsHighSpeed = NULL;
okFrontPanel_GETBOARDMODEL_FN _okFrontPanel_GetBoardModel = NULL;
okFrontPanel_GETBOARDMODELSTRING_FN _okFrontPanel_GetBoardModelString = NULL;
okFrontPanel_WRITEI2C_FN _okFrontPanel_WriteI2C = NULL;
okFrontPanel_READI2C_FN _okFrontPanel_ReadI2C = NULL;
okFrontPanel_GETDEVICECOUNT_FN _okFrontPanel_GetDeviceCount = NULL;
okFrontPanel_GETDEVICELISTMODEL_FN _okFrontPanel_GetDeviceListModel = NULL;
okFrontPanel_GETDEVICELISTSERIAL_FN _okFrontPanel_GetDeviceListSerial = NULL;
okFrontPanel_OPENBYSERIAL_FN _okFrontPanel_OpenBySerial = NULL;
okFrontPanel_ISOPEN_FN _okFrontPanel_IsOpen = NULL;
okFrontPanel_ENABLEASYNCHRONOUSTRANSFERS_FN _okFrontPanel_EnableAsynchronousTransfers = NULL;
okFrontPanel_SETBTPIPEPOLLINGINTERVAL_FN _okFrontPanel_SetBTPipePollingInterval = NULL;
okFrontPanel_SETTIMEOUT_FN _okFrontPanel_SetTimeout = NULL;
okFrontPanel_GETDEVICEMAJORVERSION_FN _okFrontPanel_GetDeviceMajorVersion = NULL;
okFrontPanel_GETDEVICEMINORVERSION_FN _okFrontPanel_GetDeviceMinorVersion = NULL;
okFrontPanel_RESETFPGA_FN _okFrontPanel_ResetFPGA = NULL;
okFrontPanel_GETSERIALNUMBER_FN _okFrontPanel_GetSerialNumber = NULL;
okFrontPanel_GETDEVICEID_FN _okFrontPanel_GetDeviceID = NULL;
okFrontPanel_SETDEVICEID_FN _okFrontPanel_SetDeviceID = NULL;
okFrontPanel_CONFIGUREFPGA_FN _okFrontPanel_ConfigureFPGA = NULL;
okFrontPanel_CONFIGUREFPGAFROMMEMORY_FN _okFrontPanel_ConfigureFPGAFromMemory = NULL;
okFrontPanel_GETPLL22150CONFIGURATION_FN _okFrontPanel_GetPLL22150Configuration = NULL;
okFrontPanel_SETPLL22150CONFIGURATION_FN _okFrontPanel_SetPLL22150Configuration = NULL;
okFrontPanel_GETEEPROMPLL22150CONFIGURATION_FN _okFrontPanel_GetEepromPLL22150Configuration = NULL;
okFrontPanel_SETEEPROMPLL22150CONFIGURATION_FN _okFrontPanel_SetEepromPLL22150Configuration = NULL;
okFrontPanel_GETPLL22393CONFIGURATION_FN _okFrontPanel_GetPLL22393Configuration = NULL;
okFrontPanel_SETPLL22393CONFIGURATION_FN _okFrontPanel_SetPLL22393Configuration = NULL;
okFrontPanel_GETEEPROMPLL22393CONFIGURATION_FN _okFrontPanel_GetEepromPLL22393Configuration = NULL;
okFrontPanel_SETEEPROMPLL22393CONFIGURATION_FN _okFrontPanel_SetEepromPLL22393Configuration = NULL;
okFrontPanel_LOADDEFAULTPLLCONFIGURATION_FN _okFrontPanel_LoadDefaultPLLConfiguration = NULL;
okFrontPanel_ISFRONTPANELENABLED_FN _okFrontPanel_IsFrontPanelEnabled = NULL;
okFrontPanel_ISFRONTPANEL3SUPPORTED_FN _okFrontPanel_IsFrontPanel3Supported = NULL;
okFrontPanel_UPDATEWIREINS_FN _okFrontPanel_UpdateWireIns = NULL;
okFrontPanel_SETWIREINVALUE_FN _okFrontPanel_SetWireInValue = NULL;
okFrontPanel_UPDATEWIREOUTS_FN _okFrontPanel_UpdateWireOuts = NULL;
okFrontPanel_GETWIREOUTVALUE_FN _okFrontPanel_GetWireOutValue = NULL;
okFrontPanel_ACTIVATETRIGGERIN_FN _okFrontPanel_ActivateTriggerIn = NULL;
okFrontPanel_UPDATETRIGGEROUTS_FN _okFrontPanel_UpdateTriggerOuts = NULL;
okFrontPanel_ISTRIGGERED_FN _okFrontPanel_IsTriggered = NULL;
okFrontPanel_GETLASTTRANSFERLENGTH_FN _okFrontPanel_GetLastTransferLength = NULL;
okFrontPanel_WRITETOPIPEIN_FN _okFrontPanel_WriteToPipeIn = NULL;
okFrontPanel_WRITETOBLOCKPIPEIN_FN _okFrontPanel_WriteToBlockPipeIn = NULL;
okFrontPanel_READFROMPIPEOUT_FN _okFrontPanel_ReadFromPipeOut = NULL;
okFrontPanel_READFROMBLOCKPIPEOUT_FN _okFrontPanel_ReadFromBlockPipeOut = NULL;
//------------------------------------------------------------------------
/// Returns the version number of the DLL.
const char *
okFrontPanelDLL_GetVersionString()
{
return(VERSION_STRING);
}
/// Loads the FrontPanel API DLL. This function returns False if the
/// DLL did not load for some reason, True otherwise.
Bool
okFrontPanelDLL_LoadLib(const char *libname)
{
// Return TRUE if the DLL is already loaded.
if (hLib)
return(TRUE);
if (NULL == libname)
hLib = dll_load(okLIB_NAME);
else
hLib = dll_load(libname);
if (hLib) {
_okFrontPanelDLL_GetVersion = ( OKFRONTPANELDLL_GETVERSION_FN ) dll_entrypoint( hLib, "okFrontPanelDLL_GetVersion" );
_okPLL22150_Construct = ( OKPLL22150_CONSTRUCT_FN ) dll_entrypoint( hLib, "okPLL22150_Construct" );
_okPLL22150_Destruct = ( OKPLL22150_DESTRUCT_FN ) dll_entrypoint( hLib, "okPLL22150_Destruct" );
_okPLL22150_SetCrystalLoad = ( OKPLL22150_SETCRYSTALLOAD_FN ) dll_entrypoint( hLib, "okPLL22150_SetCrystalLoad" );
_okPLL22150_SetReference = ( OKPLL22150_SETREFERENCE_FN ) dll_entrypoint( hLib, "okPLL22150_SetReference" );
_okPLL22150_GetReference = ( OKPLL22150_GETREFERENCE_FN ) dll_entrypoint( hLib, "okPLL22150_GetReference" );
_okPLL22150_SetVCOParameters = ( OKPLL22150_SETVCOPARAMETERS_FN ) dll_entrypoint( hLib, "okPLL22150_SetVCOParameters" );
_okPLL22150_GetVCOP = ( OKPLL22150_GETVCOP_FN ) dll_entrypoint( hLib, "okPLL22150_GetVCOP" );
_okPLL22150_GetVCOQ = ( OKPLL22150_GETVCOQ_FN ) dll_entrypoint( hLib, "okPLL22150_GetVCOQ" );
_okPLL22150_GetVCOFrequency = ( OKPLL22150_GETVCOFREQUENCY_FN ) dll_entrypoint( hLib, "okPLL22150_GetVCOFrequency" );
_okPLL22150_SetDiv1 = ( OKPLL22150_SETDIV1_FN ) dll_entrypoint( hLib, "okPLL22150_SetDiv1" );
_okPLL22150_SetDiv2 = ( OKPLL22150_SETDIV2_FN ) dll_entrypoint( hLib, "okPLL22150_SetDiv2" );
_okPLL22150_GetDiv1Source = ( OKPLL22150_GETDIV1SOURCE_FN ) dll_entrypoint( hLib, "okPLL22150_GetDiv1Source" );
_okPLL22150_GetDiv2Source = ( OKPLL22150_GETDIV2SOURCE_FN ) dll_entrypoint( hLib, "okPLL22150_GetDiv2Source" );
_okPLL22150_GetDiv1Divider = ( OKPLL22150_GETDIV1DIVIDER_FN ) dll_entrypoint( hLib, "okPLL22150_GetDiv1Divider" );
_okPLL22150_GetDiv2Divider = ( OKPLL22150_GETDIV2DIVIDER_FN ) dll_entrypoint( hLib, "okPLL22150_GetDiv2Divider" );
_okPLL22150_SetOutputSource = ( OKPLL22150_SETOUTPUTSOURCE_FN ) dll_entrypoint( hLib, "okPLL22150_SetOutputSource" );
_okPLL22150_SetOutputEnable = ( OKPLL22150_SETOUTPUTENABLE_FN ) dll_entrypoint( hLib, "okPLL22150_SetOutputEnable" );
_okPLL22150_GetOutputSource = ( OKPLL22150_GETOUTPUTSOURCE_FN ) dll_entrypoint( hLib, "okPLL22150_GetOutputSource" );
_okPLL22150_GetOutputFrequency = ( OKPLL22150_GETOUTPUTFREQUENCY_FN ) dll_entrypoint( hLib, "okPLL22150_GetOutputFrequency" );
_okPLL22150_IsOutputEnabled = ( OKPLL22150_ISOUTPUTENABLED_FN ) dll_entrypoint( hLib, "okPLL22150_IsOutputEnabled" );
_okPLL22150_InitFromProgrammingInfo = ( OKPLL22150_INITFROMPROGRAMMINGINFO_FN ) dll_entrypoint( hLib, "okPLL22150_InitFromProgrammingInfo" );
_okPLL22150_GetProgrammingInfo = ( OKPLL22150_GETPROGRAMMINGINFO_FN ) dll_entrypoint( hLib, "okPLL22150_GetProgrammingInfo" );
_okPLL22393_Construct = ( OKPLL22393_CONSTRUCT_FN ) dll_entrypoint( hLib, "okPLL22393_Construct" );
_okPLL22393_Destruct = ( OKPLL22393_DESTRUCT_FN ) dll_entrypoint( hLib, "okPLL22393_Destruct" );
_okPLL22393_SetCrystalLoad = ( OKPLL22393_SETCRYSTALLOAD_FN ) dll_entrypoint( hLib, "okPLL22393_SetCrystalLoad" );
_okPLL22393_SetReference = ( OKPLL22393_SETREFERENCE_FN ) dll_entrypoint( hLib, "okPLL22393_SetReference" );
_okPLL22393_GetReference = ( OKPLL22393_GETREFERENCE_FN ) dll_entrypoint( hLib, "okPLL22393_GetReference" );
_okPLL22393_SetPLLParameters = ( OKPLL22393_SETPLLPARAMETERS_FN ) dll_entrypoint( hLib, "okPLL22393_SetPLLParameters" );
_okPLL22393_SetPLLLF = ( OKPLL22393_SETPLLLF_FN ) dll_entrypoint( hLib, "okPLL22393_SetPLLLF" );
_okPLL22393_SetOutputDivider = ( OKPLL22393_SETOUTPUTDIVIDER_FN ) dll_entrypoint( hLib, "okPLL22393_SetOutputDivider" );
_okPLL22393_SetOutputSource = ( OKPLL22393_SETOUTPUTSOURCE_FN ) dll_entrypoint( hLib, "okPLL22393_SetOutputSource" );
_okPLL22393_SetOutputEnable = ( OKPLL22393_SETOUTPUTENABLE_FN ) dll_entrypoint( hLib, "okPLL22393_SetOutputEnable" );
_okPLL22393_GetPLLP = ( OKPLL22393_GETPLLP_FN ) dll_entrypoint( hLib, "okPLL22393_GetPLLP" );
_okPLL22393_GetPLLQ = ( OKPLL22393_GETPLLQ_FN ) dll_entrypoint( hLib, "okPLL22393_GetPLLQ" );
_okPLL22393_GetPLLFrequency = ( OKPLL22393_GETPLLFREQUENCY_FN ) dll_entrypoint( hLib, "okPLL22393_GetPLLFrequency" );
_okPLL22393_GetOutputDivider = ( OKPLL22393_GETOUTPUTDIVIDER_FN ) dll_entrypoint( hLib, "okPLL22393_GetOutputDivider" );
_okPLL22393_GetOutputSource = ( OKPLL22393_GETOUTPUTSOURCE_FN ) dll_entrypoint( hLib, "okPLL22393_GetOutputSource" );
_okPLL22393_GetOutputFrequency = ( OKPLL22393_GETOUTPUTFREQUENCY_FN ) dll_entrypoint( hLib, "okPLL22393_GetOutputFrequency" );
_okPLL22393_IsOutputEnabled = ( OKPLL22393_ISOUTPUTENABLED_FN ) dll_entrypoint( hLib, "okPLL22393_IsOutputEnabled" );
_okPLL22393_IsPLLEnabled = ( OKPLL22393_ISPLLENABLED_FN ) dll_entrypoint( hLib, "okPLL22393_IsPLLEnabled" );
_okPLL22393_InitFromProgrammingInfo = ( OKPLL22393_INITFROMPROGRAMMINGINFO_FN ) dll_entrypoint( hLib, "okPLL22393_InitFromProgrammingInfo" );
_okPLL22393_GetProgrammingInfo = ( OKPLL22393_GETPROGRAMMINGINFO_FN ) dll_entrypoint( hLib, "okPLL22393_GetProgrammingInfo" );
_okFrontPanel_Construct = ( okFrontPanel_CONSTRUCT_FN ) dll_entrypoint( hLib, "okFrontPanel_Construct" );
_okFrontPanel_Destruct = ( okFrontPanel_DESTRUCT_FN ) dll_entrypoint( hLib, "okFrontPanel_Destruct" );
_okFrontPanel_GetHostInterfaceWidth = ( okFrontPanel_GETHOSTINTERFACEWIDTH_FN ) dll_entrypoint( hLib, "okFrontPanel_GetHostInterfaceWidth" );
_okFrontPanel_IsHighSpeed = ( okFrontPanel_ISHIGHSPEED_FN ) dll_entrypoint( hLib, "okFrontPanel_IsHighSpeed" );
_okFrontPanel_GetBoardModel = ( okFrontPanel_GETBOARDMODEL_FN ) dll_entrypoint( hLib, "okFrontPanel_GetBoardModel" );
_okFrontPanel_GetBoardModelString = ( okFrontPanel_GETBOARDMODELSTRING_FN ) dll_entrypoint( hLib, "okFrontPanel_GetBoardModelString" );
_okFrontPanel_WriteI2C = ( okFrontPanel_WRITEI2C_FN ) dll_entrypoint( hLib, "okFrontPanel_WriteI2C" );
_okFrontPanel_ReadI2C = ( okFrontPanel_READI2C_FN ) dll_entrypoint( hLib, "okFrontPanel_ReadI2C" );
_okFrontPanel_GetDeviceCount = ( okFrontPanel_GETDEVICECOUNT_FN ) dll_entrypoint( hLib, "okFrontPanel_GetDeviceCount" );
_okFrontPanel_GetDeviceListModel = ( okFrontPanel_GETDEVICELISTMODEL_FN ) dll_entrypoint( hLib, "okFrontPanel_GetDeviceListModel" );
_okFrontPanel_GetDeviceListSerial = ( okFrontPanel_GETDEVICELISTSERIAL_FN ) dll_entrypoint( hLib, "okFrontPanel_GetDeviceListSerial" );
_okFrontPanel_OpenBySerial = ( okFrontPanel_OPENBYSERIAL_FN ) dll_entrypoint( hLib, "okFrontPanel_OpenBySerial" );
_okFrontPanel_IsOpen = ( okFrontPanel_ISOPEN_FN ) dll_entrypoint( hLib, "okFrontPanel_IsOpen" );
_okFrontPanel_SetBTPipePollingInterval = ( okFrontPanel_SETBTPIPEPOLLINGINTERVAL_FN ) dll_entrypoint( hLib, "okFrontPanel_SetBTPipePollingInterval" );
_okFrontPanel_SetTimeout = ( okFrontPanel_SETTIMEOUT_FN ) dll_entrypoint( hLib, "okFrontPanel_SetTimeout" );
_okFrontPanel_EnableAsynchronousTransfers = ( okFrontPanel_ENABLEASYNCHRONOUSTRANSFERS_FN ) dll_entrypoint( hLib, "okFrontPanel_EnableAsynchronousTransfers" );
_okFrontPanel_GetDeviceMajorVersion = ( okFrontPanel_GETDEVICEMAJORVERSION_FN ) dll_entrypoint( hLib, "okFrontPanel_GetDeviceMajorVersion" );
_okFrontPanel_GetDeviceMinorVersion = ( okFrontPanel_GETDEVICEMINORVERSION_FN ) dll_entrypoint( hLib, "okFrontPanel_GetDeviceMinorVersion" );
_okFrontPanel_ResetFPGA = ( okFrontPanel_RESETFPGA_FN ) dll_entrypoint( hLib, "okFrontPanel_ResetFPGA" );
_okFrontPanel_GetSerialNumber = ( okFrontPanel_GETSERIALNUMBER_FN ) dll_entrypoint( hLib, "okFrontPanel_GetSerialNumber" );
_okFrontPanel_GetDeviceID = ( okFrontPanel_GETDEVICEID_FN ) dll_entrypoint( hLib, "okFrontPanel_GetDeviceID" );
_okFrontPanel_SetDeviceID = ( okFrontPanel_SETDEVICEID_FN ) dll_entrypoint( hLib, "okFrontPanel_SetDeviceID" );
_okFrontPanel_ConfigureFPGA = ( okFrontPanel_CONFIGUREFPGA_FN ) dll_entrypoint( hLib, "okFrontPanel_ConfigureFPGA" );
_okFrontPanel_ConfigureFPGAFromMemory = ( okFrontPanel_CONFIGUREFPGAFROMMEMORY_FN ) dll_entrypoint( hLib, "okFrontPanel_ConfigureFPGAFromMemory" );
_okFrontPanel_GetPLL22150Configuration = ( okFrontPanel_GETPLL22150CONFIGURATION_FN ) dll_entrypoint( hLib, "okFrontPanel_GetPLL22150Configuration" );
_okFrontPanel_SetPLL22150Configuration = ( okFrontPanel_SETPLL22150CONFIGURATION_FN ) dll_entrypoint( hLib, "okFrontPanel_SetPLL22150Configuration" );
_okFrontPanel_GetEepromPLL22150Configuration = ( okFrontPanel_GETEEPROMPLL22150CONFIGURATION_FN ) dll_entrypoint( hLib, "okFrontPanel_GetEepromPLL22150Configuration" );
_okFrontPanel_SetEepromPLL22150Configuration = ( okFrontPanel_SETEEPROMPLL22150CONFIGURATION_FN ) dll_entrypoint( hLib, "okFrontPanel_SetEepromPLL22150Configuration" );
_okFrontPanel_GetPLL22393Configuration = ( okFrontPanel_GETPLL22393CONFIGURATION_FN ) dll_entrypoint( hLib, "okFrontPanel_GetPLL22393Configuration" );
_okFrontPanel_SetPLL22393Configuration = ( okFrontPanel_SETPLL22393CONFIGURATION_FN ) dll_entrypoint( hLib, "okFrontPanel_SetPLL22393Configuration" );
_okFrontPanel_GetEepromPLL22393Configuration = ( okFrontPanel_GETEEPROMPLL22393CONFIGURATION_FN ) dll_entrypoint( hLib, "okFrontPanel_GetEepromPLL22393Configuration" );
_okFrontPanel_SetEepromPLL22393Configuration = ( okFrontPanel_SETEEPROMPLL22393CONFIGURATION_FN ) dll_entrypoint( hLib, "okFrontPanel_SetEepromPLL22393Configuration" );
_okFrontPanel_LoadDefaultPLLConfiguration = ( okFrontPanel_LOADDEFAULTPLLCONFIGURATION_FN ) dll_entrypoint( hLib, "okFrontPanel_LoadDefaultPLLConfiguration" );
_okFrontPanel_IsFrontPanelEnabled = ( okFrontPanel_ISFRONTPANELENABLED_FN ) dll_entrypoint( hLib, "okFrontPanel_IsFrontPanelEnabled" );
_okFrontPanel_IsFrontPanel3Supported = ( okFrontPanel_ISFRONTPANEL3SUPPORTED_FN ) dll_entrypoint( hLib, "okFrontPanel_IsFrontPanel3Supported" );
_okFrontPanel_UpdateWireIns = ( okFrontPanel_UPDATEWIREINS_FN ) dll_entrypoint( hLib, "okFrontPanel_UpdateWireIns" );
_okFrontPanel_SetWireInValue = ( okFrontPanel_SETWIREINVALUE_FN ) dll_entrypoint( hLib, "okFrontPanel_SetWireInValue" );
_okFrontPanel_UpdateWireOuts = ( okFrontPanel_UPDATEWIREOUTS_FN ) dll_entrypoint( hLib, "okFrontPanel_UpdateWireOuts" );
_okFrontPanel_GetWireOutValue = ( okFrontPanel_GETWIREOUTVALUE_FN ) dll_entrypoint( hLib, "okFrontPanel_GetWireOutValue" );
_okFrontPanel_ActivateTriggerIn = ( okFrontPanel_ACTIVATETRIGGERIN_FN ) dll_entrypoint( hLib, "okFrontPanel_ActivateTriggerIn" );
_okFrontPanel_UpdateTriggerOuts = ( okFrontPanel_UPDATETRIGGEROUTS_FN ) dll_entrypoint( hLib, "okFrontPanel_UpdateTriggerOuts" );
_okFrontPanel_IsTriggered = ( okFrontPanel_ISTRIGGERED_FN ) dll_entrypoint( hLib, "okFrontPanel_IsTriggered" );
_okFrontPanel_GetLastTransferLength = ( okFrontPanel_GETLASTTRANSFERLENGTH_FN ) dll_entrypoint( hLib, "okFrontPanel_GetLastTransferLength" );
_okFrontPanel_WriteToPipeIn = ( okFrontPanel_WRITETOPIPEIN_FN ) dll_entrypoint( hLib, "okFrontPanel_WriteToPipeIn" );
_okFrontPanel_WriteToBlockPipeIn = ( okFrontPanel_WRITETOBLOCKPIPEIN_FN ) dll_entrypoint( hLib, "okFrontPanel_WriteToBlockPipeIn" );
_okFrontPanel_ReadFromPipeOut = ( okFrontPanel_READFROMPIPEOUT_FN ) dll_entrypoint( hLib, "okFrontPanel_ReadFromPipeOut" );
_okFrontPanel_ReadFromBlockPipeOut = ( okFrontPanel_READFROMBLOCKPIPEOUT_FN ) dll_entrypoint( hLib, "okFrontPanel_ReadFromBlockPipeOut" );
}
if (NULL == hLib) {
return(FALSE);
}
return(TRUE);
}
void
okFrontPanelDLL_FreeLib(void)
{
_okFrontPanelDLL_GetVersion = NULL;
_okFrontPanel_Construct = NULL;
_okFrontPanel_Destruct = NULL;
_okFrontPanel_GetHostInterfaceWidth = NULL;
_okFrontPanel_IsHighSpeed = NULL;
_okFrontPanel_GetBoardModel = NULL;
_okFrontPanel_GetBoardModelString = NULL;
_okFrontPanel_WriteI2C = NULL;
_okFrontPanel_ReadI2C = NULL;
_okFrontPanel_GetDeviceCount = NULL;
_okFrontPanel_GetDeviceListModel = NULL;
_okFrontPanel_GetDeviceListSerial = NULL;
_okFrontPanel_OpenBySerial = NULL;
_okFrontPanel_IsOpen = NULL;
_okFrontPanel_SetBTPipePollingInterval = NULL;
_okFrontPanel_SetTimeout = NULL;
_okFrontPanel_EnableAsynchronousTransfers = NULL;
_okFrontPanel_GetDeviceMajorVersion = NULL;
_okFrontPanel_GetDeviceMinorVersion = NULL;
_okFrontPanel_ResetFPGA = NULL;
_okFrontPanel_GetSerialNumber = NULL;
_okFrontPanel_GetDeviceID = NULL;
_okFrontPanel_SetDeviceID = NULL;
_okFrontPanel_ConfigureFPGA = NULL;
_okFrontPanel_ConfigureFPGAFromMemory = NULL;
_okFrontPanel_GetPLL22150Configuration = NULL;
_okFrontPanel_SetPLL22150Configuration = NULL;
_okFrontPanel_GetEepromPLL22150Configuration = NULL;
_okFrontPanel_SetEepromPLL22150Configuration = NULL;
_okFrontPanel_GetPLL22393Configuration = NULL;
_okFrontPanel_SetPLL22393Configuration = NULL;
_okFrontPanel_GetEepromPLL22393Configuration = NULL;
_okFrontPanel_SetEepromPLL22393Configuration = NULL;
_okFrontPanel_IsFrontPanelEnabled = NULL;
_okFrontPanel_IsFrontPanel3Supported = NULL;
_okFrontPanel_UpdateWireIns = NULL;
_okFrontPanel_SetWireInValue = NULL;
_okFrontPanel_UpdateWireOuts = NULL;
_okFrontPanel_GetWireOutValue = NULL;
_okFrontPanel_ActivateTriggerIn = NULL;
_okFrontPanel_UpdateTriggerOuts = NULL;
_okFrontPanel_IsTriggered = NULL;
_okFrontPanel_GetLastTransferLength = NULL;
_okFrontPanel_WriteToPipeIn = NULL;
_okFrontPanel_WriteToBlockPipeIn = NULL;
_okFrontPanel_ReadFromPipeOut = NULL;
_okFrontPanel_ReadFromBlockPipeOut = NULL;
_okPLL22393_Construct = NULL;
_okPLL22393_Destruct = NULL;
_okPLL22393_SetCrystalLoad = NULL;
_okPLL22393_SetReference = NULL;
_okPLL22393_GetReference = NULL;
_okPLL22393_SetPLLParameters = NULL;
_okPLL22393_SetPLLLF = NULL;
_okPLL22393_SetOutputDivider = NULL;
_okPLL22393_SetOutputSource = NULL;
_okPLL22393_SetOutputEnable = NULL;
_okPLL22393_GetPLLP = NULL;
_okPLL22393_GetPLLQ = NULL;
_okPLL22393_GetPLLFrequency = NULL;
_okPLL22393_GetOutputDivider = NULL;
_okPLL22393_GetOutputSource = NULL;
_okPLL22393_GetOutputFrequency = NULL;
_okPLL22393_IsOutputEnabled = NULL;
_okPLL22393_IsPLLEnabled = NULL;
_okPLL22393_InitFromProgrammingInfo = NULL;
_okPLL22393_GetProgrammingInfo = NULL;
_okPLL22150_Construct = NULL;
_okPLL22150_Destruct = NULL;
_okPLL22150_SetCrystalLoad = NULL;
_okPLL22150_SetReference = NULL;
_okPLL22150_GetReference = NULL;
_okPLL22150_SetVCOParameters = NULL;
_okPLL22150_GetVCOP = NULL;
_okPLL22150_GetVCOQ = NULL;
_okPLL22150_GetVCOFrequency = NULL;
_okPLL22150_SetDiv1 = NULL;
_okPLL22150_SetDiv2 = NULL;
_okPLL22150_GetDiv1Source = NULL;
_okPLL22150_GetDiv2Source = NULL;
_okPLL22150_GetDiv1Divider = NULL;
_okPLL22150_GetDiv2Divider = NULL;
_okPLL22150_SetOutputSource = NULL;
_okPLL22150_SetOutputEnable = NULL;
_okPLL22150_GetOutputSource = NULL;
_okPLL22150_GetOutputFrequency = NULL;
_okPLL22150_IsOutputEnabled = NULL;
_okPLL22150_InitFromProgrammingInfo = NULL;
_okPLL22150_GetProgrammingInfo = NULL;
if (hLib) {
dll_unload(hLib);
hLib = NULL;
}
}
static DLL_EP
dll_entrypoint(DLL *dll, const char *name)
{
#if defined(_WIN32)
FARPROC proc;
proc = GetProcAddress((HMODULE) dll, (LPCSTR) name);
if (NULL == proc) {
printf( "Failed to load %s. Error code %d\n", name, GetLastError() );
}
return((DLL_EP)proc);
#else
void *handle = (void *)dll;
DLL_EP ep;
ep = (DLL_EP)dlsym(handle, name);
return( (dlerror()==0) ? (ep) : ((DLL_EP)NULL) );
#endif
}
static DLL *
dll_load(const char *libname)
{
#if defined(_WIN32)
return((DLL *) LoadLibrary(libname));
#else
DLL *dll;
dll = dlopen(libname, RTLD_NOW);
if (!dll)
printf("%s\n", (char *)dlerror());
return(dll);
#endif
}
static void
dll_unload(DLL *dll)
{
#if defined(_WIN32)
HINSTANCE hInst = (HINSTANCE) dll;
FreeLibrary(hInst);
#else
void *handle = (void *)dll;
dlclose(handle);
#endif
}
//------------------------------------------------------------------------
// Function calls - General
//------------------------------------------------------------------------
okDLLEXPORT void DLL_ENTRY
okFrontPanelDLL_GetVersion(char *date, char *time) {
if (_okFrontPanelDLL_GetVersion)
(*_okFrontPanelDLL_GetVersion)(date, time);
}
//------------------------------------------------------------------------
// Function calls - okCPLL22393
//------------------------------------------------------------------------
okDLLEXPORT okPLL22393_HANDLE DLL_ENTRY
okPLL22393_Construct() {
if (_okPLL22393_Construct)
return((*_okPLL22393_Construct)());
return(NULL);
}
okDLLEXPORT void DLL_ENTRY
okPLL22393_Destruct(okPLL22393_HANDLE pll) {
if (_okPLL22393_Destruct)
(*_okPLL22393_Destruct)(pll);
}
okDLLEXPORT void DLL_ENTRY
okPLL22393_SetCrystalLoad(okPLL22393_HANDLE pll, double capload) {
if (_okPLL22393_SetCrystalLoad)
(*_okPLL22393_SetCrystalLoad)(pll, capload);
}
okDLLEXPORT void DLL_ENTRY
okPLL22393_SetReference(okPLL22393_HANDLE pll, double freq) {
if (_okPLL22393_SetReference)
(*_okPLL22393_SetReference)(pll, freq);
}
okDLLEXPORT double DLL_ENTRY
okPLL22393_GetReference(okPLL22393_HANDLE pll) {
if (_okPLL22393_GetReference)
return((*_okPLL22393_GetReference)(pll));
return(0.0);
}
okDLLEXPORT Bool DLL_ENTRY
okPLL22393_SetPLLParameters(okPLL22393_HANDLE pll, int n, int p, int q, Bool enable) {
if (_okPLL22393_SetPLLParameters)
return((*_okPLL22393_SetPLLParameters)(pll, n, p, q, enable));
return(FALSE);
}
okDLLEXPORT Bool DLL_ENTRY
okPLL22393_SetPLLLF(okPLL22393_HANDLE pll, int n, int lf) {
if (_okPLL22393_SetPLLLF)
return((*_okPLL22393_SetPLLLF)(pll, n, lf));
return(FALSE);
}
okDLLEXPORT Bool DLL_ENTRY
okPLL22393_SetOutputDivider(okPLL22393_HANDLE pll, int n, int div) {
if (_okPLL22393_SetOutputDivider)
return((*_okPLL22393_SetOutputDivider)(pll, n, div));
return(FALSE);
}
okDLLEXPORT Bool DLL_ENTRY
okPLL22393_SetOutputSource(okPLL22393_HANDLE pll, int n, ok_ClockSource_22393 clksrc) {
if (_okPLL22393_SetOutputSource)
return((*_okPLL22393_SetOutputSource)(pll, n, clksrc));
return(FALSE);
}
okDLLEXPORT void DLL_ENTRY
okPLL22393_SetOutputEnable(okPLL22393_HANDLE pll, int n, Bool enable) {
if (_okPLL22393_SetOutputEnable)
(*_okPLL22393_SetOutputEnable)(pll, n, enable);
}
okDLLEXPORT int DLL_ENTRY
okPLL22393_GetPLLP(okPLL22393_HANDLE pll, int n) {
if (_okPLL22393_GetPLLP)
return((*_okPLL22393_GetPLLP)(pll, n));
return(0);
}
okDLLEXPORT int DLL_ENTRY
okPLL22393_GetPLLQ(okPLL22393_HANDLE pll, int n) {
if (_okPLL22393_GetPLLQ)
return((*_okPLL22393_GetPLLQ)(pll, n));
return(0);
}
okDLLEXPORT double DLL_ENTRY
okPLL22393_GetPLLFrequency(okPLL22393_HANDLE pll, int n) {
if (_okPLL22393_GetPLLFrequency)
return((*_okPLL22393_GetPLLFrequency)(pll, n));
return(0.0);
}
okDLLEXPORT int DLL_ENTRY
okPLL22393_GetOutputDivider(okPLL22393_HANDLE pll, int n) {
if (_okPLL22393_GetOutputDivider)
return((*_okPLL22393_GetOutputDivider)(pll, n));
return(0);
}
okDLLEXPORT ok_ClockSource_22393 DLL_ENTRY
okPLL22393_GetOutputSource(okPLL22393_HANDLE pll, int n) {
if (_okPLL22393_GetOutputSource)
return((*_okPLL22393_GetOutputSource)(pll, n));
return(ok_ClkSrc22393_Ref);
}
okDLLEXPORT double DLL_ENTRY
okPLL22393_GetOutputFrequency(okPLL22393_HANDLE pll, int n) {
if (_okPLL22393_GetOutputFrequency)
return((*_okPLL22393_GetOutputFrequency)(pll, n));
return(0.0);
}
okDLLEXPORT Bool DLL_ENTRY
okPLL22393_IsOutputEnabled(okPLL22393_HANDLE pll, int n) {
if (_okPLL22393_IsOutputEnabled)
return((*_okPLL22393_IsOutputEnabled)(pll, n));
return(FALSE);
}
okDLLEXPORT Bool DLL_ENTRY
okPLL22393_IsPLLEnabled(okPLL22393_HANDLE pll, int n) {
if (_okPLL22393_IsPLLEnabled)
return((*_okPLL22393_IsPLLEnabled)(pll, n));
return(FALSE);
}
okDLLEXPORT void DLL_ENTRY
okPLL22393_InitFromProgrammingInfo(okPLL22393_HANDLE pll, unsigned char *buf) {
if (_okPLL22393_InitFromProgrammingInfo)
(*_okPLL22393_InitFromProgrammingInfo)(pll, buf);
}
okDLLEXPORT void DLL_ENTRY
okPLL22393_GetProgrammingInfo(okPLL22393_HANDLE pll, unsigned char *buf) {
if (_okPLL22393_GetProgrammingInfo)
(*_okPLL22393_GetProgrammingInfo)(pll, buf);
}
//------------------------------------------------------------------------
// Function calls - okCPLL22150
//------------------------------------------------------------------------
okDLLEXPORT okPLL22150_HANDLE DLL_ENTRY
okPLL22150_Construct()
{
if (_okPLL22150_Construct)
return((*_okPLL22150_Construct)());
return(NULL);
}
okDLLEXPORT void DLL_ENTRY
okPLL22150_Destruct(okPLL22150_HANDLE pll)
{
if (_okPLL22150_Destruct)
(*_okPLL22150_Destruct)(pll);
}
okDLLEXPORT void DLL_ENTRY
okPLL22150_SetCrystalLoad(okPLL22150_HANDLE pll, double capload)
{
if (_okPLL22150_SetCrystalLoad)
(*_okPLL22150_SetCrystalLoad)(pll, capload);
}
okDLLEXPORT void DLL_ENTRY
okPLL22150_SetReference(okPLL22150_HANDLE pll, double freq, Bool extosc)
{
if (_okPLL22150_SetReference)
(*_okPLL22150_SetReference)(pll, freq, extosc);
}
okDLLEXPORT double DLL_ENTRY
okPLL22150_GetReference(okPLL22150_HANDLE pll)
{
if (_okPLL22150_GetReference)
return((*_okPLL22150_GetReference)(pll));
return(0.0);
}
okDLLEXPORT Bool DLL_ENTRY
okPLL22150_SetVCOParameters(okPLL22150_HANDLE pll, int p, int q)
{
if (_okPLL22150_SetVCOParameters)
return((*_okPLL22150_SetVCOParameters)(pll, p, q));
return(FALSE);
}
okDLLEXPORT int DLL_ENTRY
okPLL22150_GetVCOP(okPLL22150_HANDLE pll)
{
if (_okPLL22150_GetVCOP)
return((*_okPLL22150_GetVCOP)(pll));
return(0);
}
okDLLEXPORT int DLL_ENTRY
okPLL22150_GetVCOQ(okPLL22150_HANDLE pll)
{
if (_okPLL22150_GetVCOQ)
return((*_okPLL22150_GetVCOQ)(pll));
return(0);
}
okDLLEXPORT double DLL_ENTRY
okPLL22150_GetVCOFrequency(okPLL22150_HANDLE pll)
{
if (_okPLL22150_GetVCOFrequency)
return((*_okPLL22150_GetVCOFrequency)(pll));
return(0.0);
}
okDLLEXPORT void DLL_ENTRY
okPLL22150_SetDiv1(okPLL22150_HANDLE pll, ok_DividerSource divsrc, int n)
{
if (_okPLL22150_SetDiv1)
(*_okPLL22150_SetDiv1)(pll, divsrc, n);
}
okDLLEXPORT void DLL_ENTRY
okPLL22150_SetDiv2(okPLL22150_HANDLE pll, ok_DividerSource divsrc, int n)
{
if (_okPLL22150_SetDiv2)
(*_okPLL22150_SetDiv2)(pll, divsrc, n);
}
okDLLEXPORT ok_DividerSource DLL_ENTRY
okPLL22150_GetDiv1Source(okPLL22150_HANDLE pll)
{
if (_okPLL22150_GetDiv1Source)
return((*_okPLL22150_GetDiv1Source)(pll));
return(ok_DivSrc_Ref);
}