4 Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module.
10 Fax: +49(0)7223/9493-92
11 http://www.addi-data.com
14 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
16 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
22 +-----------------------------------------------------------------------+
23 | (C) ADDI-DATA GmbH Dieselstraße 3 D-77833 Ottersweier |
24 +-----------------------------------------------------------------------+
25 | Tel : +49 (0) 7223/9493-0 | email : info@addi-data.com |
26 | Fax : +49 (0) 7223/9493-92 | Internet : http://www.addi-data.com |
27 +-----------------------------------------------------------------------+
28 | Project : API APCI1710 | Compiler : gcc |
29 | Module name : TTL.C | Version : 2.96 |
30 +-------------------------------+---------------------------------------+
31 | Project manager: Eric Stolz | Date : 02/12/2002 |
32 +-----------------------------------------------------------------------+
33 | Description : APCI-1710 TTL I/O module |
36 +-----------------------------------------------------------------------+
38 +-----------------------------------------------------------------------+
39 | Date | Author | Description of updates |
40 +----------+-----------+------------------------------------------------+
41 | 13/05/98 | S. Weber | TTL digital input / output implementation |
42 |----------|-----------|------------------------------------------------|
43 | 08/05/00 | Guinot C | - 0400/0228 All Function in RING 0 |
45 +-----------------------------------------------------------------------+
48 +-----------------------------------------------------------------------+
51 #define APCI1710_TTL_INIT 0
52 #define APCI1710_TTL_INITDIRECTION 1
54 #define APCI1710_TTL_READCHANNEL 0
55 #define APCI1710_TTL_READPORT 1
58 +----------------------------------------------------------------------------+
59 | Function Name : _INT_ i_APCI1710_InitTTLIODirection |
60 | (unsigned char_ b_BoardHandle, |
61 | unsigned char_ b_ModulNbr, |
62 | unsigned char_ b_PortAMode, |
63 | unsigned char_ b_PortBMode, |
64 | unsigned char_ b_PortCMode, |
65 | unsigned char_ b_PortDMode) |
66 +----------------------------------------------------------------------------+
67 | Task APCI1710_TTL_INIT (using defaults) : Configure the TTL I/O operating mode from selected |
68 | module (b_ModulNbr). You must calling this function be|
69 | for you call any other function witch access of TTL. |
70 APCI1710_TTL_INITDIRECTION(user inputs for direction)
72 +----------------------------------------------------------------------------+
73 | Input Parameters : unsigned char_ b_BoardHandle : Handle of board APCI-1710|
74 | unsigned char_ b_ModulNbr : Module number to |
76 b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec);
77 b_InitType = (unsigned char) data[0];
78 b_PortAMode = (unsigned char) data[1];
79 b_PortBMode = (unsigned char) data[2];
80 b_PortCMode = (unsigned char) data[3];
81 b_PortDMode = (unsigned char) data[4];|
82 +----------------------------------------------------------------------------+
83 | Output Parameters : - |
84 +----------------------------------------------------------------------------+
85 | Return Value : 0: No error |
86 | -1: The handle parameter of the board is wrong |
87 | -2: The module parameter is wrong |
88 | -3: The module is not a TTL module |
89 | -4: Function not available for this version |
90 | -5: Port A mode selection is wrong |
91 | -6: Port B mode selection is wrong |
92 | -7: Port C mode selection is wrong |
93 | -8: Port D mode selection is wrong |
94 +----------------------------------------------------------------------------+
97 static int i_APCI1710_InsnConfigInitTTLIO(struct comedi_device
*dev
,
98 struct comedi_subdevice
*s
,
99 struct comedi_insn
*insn
,
102 struct addi_private
*devpriv
= dev
->private;
103 int i_ReturnValue
= 0;
104 unsigned char b_ModulNbr
;
105 unsigned char b_InitType
;
106 unsigned char b_PortAMode
;
107 unsigned char b_PortBMode
;
108 unsigned char b_PortCMode
;
109 unsigned char b_PortDMode
;
111 b_ModulNbr
= (unsigned char) CR_AREF(insn
->chanspec
);
112 b_InitType
= (unsigned char) data
[0];
113 i_ReturnValue
= insn
->n
;
115 /**************************/
116 /* Test the module number */
117 /**************************/
119 if (b_ModulNbr
< 4) {
120 /**************************/
121 /* Test if TTL I/O module */
122 /**************************/
124 if ((devpriv
->s_BoardInfos
.
125 dw_MolduleConfiguration
[b_ModulNbr
] &
126 0xFFFF0000UL
) == APCI1710_TTL_IO
) {
127 switch (b_InitType
) {
128 case APCI1710_TTL_INIT
:
130 devpriv
->s_ModuleInfo
[b_ModulNbr
].
131 s_TTLIOInfo
.b_TTLInit
= 1;
133 /***************************/
134 /* Set TTL port A to input */
135 /***************************/
137 devpriv
->s_ModuleInfo
[b_ModulNbr
].
138 s_TTLIOInfo
.b_PortConfiguration
[0] = 0;
140 /***************************/
141 /* Set TTL port B to input */
142 /***************************/
144 devpriv
->s_ModuleInfo
[b_ModulNbr
].
145 s_TTLIOInfo
.b_PortConfiguration
[1] = 0;
147 /***************************/
148 /* Set TTL port C to input */
149 /***************************/
151 devpriv
->s_ModuleInfo
[b_ModulNbr
].
152 s_TTLIOInfo
.b_PortConfiguration
[2] = 0;
154 /****************************/
155 /* Set TTL port D to output */
156 /****************************/
158 devpriv
->s_ModuleInfo
[b_ModulNbr
].
159 s_TTLIOInfo
.b_PortConfiguration
[3] = 1;
161 /*************************/
162 /* Set the configuration */
163 /*************************/
166 devpriv
->s_BoardInfos
.ui_Address
+ 20 +
170 case APCI1710_TTL_INITDIRECTION
:
172 b_PortAMode
= (unsigned char) data
[1];
173 b_PortBMode
= (unsigned char) data
[2];
174 b_PortCMode
= (unsigned char) data
[3];
175 b_PortDMode
= (unsigned char) data
[4];
177 /********************/
178 /* Test the version */
179 /********************/
181 if ((devpriv
->s_BoardInfos
.
182 dw_MolduleConfiguration
183 [b_ModulNbr
] & 0xFFFF) >=
185 /************************/
186 /* Test the port A mode */
187 /************************/
189 if ((b_PortAMode
== 0)
190 || (b_PortAMode
== 1)) {
191 /************************/
192 /* Test the port B mode */
193 /************************/
195 if ((b_PortBMode
== 0)
196 || (b_PortBMode
== 1)) {
197 /************************/
198 /* Test the port C mode */
199 /************************/
201 if ((b_PortCMode
== 0)
204 /************************/
205 /* Test the port D mode */
206 /************************/
208 if ((b_PortDMode
== 0) || (b_PortDMode
== 1)) {
217 /***********************/
218 /* Set TTL port A mode */
219 /***********************/
230 /***********************/
231 /* Set TTL port B mode */
232 /***********************/
243 /***********************/
244 /* Set TTL port C mode */
245 /***********************/
256 /***********************/
257 /* Set TTL port D mode */
258 /***********************/
269 /*************************/
270 /* Set the configuration */
271 /*************************/
273 outl((b_PortAMode
<< 0) | (b_PortBMode
<< 1) | (b_PortCMode
<< 2) | (b_PortDMode
<< 3), devpriv
->s_BoardInfos
.ui_Address
+ 20 + (64 * b_ModulNbr
));
275 /**********************************/
276 /* Port D mode selection is wrong */
277 /**********************************/
279 DPRINTK("Port D mode selection is wrong\n");
285 /**********************************/
286 /* Port C mode selection is wrong */
287 /**********************************/
289 DPRINTK("Port C mode selection is wrong\n");
294 /**********************************/
295 /* Port B mode selection is wrong */
296 /**********************************/
298 DPRINTK("Port B mode selection is wrong\n");
302 /**********************************/
303 /* Port A mode selection is wrong */
304 /**********************************/
306 DPRINTK("Port A mode selection is wrong\n");
310 /*******************************************/
311 /* Function not available for this version */
312 /*******************************************/
314 DPRINTK("Function not available for this version\n");
321 printk("Bad Config Type\n");
324 /**********************************/
325 /* The module is not a TTL module */
326 /**********************************/
328 DPRINTK("The module is not a TTL module\n");
332 /***********************/
333 /* Module number error */
334 /***********************/
336 DPRINTK("Module number error\n");
340 return i_ReturnValue
;
344 +----------------------------------------------------------------------------+
346 +----------------------------------------------------------------------------+
350 +----------------------------------------------------------------------------+
351 | Function Name : _INT_ i_APCI1710_ReadTTLIOChannelValue |
352 | (unsigned char_ b_BoardHandle, |
353 | unsigned char_ b_ModulNbr, |
354 | unsigned char_ b_SelectedPort, |
355 | unsigned char_ b_InputChannel, |
356 | unsigned char *_ pb_ChannelStatus) |
357 +----------------------------------------------------------------------------+
358 | Task : Read the status from selected TTL digital input |
360 +----------------------------------------------------------------------------+
361 | Task : Read the status from digital input port |
362 | (b_SelectedPort) from selected TTL module (b_ModulNbr) |
363 +----------------------------------------------------------------------------+
365 +----------------------------------------------------------------------------+
366 | Input Parameters : unsigned char_ b_BoardHandle : Handle of board APCI-1710|
367 | unsigned char_ b_ModulNbr : Module number to |
368 | configure (0 to 7) |
369 | unsigned char_ b_SelectedPort, : Selection from TTL I/O |
371 | 0 : Port A selection |
372 | 1 : Port B selection |
373 | 2 : Port C selection |
374 | 3 : Port D selection |
375 | unsigned char_ b_InputChannel : Selection from digital |
377 APCI1710_TTL_READCHANNEL
378 b_ModulNbr = CR_AREF(insn->chanspec);
379 b_SelectedPort= CR_RANGE(insn->chanspec);
380 b_InputChannel= CR_CHAN(insn->chanspec);
381 b_ReadType = (unsigned char) data[0];
383 APCI1710_TTL_READPORT|
384 b_ModulNbr = CR_AREF(insn->chanspec);
385 b_SelectedPort= CR_RANGE(insn->chanspec);
386 b_ReadType = (unsigned char) data[0];
388 +----------------------------------------------------------------------------+
389 | Output Parameters : data[0]
391 unsigned char *_ pb_ChannelStatus : Digital input channel |
393 | 0 : Channle is not active|
394 | 1 : Channle is active |
395 +----------------------------------------------------------------------------+
396 | Return Value : 0: No error |
397 | -1: The handle parameter of the board is wrong |
398 | -2: The module parameter is wrong |
399 | -3: The module is not a TTL module |
400 | -4: The selected TTL input port is wrong |
401 | -5: The selected TTL digital input is wrong |
402 | -6: TTL I/O not initialised |
403 +----------------------------------------------------------------------------+
406 static int i_APCI1710_InsnBitsReadTTLIO(struct comedi_device
*dev
,
407 struct comedi_subdevice
*s
,
408 struct comedi_insn
*insn
,
411 struct addi_private
*devpriv
= dev
->private;
412 int i_ReturnValue
= 0;
413 unsigned int dw_StatusReg
;
414 unsigned char b_ModulNbr
;
415 unsigned char b_SelectedPort
;
416 unsigned char b_InputChannel
;
417 unsigned char b_ReadType
;
418 unsigned char *pb_ChannelStatus
;
419 unsigned char *pb_PortValue
;
421 i_ReturnValue
= insn
->n
;
422 b_ReadType
= (unsigned char) data
[0];
423 b_ModulNbr
= CR_AREF(insn
->chanspec
);
424 b_SelectedPort
= CR_RANGE(insn
->chanspec
);
425 b_InputChannel
= CR_CHAN(insn
->chanspec
);
427 /**************************/
428 /* Test the module number */
429 /**************************/
431 if (b_ModulNbr
< 4) {
432 /**************************/
433 /* Test if TTL I/O module */
434 /**************************/
436 if ((devpriv
->s_BoardInfos
.
437 dw_MolduleConfiguration
[b_ModulNbr
] &
438 0xFFFF0000UL
) == APCI1710_TTL_IO
) {
439 switch (b_ReadType
) {
441 case APCI1710_TTL_READCHANNEL
:
442 pb_ChannelStatus
= (unsigned char *) &data
[0];
443 /********************************/
444 /* Test the TTL I/O port number */
445 /********************************/
447 if (((b_SelectedPort
<= 2)
448 && ((devpriv
->s_BoardInfos
.
449 dw_MolduleConfiguration
453 || ((b_SelectedPort
<= 3)
454 && ((devpriv
->s_BoardInfos
.
455 dw_MolduleConfiguration
459 /******************************************/
460 /* Test the digital imnput channel number */
461 /******************************************/
463 if (((b_InputChannel
<= 7)
464 && (b_SelectedPort
< 3))
465 || ((b_InputChannel
<= 1)
466 && (b_SelectedPort
==
468 /******************************************/
469 /* Test if the TTL I/O module initialised */
470 /******************************************/
475 s_TTLIOInfo
.b_TTLInit
==
477 /***********************************/
478 /* Test if TTL port used for input */
479 /***********************************/
481 if (((devpriv
->s_BoardInfos
.dw_MolduleConfiguration
[b_ModulNbr
] & 0xFFFF) == 0x3130) || (((devpriv
->s_BoardInfos
.dw_MolduleConfiguration
[b_ModulNbr
] & 0xFFFF) >= 0x3230) && (devpriv
->s_ModuleInfo
[b_ModulNbr
].s_TTLIOInfo
.b_PortConfiguration
[b_SelectedPort
] == 0))) {
482 /**************************/
483 /* Read all digital input */
484 /**************************/
499 (8 * b_SelectedPort
)) >> b_InputChannel
) & 1;
501 /*******************************/
502 /* Selected TTL I/O port error */
503 /*******************************/
505 DPRINTK("Selected TTL I/O port error\n");
510 /***************************/
511 /* TTL I/O not initialised */
512 /***************************/
514 DPRINTK("TTL I/O not initialised\n");
518 /********************************/
519 /* Selected digital input error */
520 /********************************/
522 DPRINTK("Selected digital input error\n");
526 /*******************************/
527 /* Selected TTL I/O port error */
528 /*******************************/
530 DPRINTK("Selected TTL I/O port error\n");
535 case APCI1710_TTL_READPORT
:
536 pb_PortValue
= (unsigned char *) &data
[0];
537 /********************************/
538 /* Test the TTL I/O port number */
539 /********************************/
541 if (((b_SelectedPort
<= 2)
542 && ((devpriv
->s_BoardInfos
.
543 dw_MolduleConfiguration
547 || ((b_SelectedPort
<= 3)
548 && ((devpriv
->s_BoardInfos
.
549 dw_MolduleConfiguration
553 /******************************************/
554 /* Test if the TTL I/O module initialised */
555 /******************************************/
557 if (devpriv
->s_ModuleInfo
[b_ModulNbr
].
558 s_TTLIOInfo
.b_TTLInit
== 1) {
559 /***********************************/
560 /* Test if TTL port used for input */
561 /***********************************/
563 if (((devpriv
->s_BoardInfos
.
564 dw_MolduleConfiguration
569 || (((devpriv
->s_BoardInfos
.dw_MolduleConfiguration
[b_ModulNbr
] & 0xFFFF) >= 0x3230) && (devpriv
->s_ModuleInfo
[b_ModulNbr
].s_TTLIOInfo
.b_PortConfiguration
[b_SelectedPort
] == 0))) {
570 /**************************/
571 /* Read all digital input */
572 /**************************/
583 (8 * b_SelectedPort
)) & 0xFF);
585 /*******************************/
586 /* Selected TTL I/O port error */
587 /*******************************/
589 DPRINTK("Selected TTL I/O port error\n");
593 /***************************/
594 /* TTL I/O not initialised */
595 /***************************/
597 DPRINTK("TTL I/O not initialised\n");
601 /*******************************/
602 /* Selected TTL I/O port error */
603 /*******************************/
605 DPRINTK("Selected TTL I/O port error\n");
611 printk("Bad ReadType\n");
615 /**********************************/
616 /* The module is not a TTL module */
617 /**********************************/
619 DPRINTK("The module is not a TTL module\n");
623 /***********************/
624 /* Module number error */
625 /***********************/
627 DPRINTK("Module number error\n");
631 return i_ReturnValue
;
635 +----------------------------------------------------------------------------+
636 | Function Name : int i_APCI1710_InsnReadTTLIOAllPortValue(comedi_device
637 *dev,struct comedi_subdevice *s,struct comedi_insn *insn,unsigned int *data) |
638 +----------------------------------------------------------------------------+
639 | Task : Read the status from all digital input ports |
640 | (port A, port B and port C) from selected TTL |
641 | module (b_ModulNbr) |
642 +----------------------------------------------------------------------------+
643 | Input Parameters : unsigned char_ b_BoardHandle : Handle of board APCI-1710|
644 | unsigned char_ b_ModulNbr : Module number to |
645 | configure (0 to 3) |
646 +----------------------------------------------------------------------------+
647 | Output Parameters : PULONG_ pul_PortValue : Digital TTL inputs port |
649 +----------------------------------------------------------------------------+
650 | Return Value : 0: No error |
651 | -1: The handle parameter of the board is wrong |
652 | -2: The module parameter is wrong |
653 | -3: The module is not a TTL module |
654 | -4: TTL I/O not initialised |
655 +----------------------------------------------------------------------------+
658 static int i_APCI1710_InsnReadTTLIOAllPortValue(struct comedi_device
*dev
,
659 struct comedi_subdevice
*s
,
660 struct comedi_insn
*insn
,
663 struct addi_private
*devpriv
= dev
->private;
664 int i_ReturnValue
= 0;
665 unsigned int dw_StatusReg
;
666 unsigned char b_ModulNbr
;
667 unsigned int *pul_PortValue
;
669 b_ModulNbr
= (unsigned char) CR_AREF(insn
->chanspec
);
670 i_ReturnValue
= insn
->n
;
671 pul_PortValue
= (unsigned int *) &data
[0];
673 /**************************/
674 /* Test the module number */
675 /**************************/
677 if (b_ModulNbr
< 4) {
678 /**************************/
679 /* Test if TTL I/O module */
680 /**************************/
682 if ((devpriv
->s_BoardInfos
.
683 dw_MolduleConfiguration
[b_ModulNbr
] &
684 0xFFFF0000UL
) == APCI1710_TTL_IO
) {
685 /******************************************/
686 /* Test if the TTL I/O module initialised */
687 /******************************************/
690 s_ModuleInfo
[b_ModulNbr
].
691 s_TTLIOInfo
.b_TTLInit
== 1) {
692 /**************************/
693 /* Read all digital input */
694 /**************************/
696 dw_StatusReg
= inl(devpriv
->s_BoardInfos
.
697 ui_Address
+ (64 * b_ModulNbr
));
699 /**********************/
700 /* Test if TTL Rev1.0 */
701 /**********************/
703 if ((devpriv
->s_BoardInfos
.
704 dw_MolduleConfiguration
705 [b_ModulNbr
] & 0xFFFF) ==
708 dw_StatusReg
& 0xFFFFFFUL
;
710 /**************************************/
711 /* Test if port A not used for output */
712 /**************************************/
714 if (devpriv
->s_ModuleInfo
[b_ModulNbr
].
716 b_PortConfiguration
[0] == 1) {
722 /**************************************/
723 /* Test if port B not used for output */
724 /**************************************/
727 s_ModuleInfo
[b_ModulNbr
].
729 b_PortConfiguration
[1] == 1) {
735 /**************************************/
736 /* Test if port C not used for output */
737 /**************************************/
740 s_ModuleInfo
[b_ModulNbr
].
742 b_PortConfiguration
[2] == 1) {
748 /**************************************/
749 /* Test if port D not used for output */
750 /**************************************/
753 s_ModuleInfo
[b_ModulNbr
].
755 b_PortConfiguration
[3] == 1) {
762 /***************************/
763 /* TTL I/O not initialised */
764 /***************************/
765 DPRINTK("TTL I/O not initialised\n");
769 /**********************************/
770 /* The module is not a TTL module */
771 /**********************************/
772 DPRINTK("The module is not a TTL module\n");
776 /***********************/
777 /* Module number error */
778 /***********************/
779 DPRINTK("Module number error\n");
783 return i_ReturnValue
;
787 +----------------------------------------------------------------------------+
789 +----------------------------------------------------------------------------+
793 +----------------------------------------------------------------------------+
794 | Function Name : _INT_ i_APCI1710_SetTTLIOChlOn |
795 | (unsigned char_ b_BoardHandle, |
796 | unsigned char_ b_ModulNbr, |
797 | unsigned char_ b_OutputChannel)
798 int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device *dev,struct comedi_subdevice *s,
799 struct comedi_insn *insn,unsigned int *data) |
800 +----------------------------------------------------------------------------+
801 | Task : Sets or resets the output witch has been passed with the |
802 | parameter b_Channel. Setting an output means setting |
804 +----------------------------------------------------------------------------+
805 | Input Parameters : unsigned char_ b_BoardHandle : Handle of board APCI-1710 |
806 | unsigned char_ b_ModulNbr : Selected module number (0 to 3)|
807 | unsigned char_ b_OutputChannel : Selection from digital output |
815 b_ModulNbr = CR_AREF(insn->chanspec);
816 b_OutputChannel= CR_CHAN(insn->chanspec);
817 ui_State = data[0]; /* ON or OFF */
818 +----------------------------------------------------------------------------+
819 | Output Parameters
: - |
820 +----------------------------------------------------------------------------+
821 | Return Value
: 0: No error
|
822 | -1: The handle parameter of the board is wrong
|
823 | -2: The module parameter is wrong
|
824 | -3: The module is
not a TTL I
/O module
|
825 | -4: The selected digital output is wrong
|
826 | -5: TTL I
/O
not initialised see function
|
827 | " i_APCI1710_InitTTLIO"
828 +----------------------------------------------------------------------------+
831 static int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device
*dev
,
832 struct comedi_subdevice
*s
,
833 struct comedi_insn
*insn
,
836 struct addi_private
*devpriv
= dev
->private;
837 int i_ReturnValue
= 0;
838 unsigned int dw_StatusReg
= 0;
839 unsigned char b_ModulNbr
;
840 unsigned char b_OutputChannel
;
841 unsigned int ui_State
;
843 i_ReturnValue
= insn
->n
;
844 b_ModulNbr
= CR_AREF(insn
->chanspec
);
845 b_OutputChannel
= CR_CHAN(insn
->chanspec
);
846 ui_State
= data
[0]; /* ON or OFF */
848 /**************************/
849 /* Test the module number */
850 /**************************/
852 if (b_ModulNbr
< 4) {
853 /**************************/
854 /* Test if TTL I/O module */
855 /**************************/
857 if ((devpriv
->s_BoardInfos
.
858 dw_MolduleConfiguration
[b_ModulNbr
] &
859 0xFFFF0000UL
) == APCI1710_TTL_IO
) {
860 /******************************************/
861 /* Test if the TTL I/O module initialised */
862 /******************************************/
864 if (devpriv
->s_ModuleInfo
[b_ModulNbr
].
865 s_TTLIOInfo
.b_TTLInit
== 1) {
866 /***********************************/
867 /* Test the TTL I/O channel number */
868 /***********************************/
870 if (((b_OutputChannel
<= 1)
871 && ((devpriv
->s_BoardInfos
.
872 dw_MolduleConfiguration
876 || ((b_OutputChannel
<= 25)
877 && ((devpriv
->s_BoardInfos
.
878 dw_MolduleConfiguration
882 /****************************************************/
883 /* Test if the selected channel is a output channel */
884 /****************************************************/
886 if (((b_OutputChannel
<= 1)
893 || ((b_OutputChannel
>= 2)
894 && (b_OutputChannel
<=
902 || ((b_OutputChannel
>= 10)
903 && (b_OutputChannel
<=
911 || ((b_OutputChannel
>= 18)
912 && (b_OutputChannel
<=
920 /************************/
921 /* Test if PD0 selected */
922 /************************/
924 if (b_OutputChannel
== 0) {
932 /************************/
933 /* Test if PD1 selected */
934 /************************/
936 if (b_OutputChannel
==
951 /********************/
952 /* Read all channel */
953 /********************/
962 if (ui_State
) /* ON */
968 ((b_OutputChannel
/ 8) * 8)) & 0xFF;
984 ((b_OutputChannel
/ 8) * 8)) & 0xFF;
991 (1 << (b_OutputChannel
% 8)));
995 /****************************/
996 /* Set the new output value */
997 /****************************/
999 outl(dw_StatusReg
, devpriv
->s_BoardInfos
.ui_Address
+ 8 + ((b_OutputChannel
/ 8) * 4) + (64 * b_ModulNbr
));
1003 /************************************/
1004 /* The selected TTL output is wrong */
1005 /************************************/
1007 DPRINTK(" The selected TTL output is wrong\n");
1011 /************************************/
1012 /* The selected TTL output is wrong */
1013 /************************************/
1015 DPRINTK("The selected TTL output is wrong\n");
1019 /***************************/
1020 /* TTL I/O not initialised */
1021 /***************************/
1023 DPRINTK("TTL I/O not initialised\n");
1027 /**************************************/
1028 /* The module is not a TTL I/O module */
1029 /**************************************/
1031 DPRINTK("The module is not a TTL I/O module\n");
1035 /***********************/
1036 /* Module number error */
1037 /***********************/
1039 DPRINTK("Module number error\n");
1043 return i_ReturnValue
;