108 unsigned char b_InitType;
109 unsigned char b_PortAMode;
110 unsigned char b_PortBMode;
111 unsigned char b_PortCMode;
112 unsigned char b_PortDMode;
115 b_InitType = (
unsigned char) data[0];
116 i_ReturnValue = insn->
n;
122 if (b_ModulNbr < 4) {
128 dw_MolduleConfiguration[b_ModulNbr] &
130 switch (b_InitType) {
134 s_TTLIOInfo.b_TTLInit = 1;
141 s_TTLIOInfo.b_PortConfiguration[0] = 0;
148 s_TTLIOInfo.b_PortConfiguration[1] = 0;
155 s_TTLIOInfo.b_PortConfiguration[2] = 0;
162 s_TTLIOInfo.b_PortConfiguration[3] = 1;
169 devpriv->s_BoardInfos.ui_Address + 20 +
175 b_PortAMode = (
unsigned char) data[1];
176 b_PortBMode = (
unsigned char) data[2];
177 b_PortCMode = (
unsigned char) data[3];
178 b_PortDMode = (
unsigned char) data[4];
185 dw_MolduleConfiguration
186 [b_ModulNbr] & 0xFFFF) >=
192 if ((b_PortAMode == 0)
193 || (b_PortAMode == 1)) {
198 if ((b_PortBMode == 0)
199 || (b_PortBMode == 1)) {
204 if ((b_PortCMode == 0)
211 if ((b_PortDMode == 0) || (b_PortDMode == 1)) {
276 outl((b_PortAMode << 0) | (b_PortBMode << 1) | (b_PortCMode << 2) | (b_PortDMode << 3),
devpriv->s_BoardInfos.ui_Address + 20 + (64 * b_ModulNbr));
282 DPRINTK(
"Port D mode selection is wrong\n");
292 DPRINTK(
"Port C mode selection is wrong\n");
301 DPRINTK(
"Port B mode selection is wrong\n");
309 DPRINTK(
"Port A mode selection is wrong\n");
317 DPRINTK(
"Function not available for this version\n");
324 printk(
"Bad Config Type\n");
331 DPRINTK(
"The module is not a TTL module\n");
339 DPRINTK(
"Module number error\n");
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];
431 if (b_ModulNbr < 4) {
437 dw_MolduleConfiguration[b_ModulNbr] &
439 switch (b_ReadType) {
442 pb_ChannelStatus = (
unsigned char *) &data[0];
447 if (((b_SelectedPort <= 2)
449 dw_MolduleConfiguration
453 || ((b_SelectedPort <= 3)
455 dw_MolduleConfiguration
463 if (((b_InputChannel <= 7)
464 && (b_SelectedPort < 3))
465 || ((b_InputChannel <= 1)
466 && (b_SelectedPort ==
475 s_TTLIOInfo.b_TTLInit ==
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))) {
499 (8 * b_SelectedPort)) >> b_InputChannel) & 1;
505 DPRINTK(
"Selected TTL I/O port error\n");
514 DPRINTK(
"TTL I/O not initialised\n");
522 DPRINTK(
"Selected digital input error\n");
530 DPRINTK(
"Selected TTL I/O port error\n");
536 pb_PortValue = (
unsigned char *) &data[0];
541 if (((b_SelectedPort <= 2)
543 dw_MolduleConfiguration
547 || ((b_SelectedPort <= 3)
549 dw_MolduleConfiguration
557 if (
devpriv->s_ModuleInfo[b_ModulNbr].
558 s_TTLIOInfo.b_TTLInit == 1) {
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))) {
583 (8 * b_SelectedPort)) & 0xFF);
589 DPRINTK(
"Selected TTL I/O port error\n");
597 DPRINTK(
"TTL I/O not initialised\n");
605 DPRINTK(
"Selected TTL I/O port error\n");
619 DPRINTK(
"The module is not a TTL module\n");
627 DPRINTK(
"Module number error\n");
664 unsigned int *pul_PortValue;
667 i_ReturnValue = insn->
n;
668 pul_PortValue = (
unsigned int *) &data[0];
674 if (b_ModulNbr < 4) {
680 dw_MolduleConfiguration[b_ModulNbr] &
687 s_ModuleInfo[b_ModulNbr].
688 s_TTLIOInfo.b_TTLInit == 1) {
694 ui_Address + (64 * b_ModulNbr));
701 dw_MolduleConfiguration
702 [b_ModulNbr] & 0xFFFF) ==
705 dw_StatusReg & 0xFFFFFF
UL;
711 if (
devpriv->s_ModuleInfo[b_ModulNbr].
713 b_PortConfiguration[0] == 1) {
724 s_ModuleInfo[b_ModulNbr].
726 b_PortConfiguration[1] == 1) {
737 s_ModuleInfo[b_ModulNbr].
739 b_PortConfiguration[2] == 1) {
750 s_ModuleInfo[b_ModulNbr].
752 b_PortConfiguration[3] == 1) {
762 DPRINTK(
"TTL I/O not initialised\n");
769 DPRINTK(
"The module is not a TTL module\n");
776 DPRINTK(
"Module number error\n");
815 +----------------------------------------------------------------------------+
817 +----------------------------------------------------------------------------+
823 | -5: TTL
I/O not initialised see
function |
824 |
" i_APCI1710_InitTTLIO"
825 +----------------------------------------------------------------------------+
837 i_ReturnValue = insn->
n;
846 if (b_ModulNbr < 4) {
852 dw_MolduleConfiguration[b_ModulNbr] &
858 if (
devpriv->s_ModuleInfo[b_ModulNbr].
859 s_TTLIOInfo.b_TTLInit == 1) {
864 if (((b_OutputChannel <= 1)
866 dw_MolduleConfiguration
870 || ((b_OutputChannel <= 25)
872 dw_MolduleConfiguration
880 if (((b_OutputChannel <= 1)
887 || ((b_OutputChannel >= 2)
888 && (b_OutputChannel <=
896 || ((b_OutputChannel >= 10)
897 && (b_OutputChannel <=
905 || ((b_OutputChannel >= 18)
906 && (b_OutputChannel <=
918 if (b_OutputChannel == 0) {
930 if (b_OutputChannel ==
962 ((b_OutputChannel / 8) * 8)) & 0xFF;
978 ((b_OutputChannel / 8) * 8)) & 0xFF;
985 (1 << (b_OutputChannel % 8)));
993 outl(dw_StatusReg,
devpriv->s_BoardInfos.ui_Address + 8 + ((b_OutputChannel / 8) * 4) + (64 * b_ModulNbr));
1001 DPRINTK(
" The selected TTL output is wrong\n");
1009 DPRINTK(
"The selected TTL output is wrong\n");
1017 DPRINTK(
"TTL I/O not initialised\n");
1025 DPRINTK(
"The module is not a TTL I/O module\n");
1033 DPRINTK(
"Module number error\n");