Newer
Older
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
/**---------------------------------------------------------------------------------------------
* \file minipodCmd.c
*
* \brief This file contains the command interpreter to execute some commands on the
Avago minipods of the AMC40.
*
* \details Command flags are
* -d vendor data read
* -t internal temperatures read
* -p 33 or 25 the used power read
* -o the optical pave read
* -e elapsed power on
* -v r or w read or write VOD
* -d r or w deamphasis read or write
* -q r or w equalization read or write
* -n the target components which can be:
* x a channel number
* tx for all tx
* rx for all rx
* all for all
*
* output values are strings composed of pairs cahnnelNb=Value comma separated.
*
* \author PYD : Pierre-Yves Duval
* \version 0.1
* \date 18/06/2013
* \copyright (c) Copyright CERN for the benefit of the LHCb Collaboration.
* Distributed under the terms of the GNU General Public Licence V3.
* ana.py script is free and open source software.
*
* CHANGELOG
* PYD : 18/06/2013 initial version
* PYD : 04/3/2014 add the script mode with raw printing
* PYD : 07/01/2016 adpated to PCIe40
*-----------------------------------------------------------------------------------------------
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <getopt.h>
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
#include <avagoMinipodCtrl.h>
#include <i2cDriver.h>
#include <systemConfig.h>
#define DEBUG 0
#define NONE 999
#define VPRINT(a) if(interactiv) printf(a);
#define DPRINT(a) if(debug) printf(a);
#define STATUS_LINE printf("=======================================================================================\n")
int interactiv = 1;
int debug = DEBUG;
enum targetsMp {ALLMP, ALLTX, ALLRX, SINGLEMP};
enum targetsCh {ALLCH, SINGLECH};
enum targetsMp currentMpTarget = ALLMP;
int currentBoard = 0;
int currentMinipod = NONE;
int currentChannel = NONE;
enum commands {
// initSpeed, useless because init speed is executed at each program start
// getSpeed, can't work because library is reloaded
errorStatus,
dumpLos,
dumpFault,
dumpBiasCurrent,
dumpLightOutput,
doReset,
channelDisable,
channelEnable,
channelDump,
marginActivation,
marginDeactivation,
marginDump,
fullStatus,
vendorData,
squelchDisable,
squelchEnable,
squelchDump,
internalTmp,
vcc33,
vcc25,
dumpLightInput,
pwOnElapsed,
vodRd,
vodWr,
deamphasRd,
deamphasWr,
equalRd,
equalWr,
channelPolarInvert,
channelPolarNormal,
channelPolarDump
};
enum commands cmd = fullStatus;
int arrayParams[12] = {NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE,NONE};
int array2Params[2] = {NONE,NONE};
int singleParam = NONE;
void printHelp(){
VPRINT("Usage : minipodCmd ...... c'est la .....\n");
VPRINT("--------------------------COMMANDS--------------------------------\n");
VPRINT("--init-speed set i2c bus speed (inClock & SCL freq)(default 125000000 and 100000)\n");
// VPRINT("--get-speed sget the last set i2c bus speed (inClock & SCL freq)\n");
VPRINT("--full-status print the full minipods status\n");
VPRINT("--temperature print the internal temperature of minipods\n");
VPRINT("--vcc-3.3 print the 3.3 Vcc values of minipods\n");
VPRINT("--vcc-2.5 print the 2.5 Vcc values of minipods\n");
VPRINT("--error-status print general erro status of minipods\n");
VPRINT("--los-status print LOS loss of signal status channels\n");
VPRINT("--faults-status print faults of TX minipods channels\n");
VPRINT("--bias-current print bias current of TX minipods channels\n");
VPRINT("--light-output print light output optical power of TX minipods channels\n");
VPRINT("--light-input print light input optical power PAVE of RX minipods channels\n");
VPRINT("--reset do minipods reset (parameters set to factory values)\n");
VPRINT("--channel-disable disable minipods channels\n");
VPRINT("--channel-enable enable minipods channels\n");
VPRINT("--channel-dump print enable/disable status of minipods channels\n");
VPRINT("--squelch-disable disable squelch of minipods channels\n");
VPRINT("--squelch-enable enable squelch of minipods channels\n");
VPRINT("--squelch-dump print squelch status of minipods channels\n");
VPRINT("--margin-activation activate margin of TX minipods channels\n");
VPRINT("--margin-deactivation deactivate margin of TX minipods channels\n");
VPRINT("--margin-dump print margin activation status of minipods channels\n");
VPRINT("--vendor-info print vendor informations of minipods\n");
VPRINT("--in-equal-read read the input equalization values of minipods channeles\n");
VPRINT("--in-equal-write set values for the input equalization of minipods channels\n");
VPRINT("--out-amplitude-read read the output amplitude VOD of RX minipods channels\n");
VPRINT("--out-amplitude-write set values for the output amplitude VOD of RX minipods channels\n");
VPRINT("--out-deamphas-read read the output deamphasis of RX minipods channels\n");
VPRINT("--out-deamphas-write set values for the output deamphasis of RX minipods channels\n");
VPRINT("--polarity-invert invert polarity of minipods channels\n");
VPRINT("--polarity-normal normal plority for minipods channels\n");
VPRINT("--polarity-dump print enable/disable status of minipods polarity inversion\n");
VPRINT("-------------------WRITE VALUES SPECIFICATION----------------------\n");
VPRINT("--param-list (-l) values parameter 12 comma separated values\n");
VPRINT("--param-pair (-d) values parameter 2 comma separated values\n");
VPRINT("--param-val (-v) value parameter one single value\n");
VPRINT("-------------------TARGETS SPECIFICATION---------------------------\n");
VPRINT("BOARDS\n");
VPRINT("--board (-b) the board number to deal with:\n");
VPRINT("CHANNELS\n");
VPRINT("--channel (-c) the target components channel specifier which can be:\n");
VPRINT("\tx a channel number ( x value is between O and 11)\n");
VPRINT("\tall for all channels\n");
VPRINT("MINIPODS\n");
VPRINT("--module (-m) the target minipod specifier which can be:\n");
VPRINT("\tx a minipod number ( x value is between O and 7)\n");
VPRINT("\tall for all minipods\n");
VPRINT("Default is \"all\" but:\n");
VPRINT("when writing specify at least: one minipod OR one channel (write all minipods) OR both\n");
VPRINT("when reading specify:\n");
VPRINT("\tno target (all will be printed)\n");
VPRINT("\tone minipod (all minipods channels will be printed)\n");
VPRINT("\tone minipod and a channel\n");
VPRINT("--------------------------SERVICES--------------------------------\n");
VPRINT("-h this help\n");
VPRINT("-i interactiv mode, errors are printed\n");
VPRINT("-s script mode, minimum raw data are printed\n");
}
/***********************************************/
void dumpStatus()
{
printf("NOT YET IMPLEMENTED\n");
}
/***********************************************/
int scan12values(char *chain, int *data){
if (sscanf(chain, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
data,(data+1),(data+2),(data+3),(data+4),(data+5),
(data+6),(data+7),(data+8),(data+9),(data+10),(data+11)) !=12){
printf("ERROR: parameter sting doesnt contain 12 comma separated values\n");
return(-1);
}
return(0);
}
int scan2values(char *chain, int *data){
if (sscanf(chain, "%d,%d",
data,(data+1)) !=2){
printf("ERROR: parameter sting doesnt contain 2 comma separated values\n");
return(-1);
}
return(0);
}
int scan1value(char *chain, int *data){
if (sscanf(chain, "%d", data) != 1){
printf("ERROR: parameter string doesnt contain 1 single value\n");
return(-1);
}
return(0);
}
/***********************************************************************************
* function to print the general error status
**************************************************************************************/
void printErrorStatus(int dev){
switch (currentMpTarget) {
case ALLMP:
mpod_dumpErrStatusAll(dev);
break;
case SINGLEMP:
mpod_dumpErrStatus(dev, currentMinipod);
break;
default: printf("ERROR: unknown target\n");
exit(0);
}
}
/***********************************************************************************
* function to print status with a dump function by minipod which return 6 values
* It use two different function if its a global printing foa all minipods or
* only one.
* in : ptr to function to print for 1 minipod
* ptr to filtering function which minimod to print (should return 1 for selected)
**************************************************************************************/
void printMinipodInfo(int dev, int(*dumpAll)(int), int(*dump)(int, int, int*)){
int val;
switch (currentMpTarget) {
case ALLMP:
dumpAll(dev);
break;
case SINGLEMP:
dump(dev, currentMinipod, &val);
break;
default: printf("ERROR: unknown target\n");
exit(0);
}
}
/****************************************************************************
* function to print status with a dump function by minipod
* in : ptr to function to print for 1 minipod
* ptr to filtering function which minimod to print (should return 1 for selected)
*****************************************************************************/
void printChannelInfo(int dev, int(*dump)(int,int), int(*filter)(int)){
int i;
switch (currentMpTarget) {
case ALLMP:
for (i=0; i<8; i++){
if (filter!=NULL)
if (!filter(i))
continue;
dump(dev,i);
}
break;
case SINGLEMP:
dump(dev, currentMinipod);
break;
default: printf("ERROR: unknown target\n");
exit(0);
}
}
/****************************************************************************
* function to set bits in words for channel parameters stored in one bit
* in : setbit : pointer to function to set the bit channel
* filter : ptr to filtering function which minimod to print (should return 1 for selected)
* bval : the bit value to write 0/1
*****************************************************************************/
void setBitsChannel(int dev, int(*setBit)(int,int,int,int), int(*filter)(int), int bval){
int minipod, channel;
switch (currentMpTarget) {
case ALLMP:
for (minipod=0; minipod<8; minipod++){
if (filter!=NULL)
if (!filter(minipod))
continue;
if (currentChannel==NONE){
for (channel=0; channel<12; channel++)
setBit(dev, minipod, channel, bval);
}
else
setBit(dev, minipod, currentChannel, bval);
}
break;
case SINGLEMP:
if (currentChannel==NONE){
for (channel=0; channel<12; channel++)
setBit(dev, currentMinipod, channel, bval);
}
else
setBit(dev, currentMinipod, currentChannel, bval);
break;
default: printf("ERROR: unknown target\n");
exit(0);
}
}
/****************************************************************************
* function to print status with a dump function by minipod
* in : dump : ptr to function to print for 1 minipod
* filter: ptr to filtering function which minimod to print (should return 1 for selected)
*****************************************************************************/
void printfloatMSBLSB(int dev, int(*dump)(int, int,float**), int(*filter)(int)) {
int minipod;
float *bloc = 0;
switch (currentMpTarget) {
case ALLMP:
for (minipod=0; minipod<8; minipod++){
if (filter!=NULL)
if (!filter(minipod))
continue;
dump(dev, minipod, &bloc); // prints on output
free(bloc);
}
break;
case SINGLEMP:
if (filter!=NULL)
if (!filter(currentMinipod)){
printf("ERROR: Minipod %d is a wrong command's target\n",currentMinipod);
return;
}
dump(dev, currentMinipod, &bloc); // prints on output
free(bloc);
break;
default: printf("ERROR: unknown target\n");
exit(0);
}
}
/*****************************************************************************************
* Function to read 12 channel values passed as a bloc of integers. Used for registers
* organized in 6 word with values encode on 4 bits.
* in : read : ptr to function to read for 1 minipod
* readChan : ptr to function to read for 1 channel of 1 minipod
* filter :
*****************************************************************************************/
void read12Int(int dev, int(*read)(int,int,int**), int(*readChan)(int,int,int,int*), int(*filter)(int)) {
int minipod, code;
int *bloc = 0;//PYD
switch (currentMpTarget) {
case ALLMP:
for (minipod=0; minipod<8; minipod++){
if (filter!=NULL)
if (!filter(minipod))
continue;
read(dev, minipod, &bloc); // prints on output all channels
free(bloc);
}
break;
case SINGLEMP: // one minipod
if (filter!=NULL){
if (!filter(currentMinipod)){
printf("ERROR: Minipod %d is a wrong command's target\n",currentMinipod);
return;
}
}
if (currentChannel==NONE){
read(dev, currentMinipod, &bloc); // prints on output all channels
free(bloc);
}
else {
readChan(dev, currentMinipod, currentChannel, &code); // print one channel
}
break;
default: printf("ERROR: unknown target\n");
exit(0);
}
}
/*****************************************************************************************
* Function to write 12 channel values passed as a bloc of integers. Used for registers
* organized in 8 word with values encode on 4 bits.
* in : write : ptr to function to write in 1 minipod channels
* writeChan : ptr to function to write in 1 channel of 1 minipod
* filter :
*****************************************************************************************/
void write12Int(int dev, int(*write)(int,int,int*), int(*writeChan)(int,int,int,int), int(*filter)(int)) {
int minipod;
switch (currentMpTarget) {
case ALLMP:
for (minipod=0; minipod<8; minipod++){
if (filter!=NULL)
if (!filter(minipod))
continue;
if (currentChannel==NONE){
if (arrayParams[0]!=NONE)
write(dev, minipod, arrayParams); // prints on output
else
printf("ERROR: you should specify the 12 values to write\n");
}
else {
if (singleParam != NONE)
writeChan(dev, minipod, currentChannel, singleParam); // prints on output
else
printf("ERROR: you should specify a value to write\n");
}
}//for
break;
case SINGLEMP:
if (filter!=NULL)
if (!filter(currentMinipod))
break;
if (currentChannel==NONE){
if (arrayParams[0]!=NONE)
write(dev, currentMinipod, arrayParams); // prints on output
else
printf("ERROR: you should specify the 12 values to write\n");
}
else {
if (singleParam != NONE)
writeChan(dev, currentMinipod, currentChannel, singleParam); // prints on output
else
printf("ERROR: you should specify a value to write\n");
}
break;
default: printf("ERROR: unknown target\n");
exit(0);
}
}
/***********************************************/
int main (int argc, char **argv) {
const char * optstring = "m:c:l:d:v:b:fsh";
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
struct option longopts[] = {
/* name has_arg flag val */
// { "init-speed", 0, (int*)&cmd, initSpeed },
// { "get-speed", 0, (int*)&cmd, getSpeed },
{ "full-status", 0, (int*)&cmd, fullStatus },
{ "error-status", 0, (int*)&cmd, errorStatus },
{ "los-status", 0, (int*)&cmd, dumpLos },
{ "faults-status", 0, (int*)&cmd, dumpFault},
{ "bias-current", 0, (int*)&cmd, dumpBiasCurrent},
{ "temperature", 0, (int*)&cmd, internalTmp},
{ "vcc-3.3", 0, (int*)&cmd, vcc33},
{ "vcc-2.5", 0, (int*)&cmd, vcc25},
{ "light-output", 0, (int*)&cmd, dumpLightOutput},
{ "elapsed", 0, (int*)&cmd, pwOnElapsed},
{ "reset", 0, (int*)&cmd, doReset},
{ "channel-disable", 0, (int*)&cmd, channelDisable},
{ "channel-enable", 0, (int*)&cmd, channelEnable},
{ "channel-dump", 0, (int*)&cmd, channelDump},
{ "squelch-disable", 0, (int*)&cmd, squelchDisable},
{ "squelch-enable", 0, (int*)&cmd, squelchEnable},
{ "squelch-dump", 0, (int*)&cmd, squelchDump},
{ "margin-activation", 0, (int*)&cmd, marginActivation},
{ "margin-deactivation",0, (int*)&cmd, marginDeactivation},
{ "margin-dump", 0, (int*)&cmd, marginDump},
{ "vendor-info", 0, (int*)&cmd, vendorData},
{ "in-equal-read", 0, (int*)&cmd, equalRd},
{ "in-equal-write", 0, (int*)&cmd, equalWr},
{ "light-input", 0, (int*)&cmd, dumpLightInput},
{ "out-amplitude-read", 0, (int*)&cmd, vodRd},
{ "out-amplitude-write",0, (int*)&cmd, vodWr},
{ "out-deamphas-read", 0, (int*)&cmd, deamphasRd},
{ "out-deamphas-write", 0, (int*)&cmd, deamphasWr},
{ "polarity-invert", 0, (int*)&cmd, channelPolarInvert},
{ "polarity-normal", 0, (int*)&cmd, channelPolarNormal},
{ "polarity-dump", 0, (int*)&cmd, channelPolarDump},
{ "module", 1, NULL, 'm' },
{ "channel", 1, NULL, 'c' },
{ "param-list", 1, NULL, 'l' },
{ "param-val", 1, NULL, 'v' },
{ "param-pair", 1, NULL, 'd' },
{ "board", 1, NULL, 'b' },
/* Le dernier element doit etre nul */
{ NULL, 0, NULL, 0 },
};
int longindex;
int option;
char *cvalue = NULL;
int i, minipod;
opterr = 1;
// can only be scanned once
while ((option = getopt_long(argc, argv, optstring, longopts, & longindex)) != -1) {
switch (option) {
case 'm' :
DPRINT("m\n");
cvalue = optarg;
if (strncmp(cvalue, "all", 3)==0){
DPRINT("all\n");
currentMpTarget = ALLMP;
}
else if(sscanf(cvalue, "%d", &i) != 0){ //It's an int.
if((i>=0) && (i<=7)){
currentMinipod = i;
currentMpTarget = SINGLEMP;
}
else {
VPRINT("ERROR: Wrong minipod number [should be 0 to 5]\n");
printHelp();
exit(0);
}
}
else {
VPRINT("ERROR: Wrong target component specification\n");
printHelp();
exit(0);
}
break;
case 'b' :
DPRINT("b\n");
cvalue = optarg;
if(sscanf(cvalue, "%d", &i) != 0){ //It's an int.
if(i < MAX_DEV){
currentBoard = i;
DPRINT("Current board changed\n");
}
else {
VPRINT("ERROR: impossible board number\n");
printHelp();
exit(0);
}
}
break;
case 'c' :
DPRINT("c\n");
cvalue = optarg;
if (strncmp(cvalue, "all", 3)==0) {
DPRINT("all\n");
}
else if(sscanf(cvalue, "%d", &i) != 0){ //It's an int.
if((i>=0) && (i<=11)){
currentChannel = i;
}
else {
VPRINT("ERROR: Wrong channel number [should be 0 to 11]\n");
printHelp();
exit(0);
}
}
else {
VPRINT("ERROR: Wrong target component specification\n");
printHelp();
exit(0);
}
break;
case 'l' :
DPRINT("l\n");
//printf("parameters %s\n", optarg);
if (scan12values(optarg, arrayParams) !=0)
exit(0);
break;
case 'd' :
DPRINT("d\n");
//printf("parameters %s\n", optarg);
if (scan2values(optarg, array2Params) !=0)
exit(0);
break;
case 'v' :
DPRINT("v\n");
//printf("single parameter %s\n", optarg);
if (scan1value(optarg, &singleParam) !=0)
exit(0);
break;
case 's':
mpod_setMode(1);
break;
case 'h':
printHelp();
return(0);
break;
case 0 :
break;
case '?' :
break;
}//switch
}//while
//set default value
/* Remove because reinitialize the bus at each command */
if (mpod_init(currentBoard, 100000000, 100000))
exit(2);
switch (cmd) {
case errorStatus:
printErrorStatus(currentBoard);
break;
case dumpLos:
printChannelInfo(currentBoard, mpod_losDumpAll,NULL);
break;
case dumpFault:
printChannelInfo(currentBoard, mpod_faultDumpAll,mpod_isTX);
break;
case dumpBiasCurrent:
printfloatMSBLSB(currentBoard, mpod_biasCurrent, mpod_isTX);
break;
case dumpLightOutput:
printfloatMSBLSB(currentBoard, mpod_lightOutput, mpod_isTX);
break;
case internalTmp: // validated OK
printMinipodInfo(currentBoard, mpod_internalTempDumpAll, mpod_internalTemp);
break;
case vcc33: // validated OK
printMinipodInfo(currentBoard, mpod_internal33VccDumpAll, mpod_internal33Vcc);
break;
case vcc25: // validated OK
printMinipodInfo(currentBoard, mpod_internal25VccDumpAll, mpod_internal25Vcc);
break;
case dumpLightInput: // validated OK
printfloatMSBLSB(currentBoard, mpod_lightInput, mpod_isRX);
break;
case pwOnElapsed:
printf("Not implemeneted because information is wrong in the chip\n");
break;
case vendorData:
printChannelInfo(currentBoard, mpod_dumpVendorData,NULL);
break;
case fullStatus:
//dumpStatus();
printMinipodInfo(currentBoard, mpod_internalTempDumpAll, mpod_internalTemp);
printMinipodInfo(currentBoard, mpod_internal33VccDumpAll, mpod_internal33Vcc);
printMinipodInfo(currentBoard, mpod_internal25VccDumpAll, mpod_internal25Vcc);
printErrorStatus(currentBoard);
printChannelInfo(currentBoard, mpod_losDumpAll,NULL);
printChannelInfo(currentBoard, mpod_faultDumpAll,mpod_isTX);
printfloatMSBLSB(currentBoard, mpod_biasCurrent, mpod_isTX);
printfloatMSBLSB(currentBoard, mpod_lightOutput, mpod_isTX);
break;
case doReset:
switch (currentMpTarget) {
case ALLMP:
for (minipod=0; minipod<8; minipod++)
mpod_reset(currentBoard, minipod);
break;
case SINGLEMP:
mpod_reset(currentBoard, currentMinipod);
break;
default: printf("ERROR: unknown target\n");
exit(0);
}
break;
case channelDisable:
setBitsChannel(currentBoard, mpod_channelDisable, NULL, 1);
break;
case channelEnable:
setBitsChannel(currentBoard, mpod_channelDisable, NULL, 0);
break;
case channelDump:
printChannelInfo(currentBoard, mpod_channelDisDumpAll,NULL);
break;
case channelPolarInvert:
setBitsChannel(currentBoard, mpod_polarityFlip, NULL, 1);
break;
case channelPolarNormal:
setBitsChannel(currentBoard, mpod_polarityFlip, NULL, 0);
break;
case channelPolarDump:
printChannelInfo(currentBoard, mpod_channelPolarFlipDumpAll,NULL);
break;
case marginActivation:
setBitsChannel(currentBoard, mpod_marginActivation, mpod_isTX, 1);
break;
case marginDeactivation:
setBitsChannel(currentBoard, mpod_marginActivation, mpod_isTX, 0);
break;
case marginDump:
printChannelInfo(currentBoard, mpod_marginActDumpAll,mpod_isTX);
break;
case squelchDisable:
setBitsChannel(currentBoard, mpod_squelchDisable, NULL, 1);
break;
case squelchEnable:
setBitsChannel(currentBoard, mpod_squelchDisable, NULL, 0);
break;
case squelchDump:
printChannelInfo(currentBoard, mpod_squelchDumpAll,NULL);
break;
case vodRd:
read12Int(currentBoard, mpod_readVOD, mpod_readVODSingle, mpod_isRX);
break;
case vodWr:
write12Int(currentBoard, mpod_writeVOD, mpod_writeVODSingle, mpod_isRX);
break;
case deamphasRd:
read12Int(currentBoard, mpod_readDeamphasis, mpod_readDeamphasisSingle, mpod_isRX);
break;
case deamphasWr:
write12Int(currentBoard, mpod_writeDeamphasis, mpod_writeDeamphasisSingle, mpod_isRX);
break;
case equalRd:
read12Int(currentBoard, mpod_readEqualization, mpod_readEqualizationSingle, mpod_isTX);
break;
case equalWr:
write12Int(currentBoard, mpod_writeEqualization, mpod_writeEqualizationSingle, mpod_isTX);
break;
default:
printf("Should never happen the command requested is unknown\n");
exit(0);
} // switch
return(0);
}