90 #define AMCC_OP_REG_MCSR 0x3c
91 #define EEPROM_BUSY 0x80000000
92 #define NVCMD_LOAD_LOW (0x4 << 5)
93 #define NVCMD_LOAD_HIGH (0x5 << 5)
94 #define NVCMD_BEGIN_READ (0x7 << 5)
95 #define NVCMD_BEGIN_WRITE (0x6 << 5)
116 unsigned int dw_PCIBoardEepromAddress,
117 unsigned short w_EepromStartAddress,
unsigned short *pw_DataRead)
119 unsigned int dw_eeprom_busy = 0;
123 unsigned char pb_ReadByte[1];
124 unsigned char b_ReadLowByte = 0;
125 unsigned char b_ReadHighByte = 0;
126 unsigned char b_SelectedAddressLow = 0;
127 unsigned char b_SelectedAddressHigh = 0;
128 unsigned short w_ReadWord = 0;
130 for (i_WordCounter = 0; i_WordCounter < i_NbOfWordsToRead;
134 inl(dw_PCIBoardEepromAddress +
139 for (i_Counter = 0; i_Counter < 2; i_Counter++) {
140 b_SelectedAddressLow = (w_EepromStartAddress + i_Counter) % 256;
141 b_SelectedAddressHigh = (w_EepromStartAddress + i_Counter) / 256;
151 inl(dw_PCIBoardEepromAddress +
157 outb(b_SelectedAddressLow,
164 inl(dw_PCIBoardEepromAddress +
177 inl(dw_PCIBoardEepromAddress +
183 outb(b_SelectedAddressHigh,
190 inl(dw_PCIBoardEepromAddress +
203 inl(dw_PCIBoardEepromAddress +
210 inb(dw_PCIBoardEepromAddress +
216 inl(dw_PCIBoardEepromAddress +
223 b_ReadLowByte = pb_ReadByte[0];
225 b_ReadHighByte = pb_ReadByte[0];
233 (b_ReadLowByte | (((
unsigned short)b_ReadHighByte) *
236 pw_DataRead[i_WordCounter] = w_ReadWord;
238 w_EepromStartAddress += 2;
259 unsigned short w_AnalogInputMainHeaderAddress;
260 unsigned short w_AnalogInputComponentAddress;
261 unsigned short w_NumberOfModuls = 0;
262 unsigned short w_CurrentSources[2];
263 unsigned short w_ModulCounter = 0;
264 unsigned short w_FirstHeaderSize = 0;
265 unsigned short w_NumberOfInputs = 0;
266 unsigned short w_CJCFlag = 0;
267 unsigned short w_NumberOfGainValue = 0;
268 unsigned short w_SingleHeaderAddress = 0;
269 unsigned short w_SingleHeaderSize = 0;
270 unsigned short w_Input = 0;
271 unsigned short w_GainFactorAddress = 0;
272 unsigned short w_GainFactorValue[2];
273 unsigned short w_GainIndex = 0;
274 unsigned short w_GainValue = 0;
280 dw_PCIBoardEepromAddress, 0x116,
281 &w_AnalogInputMainHeaderAddress);
286 w_AnalogInputMainHeaderAddress = w_AnalogInputMainHeaderAddress + 0x100;
292 dw_PCIBoardEepromAddress, w_AnalogInputMainHeaderAddress + 0x02,
295 for (w_ModulCounter = 0; w_ModulCounter < w_NumberOfModuls;
300 w_AnalogInputComponentAddress =
301 w_AnalogInputMainHeaderAddress +
302 (w_FirstHeaderSize * w_ModulCounter) + 0x04;
308 dw_PCIBoardEepromAddress, w_AnalogInputComponentAddress,
311 w_FirstHeaderSize = w_FirstHeaderSize >> 4;
317 dw_PCIBoardEepromAddress, w_AnalogInputComponentAddress + 0x06,
320 w_NumberOfInputs = w_NumberOfInputs >> 4;
326 dw_PCIBoardEepromAddress, w_AnalogInputComponentAddress + 0x08,
329 w_CJCFlag = (w_CJCFlag >> 3) & 0x1;
335 dw_PCIBoardEepromAddress, w_AnalogInputComponentAddress + 0x44,
336 &w_NumberOfGainValue);
338 w_NumberOfGainValue = w_NumberOfGainValue & 0xFF;
343 w_SingleHeaderAddress =
344 w_AnalogInputComponentAddress + 0x46 +
345 (((w_NumberOfGainValue / 16) + 1) * 2) +
346 (6 * w_NumberOfGainValue) +
347 (4 * (((w_NumberOfGainValue / 16) + 1) * 2));
353 dw_PCIBoardEepromAddress, w_SingleHeaderAddress,
354 &w_SingleHeaderSize);
356 w_SingleHeaderSize = w_SingleHeaderSize >> 4;
361 w_GainFactorAddress = w_AnalogInputComponentAddress;
363 for (w_GainIndex = 0; w_GainIndex < w_NumberOfGainValue;
369 dw_PCIBoardEepromAddress, w_AnalogInputComponentAddress + 70 + (2 * (1 + (w_NumberOfGainValue / 16))) + (0x02 * w_GainIndex),
372 BoardInformations->
s_Module[w_ModulCounter].
373 w_GainValue[w_GainIndex] = w_GainValue;
376 printk(
"\n Gain value = %d",
377 BoardInformations->
s_Module[w_ModulCounter].
378 w_GainValue[w_GainIndex]);
385 dw_PCIBoardEepromAddress, w_AnalogInputComponentAddress + 70 + ((2 * w_NumberOfGainValue) + (2 * (1 + (w_NumberOfGainValue / 16)))) + (0x04 * w_GainIndex),
388 BoardInformations->
s_Module[w_ModulCounter].
389 ul_GainFactor[w_GainIndex] =
390 (w_GainFactorValue[1] << 16) +
391 w_GainFactorValue[0];
394 printk(
"\n w_GainFactorValue [%d] = %lu", w_GainIndex,
395 BoardInformations->
s_Module[w_ModulCounter].
396 ul_GainFactor[w_GainIndex]);
403 for (w_Input = 0; w_Input < w_NumberOfInputs; w_Input++) {
408 dw_PCIBoardEepromAddress,
409 (w_Input * w_SingleHeaderSize) +
410 w_SingleHeaderAddress + 0x0C, w_CurrentSources);
415 BoardInformations->
s_Module[w_ModulCounter].
416 ul_CurrentSource[w_Input] =
417 (w_CurrentSources[0] +
418 ((w_CurrentSources[1] & 0xFFF) << 16));
421 printk(
"\n Current sources [%d] = %lu", w_Input,
422 BoardInformations->
s_Module[w_ModulCounter].
423 ul_CurrentSource[w_Input]);
431 dw_PCIBoardEepromAddress,
432 (w_Input * w_SingleHeaderSize) + w_SingleHeaderAddress +
433 0x0C, w_CurrentSources);
438 BoardInformations->
s_Module[w_ModulCounter].
439 ul_CurrentSourceCJC =
440 (w_CurrentSources[0] +
441 ((w_CurrentSources[1] & 0xFFF) << 16));
444 printk(
"\n Current sources CJC = %lu",
445 BoardInformations->
s_Module[w_ModulCounter].
446 ul_CurrentSourceCJC);
453 unsigned int *ChannelCurrentSource,
unsigned int *ChannelGainFactor)
455 int i_DiffChannel = 0;
459 printk(
"\n Channel = %u", ui_Channel_num);
466 if (ui_Channel_num <= 1)
468 else if ((ui_Channel_num >= 2) && (ui_Channel_num <= 3))
469 i_DiffChannel = ui_Channel_num - 2, i_Module = 1;
470 else if ((ui_Channel_num >= 4) && (ui_Channel_num <= 5))
471 i_DiffChannel = ui_Channel_num - 4, i_Module = 2;
472 else if ((ui_Channel_num >= 6) && (ui_Channel_num <= 7))
473 i_DiffChannel = ui_Channel_num - 6, i_Module = 3;
477 if ((ui_Channel_num == 0) || (ui_Channel_num == 1))
478 i_DiffChannel = 0, i_Module = 0;
479 else if ((ui_Channel_num == 2) || (ui_Channel_num == 3))
480 i_DiffChannel = 1, i_Module = 0;
481 else if ((ui_Channel_num == 4) || (ui_Channel_num == 5))
482 i_DiffChannel = 0, i_Module = 1;
483 else if ((ui_Channel_num == 6) || (ui_Channel_num == 7))
484 i_DiffChannel = 1, i_Module = 1;
485 else if ((ui_Channel_num == 8) || (ui_Channel_num == 9))
486 i_DiffChannel = 0, i_Module = 2;
487 else if ((ui_Channel_num == 10) || (ui_Channel_num == 11))
488 i_DiffChannel = 1, i_Module = 2;
489 else if ((ui_Channel_num == 12) || (ui_Channel_num == 13))
490 i_DiffChannel = 0, i_Module = 3;
491 else if ((ui_Channel_num == 14) || (ui_Channel_num == 15))
492 i_DiffChannel = 1, i_Module = 3;
499 printk(
"\n CJCCurrentSource = %lu", *CJCCurrentSource);
502 *ChannelCurrentSource =
504 ul_CurrentSource[i_DiffChannel];
506 printk(
"\n ChannelCurrentSource = %lu", *ChannelCurrentSource);
516 printk(
"\n ChannelGainFactor = %lu", *ChannelGainFactor);
551 unsigned int ui_Temp = 0;
552 unsigned int ui_NoOfChannel = 0;
558 *data = (*data >> ui_NoOfChannel) & 0x1;
562 if (data[1] < 0 || data[1] > 1) {
563 printk(
"\nThe port number is in error\n");
566 switch (ui_NoOfChannel) {
569 *data = (*data >> (2 * data[1])) & 0x3;
572 *data = (*data & 15);
581 printk(
"\nSpecified channel not supported \n");
610 if ((data[0] != 0) && (data[0] != 1)) {
612 "Not a valid Data !!! ,Data should be 1 or 0\n");
654 unsigned int ui_Temp = 0, ui_Temp1 = 0;
656 if (
devpriv->b_OutputMemoryStatus) {
665 data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
670 switch (ui_NoOfChannel) {
678 data[0] = (data[0] | ui_Temp);
685 printk(
"\nSpecified channel not supported\n");
692 data[0] = ~data[0] & 0x1;
694 ui_Temp1 = ui_Temp1 << ui_NoOfChannel;
695 ui_Temp = ui_Temp | ui_Temp1;
696 data[0] = (data[0] << ui_NoOfChannel) ^ 0xf;
697 data[0] = data[0] & ui_Temp;
702 switch (ui_NoOfChannel) {
705 data[0] = ~data[0] & 0x3;
708 ui_Temp1 << 2 * data[2];
709 ui_Temp = ui_Temp | ui_Temp1;
729 printk(
"\nSpecified channel not supported\n");
734 printk(
"\nSpecified functionality does not exist\n");
767 unsigned int ui_Temp;
768 unsigned int ui_NoOfChannel;
773 *data = (*data >> ui_NoOfChannel) & 0x1;
777 if (data[1] < 0 || data[1] > 1) {
778 printk(
"\nThe port selection is in error\n");
781 switch (ui_NoOfChannel) {
783 *data = (*data >> (2 * data[1])) & 3;
796 printk(
"\nSpecified channel not supported \n");
876 unsigned int ul_Config = 0, ul_Temp = 0;
877 unsigned int ui_ChannelNo = 0;
878 unsigned int ui_Dummy = 0;
916 printk(
"\n s_Module[%i].ul_CurrentSourceCJC = %lu", i,
918 ul_CurrentSourceCJC);
920 for (i2 = 0; i2 < 5; i2++) {
921 printk(
"\n s_Module[%i].ul_CurrentSource [%i] = %lu", i, i2,
s_BoardInfos[dev->
minor].s_Module[i].ul_CurrentSource[i2]);
924 for (i2 = 0; i2 < 8; i2++) {
925 printk(
"\n s_Module[%i].ul_GainFactor [%i] = %lu", i, i2,
s_BoardInfos[dev->
minor].s_Module[i].ul_GainFactor[i2]);
928 for (i2 = 0; i2 < 8; i2++) {
929 printk(
"\n s_Module[%i].w_GainValue [%i] = %u",
939 if (data[0] != 0 && data[0] != 1 && data[0] != 2) {
940 printk(
"\nThe selection of acquisition type is in error\n");
944 if (data[14] != 0 && data[14] != 1 && data[14] != 2
946 printk(
"\n Error in selection of RTD connection type\n");
950 if (data[1] < 0 || data[1] > 7) {
951 printk(
"\nThe selection of gain is in error\n");
954 if (data[2] != 0 && data[2] != 1) {
955 printk(
"\nThe selection of polarity is in error\n");
959 printk(
"\nThe selection of offset range is in error\n");
962 if (data[4] != 0 && data[4] != 1) {
963 printk(
"\nThe selection of coupling is in error\n");
966 if (data[5] != 0 && data[5] != 1) {
967 printk(
"\nThe selection of single/differential mode is in error\n");
970 if (data[8] != 0 && data[8] != 1 && data[2] != 2) {
971 printk(
"\nError in selection of functionality\n");
973 if (data[12] == 0 || data[12] == 1) {
974 if (data[6] != 20 && data[6] != 40 && data[6] != 80
976 printk(
"\nThe selection of conversion time reload value is in error\n");
980 printk(
"\nThe selection of conversion time unit is in error\n");
984 if (data[9] != 0 && data[9] != 1) {
985 printk(
"\nThe selection of interrupt enable is in error\n");
988 if (data[11] < 0 || data[11] > 4) {
989 printk(
"\nThe selection of module is in error\n");
992 if (data[12] < 0 || data[12] > 3) {
993 printk(
"\nThe selection of singlechannel/scan selection is in error\n");
996 if (data[13] < 0 || data[13] > 16) {
997 printk(
"\nThe selection of number of channels is in error\n");
1055 if (ui_ChannelNo < 0 || ui_ChannelNo > 15) {
1056 printk(
"\nThe Selection of the channel is in error\n");
1061 if (data[14] == 2) {
1062 if (ui_ChannelNo < 0 || ui_ChannelNo > 3) {
1063 printk(
"\nThe Selection of the channel is in error\n");
1068 if (ui_ChannelNo < 0 || ui_ChannelNo > 7) {
1069 printk(
"\nThe Selection of the channel is in error\n");
1074 if (data[12] == 0 || data[12] == 1) {
1077 if (ui_ChannelNo >= 0 && ui_ChannelNo <= 3) {
1083 if (ui_ChannelNo >= 4 && ui_ChannelNo <= 7) {
1089 if (ui_ChannelNo >= 8 && ui_ChannelNo <= 11) {
1095 if (ui_ChannelNo >= 12 && ui_ChannelNo <= 15) {
1103 if (data[14] == 2) {
1104 if (ui_ChannelNo == 0) {
1110 if (ui_ChannelNo == 1) {
1116 if (ui_ChannelNo == 2) {
1122 if (ui_ChannelNo == 3) {
1136 if (ui_ChannelNo >= 0 && ui_ChannelNo <= 1) {
1142 if (ui_ChannelNo >= 2 && ui_ChannelNo <= 3) {
1151 ui_ChannelNo = ui_ChannelNo - 2;
1153 if (ui_ChannelNo >= 4 && ui_ChannelNo <= 5) {
1162 ui_ChannelNo = ui_ChannelNo - 4;
1164 if (ui_ChannelNo >= 6 && ui_ChannelNo <= 7) {
1173 ui_ChannelNo = ui_ChannelNo - 6;
1178 printk(
"\n This selection of polarity does not exist\n");
1209 printk(
"\nError in module selection\n");
1228 data[1] | (data[2] << 6) | (data[5] << 7) | (data[3] << 8) |
1233 12) >> 19) & 1) != 1) ;
1240 outl(0 | ui_ChannelNo,
1247 12) >> 19) & 1) != 1) ;
1260 12) >> 19) & 1) != 1) ;
1283 12) >> 19) & 1) != 1) ;
1288 outl((ul_Temp & 0xFFF9FFFF),
1362 unsigned int ui_DummyValue = 0;
1363 int i_ConvertCJCCalibration;
1379 switch (insn->
unused[0]) {
1393 s_BoardInfos[dev->
minor].ui_Channel_num,
1394 &s_BoardInfos[dev->
minor].
1397 &s_BoardInfos[dev->
minor].
1400 &s_BoardInfos[dev->
minor].
1405 printk(
"\n s_BoardInfos [dev->minor].ui_InterruptChannelValue[s_BoardInfos [dev->minor].i_Count+6] = %lu", s_BoardInfos[dev->
minor].ui_InterruptChannelValue[s_BoardInfos[dev->
minor].i_Count + 6]);
1407 printk(
"\n s_BoardInfos [dev->minor].ui_InterruptChannelValue[s_BoardInfos [dev->minor].i_Count+7] = %lu", s_BoardInfos[dev->
minor].ui_InterruptChannelValue[s_BoardInfos[dev->
minor].i_Count + 7]);
1409 printk(
"\n s_BoardInfos [dev->minor].ui_InterruptChannelValue[s_BoardInfos [dev->minor].i_Count+8] = %lu", s_BoardInfos[dev->
minor].ui_InterruptChannelValue[s_BoardInfos[dev->
minor].i_Count + 8]);
1416 if ((s_BoardInfos[dev->
minor].i_ADDIDATAType == 2)
1417 && (s_BoardInfos[dev->
minor].i_InterruptFlag ==
FALSE)
1418 && (s_BoardInfos[dev->
minor].i_CJCAvailable == 1))
1424 s_BoardInfos[dev->
minor].
1426 minor].i_Count + 3] = ui_DummyValue;
1432 s_BoardInfos[dev->
minor].
1434 minor].i_Count + 3] = 0;
1440 if ((s_BoardInfos[dev->
minor].i_AutoCalibration ==
FALSE)
1441 && (s_BoardInfos[dev->
minor].i_InterruptFlag ==
FALSE))
1448 s_BoardInfos[dev->
minor].
1450 minor].i_Count + 1] = ui_DummyValue;
1456 s_BoardInfos[dev->
minor].
1458 minor].i_Count + 2] = ui_DummyValue;
1464 if ((s_BoardInfos[dev->
minor].i_ADDIDATAType == 2)
1465 && (s_BoardInfos[dev->
minor].i_InterruptFlag ==
FALSE)
1466 && (s_BoardInfos[dev->
minor].i_CJCAvailable == 1))
1477 if (s_BoardInfos[dev->
minor].i_CJCPolarity !=
1478 s_BoardInfos[dev->
minor].i_ADDIDATAPolarity)
1481 i_ConvertCJCCalibration = 1;
1486 if (s_BoardInfos[dev->
minor].i_CJCGain ==
1487 s_BoardInfos[dev->
minor].i_ADDIDATAGain)
1490 i_ConvertCJCCalibration = 0;
1493 i_ConvertCJCCalibration = 1;
1496 if (i_ConvertCJCCalibration == 1) {
1501 s_BoardInfos[dev->
minor].
1503 [dev->
minor].i_Count + 4] =
1511 s_BoardInfos[dev->
minor].
1513 [dev->
minor].i_Count + 5] =
1522 s_BoardInfos[dev->
minor].
1524 [dev->
minor].i_Count + 4] = 0;
1525 s_BoardInfos[dev->
minor].
1527 [dev->
minor].i_Count + 5] = 0;
1534 if (s_BoardInfos[dev->
minor].i_ScanType != 1) {
1536 s_BoardInfos[dev->
minor].i_Count = 0;
1542 s_BoardInfos[dev->
minor].i_Count =
1543 s_BoardInfos[dev->
minor].i_Count + 9;
1548 if ((s_BoardInfos[dev->
minor].i_ScanType == 1)
1549 && (s_BoardInfos[dev->
minor].i_InterruptFlag == 1)) {
1553 s_BoardInfos[dev->
minor].i_Count =
1554 s_BoardInfos[dev->
minor].i_Count - 9;
1558 if (s_BoardInfos[dev->
minor].i_ScanType == 0) {
1568 printk(
"\n data[0]= s_BoardInfos [dev->minor].ui_InterruptChannelValue[0];");
1571 s_BoardInfos[dev->
minor].
1574 s_BoardInfos[dev->
minor].
1577 s_BoardInfos[dev->
minor].
1580 s_BoardInfos[dev->
minor].
1583 s_BoardInfos[dev->
minor].
1586 s_BoardInfos[dev->
minor].
1592 s_BoardInfos[dev->
minor].ui_Channel_num,
1593 &data[6], &data[7], &data[8]);
1599 for (i = 0; i < insn->
n; i++) {
1602 s_BoardInfos[dev->
minor].
1609 s_BoardInfos[dev->
minor].i_Count = 0;
1610 s_BoardInfos[dev->
minor].i_Sum = 0;
1611 if (s_BoardInfos[dev->
minor].i_ScanType == 1) {
1614 s_BoardInfos[dev->
minor].i_Initialised = 0;
1615 s_BoardInfos[dev->
minor].i_InterruptFlag = 0;
1620 printk(
"\nThe parameters passed are in error\n");
1652 unsigned int ui_EOC = 0;
1653 unsigned int ui_ChannelNo = 0;
1654 unsigned int ui_CommandRegister = 0;
1662 12) >> 19) & 1) != 1) ;
1678 12) >> 19) & 1) != 1) ;
1689 12) >> 19) & 1) != 1) ;
1699 ui_CommandRegister = ui_ChannelNo | (ui_ChannelNo << 8) | 0x80000;
1710 ui_CommandRegister = ui_CommandRegister | 0x00100000;
1718 12) >> 19) & 1) != 1) ;
1721 outl(ui_CommandRegister,
1738 }
while (ui_EOC != 1);
1776 unsigned int ui_Temp = 0, ui_EOC = 0;
1777 unsigned int ui_CommandRegister = 0;
1782 12) >> 19) & 1) != 1) ;
1796 12) >> 19) & 1) != 1) ;
1805 12) >> 19) & 1) != 1) ;
1820 12) >> 19) & 1) != 1) ;
1822 outl((ui_Temp | 0x00020000),
1828 ui_CommandRegister = 0;
1841 ui_CommandRegister = ui_CommandRegister | 0x00100000;
1848 ui_CommandRegister = ui_CommandRegister | 0x00080000;
1855 12) >> 19) & 1) != 1) ;
1857 outl(ui_CommandRegister,
1876 }
while (ui_EOC != 1);
1912 unsigned int ui_EOC = 0;
1913 int ui_CommandRegister = 0;
1917 12) >> 19) & 1) != 1) ;
1934 12) >> 19) & 1) != 1) ;
1943 12) >> 19) & 1) != 1) ;
1952 12) >> 19) & 1) != 1) ;
1961 ui_CommandRegister = 0;
1974 ui_CommandRegister = ui_CommandRegister | 0x00100000;
1982 ui_CommandRegister = ui_CommandRegister | 0x00080000;
1988 12) >> 19) & 1) != 1) ;
1990 outl(ui_CommandRegister,
2010 }
while (ui_EOC != 1);
2048 unsigned int ui_EOC = 0;
2049 int ui_CommandRegister = 0;
2057 12) >> 19) & 1) != 1) ;
2067 12) >> 19) & 1) != 1) ;
2078 12) >> 19) & 1) != 1) ;
2086 ui_CommandRegister = 0;
2095 ui_CommandRegister = ui_CommandRegister | 0x00100000;
2102 ui_CommandRegister = ui_CommandRegister | 0x00080000;
2109 12) >> 19) & 1) != 1) ;
2111 outl(ui_CommandRegister,
2130 }
while (ui_EOC != 1);
2167 unsigned int ui_EOC = 0;
2168 int ui_CommandRegister = 0;
2177 12) >> 19) & 1) != 1) ;
2186 12) >> 19) & 1) != 1) ;
2195 12) >> 19) & 1) != 1) ;
2204 12) >> 19) & 1) != 1) ;
2211 ui_CommandRegister = 0;
2221 ui_CommandRegister = ui_CommandRegister | 0x00100000;
2228 ui_CommandRegister = ui_CommandRegister | 0x00080000;
2234 12) >> 19) & 1) != 1) ;
2236 outl(ui_CommandRegister,
2247 }
while (ui_EOC != 1);
2283 unsigned int ui_EOC = 0;
2284 int ui_CommandRegister = 0;
2290 12) >> 19) & 1) != 1) ;
2299 12) >> 19) & 1) != 1) ;
2308 12) >> 19) & 1) != 1) ;
2317 12) >> 19) & 1) != 1) ;
2325 ui_CommandRegister = 0;
2334 ui_CommandRegister = ui_CommandRegister | 0x00100000;
2339 ui_CommandRegister = ui_CommandRegister | 0x00080000;
2345 12) >> 19) & 1) != 1) ;
2347 outl(ui_CommandRegister,
2358 }
while (ui_EOC != 1);
2405 unsigned int ui_Configuration = 0;
2413 if (data[0] != 0 && data[0] != 1) {
2414 printk(
"\nError in selection of functionality\n");
2447 12) >> 19) & 1) != 1) ;
2487 12) >> 19) & 1) != 1) ;
2563 unsigned int ui_ConvertTime = 0;
2564 unsigned int ui_ConvertTimeBase = 0;
2565 unsigned int ui_DelayTime = 0;
2566 unsigned int ui_DelayTimeBase = 0;
2567 int i_Triggermode = 0;
2568 int i_TriggerEdge = 0;
2569 int i_NbrOfChannel = 0;
2571 double d_ConversionTimeForAllChannels = 0.0;
2572 double d_SCANTimeNewUnit = 0.0;
2593 err |= cfc_check_trigger_is_unique(&cmd->
start_src);
2595 err |= cfc_check_trigger_is_unique(&cmd->
stop_src);
2600 i_TriggerEdge = cmd->
start_arg & 0xFFFF;
2602 if (i_TriggerEdge < 1 || i_TriggerEdge > 3) {
2604 printk(
"\nThe trigger edge selection is in error\n");
2606 if (i_Triggermode != 2) {
2608 printk(
"\nThe trigger mode selection is in error\n");
2624 if (ui_ConvertTime != 20 && ui_ConvertTime != 40
2625 && ui_ConvertTime != 80 && ui_ConvertTime != 160)
2627 printk(
"\nThe selection of conversion time reload value is in error\n");
2630 if (ui_ConvertTimeBase != 2) {
2631 printk(
"\nThe selection of conversion time unit is in error\n");
2636 ui_ConvertTimeBase = 0;
2640 ui_DelayTimeBase = 0;
2645 if (ui_DelayTimeBase != 2 && ui_DelayTimeBase != 3) {
2647 printk(
"\nThe Delay time base selection is in error\n");
2649 if (ui_DelayTime < 1 || ui_DelayTime > 1023) {
2651 printk(
"\nThe Delay time value is in error\n");
2658 d_SCANTimeNewUnit = (double)ui_DelayTime;
2666 d_ConversionTimeForAllChannels =
2667 (double)((
double)ui_ConvertTime /
2668 (double)i_NbrOfChannel);
2673 d_ConversionTimeForAllChannels =
2674 (double)1.0 / d_ConversionTimeForAllChannels;
2675 ui_ConvertTimeBase = 3;
2680 if (ui_DelayTimeBase <= ui_ConvertTimeBase) {
2683 i_Cpt < (ui_ConvertTimeBase - ui_DelayTimeBase);
2686 d_ConversionTimeForAllChannels =
2687 d_ConversionTimeForAllChannels * 1000;
2688 d_ConversionTimeForAllChannels =
2689 d_ConversionTimeForAllChannels + 1;
2693 i_Cpt < (ui_DelayTimeBase - ui_ConvertTimeBase);
2695 d_SCANTimeNewUnit = d_SCANTimeNewUnit * 1000;
2700 if (d_ConversionTimeForAllChannels >= d_SCANTimeNewUnit) {
2702 printk(
"\nSCAN Delay value cannot be used\n");
2739 unsigned int ui_Configuration = 0;
2760 12) >> 19) & 1) != 1) ;
2762 outl((ui_Configuration & 0xFFE7FFFF),
2790 unsigned int ui_Configuration = 0;
2792 unsigned int ui_Trigger = 0;
2793 unsigned int ui_TriggerEdge = 0;
2794 unsigned int ui_Triggermode = 0;
2795 unsigned int ui_ScanMode = 0;
2796 unsigned int ui_ConvertTime = 0;
2797 unsigned int ui_ConvertTimeBase = 0;
2798 unsigned int ui_DelayTime = 0;
2799 unsigned int ui_DelayTimeBase = 0;
2800 unsigned int ui_DelayMode = 0;
2807 ui_TriggerEdge = cmd->
start_arg & 0xFFFF;
2823 ui_DelayTimeBase = 0;
2838 ui_ConvertTimeBase = 0;
2854 12) >> 19) & 1) != 1) ;
2856 outl((ui_Configuration & 0xFFC00000),
2859 ui_Configuration = 0;
2873 (ui_TriggerEdge << 25) | (ui_Triggermode << 27) | (ui_DelayMode
2874 << 18) | (ui_ScanMode << 16);
2881 12) >> 19) & 1) != 1) ;
2883 outl(ui_Configuration,
2890 12) >> 19) & 1) != 1) ;
2899 12) >> 19) & 1) != 1) ;
2901 outl(ui_DelayTimeBase,
2908 12) >> 19) & 1) != 1) ;
2910 outl(ui_ConvertTime,
2918 12) >> 19) & 1) != 1) ;
2920 outl(ui_ConvertTimeBase,
2933 12) >> 19) & 1) != 1) ;
2936 outl(((ui_Configuration & 0x1E0FF) | 0x00002000),
2941 ui_Configuration = 0;
2951 12) >> 19) & 1) != 1) ;
2953 outl((ui_Configuration | 0x00080000),
2977 unsigned int dw_Dummy;
2992 dw_Dummy =
inl(
devpriv->i_IobaseAmcc + 0x38);
2993 outl(dw_Dummy | 0x2000,
devpriv->i_IobaseAmcc + 0x38);
2998 for (i_Temp = 0; i_Temp <= 95; i_Temp++) {
3005 for (i_Temp = 0; i_Temp <= 192;) {
3006 while (((
inl(
devpriv->iobase + i_Temp + 12) >> 19) & 1) != 1) ;
3008 i_Temp = i_Temp + 64;
3033 unsigned int ui_StatusRegister = 0;
3034 unsigned int ui_ChannelNumber = 0;
3035 int i_CalibrationFlag = 0;
3037 unsigned int ui_DummyValue = 0;
3038 unsigned int ui_DigitalTemperature = 0;
3039 unsigned int ui_DigitalInput = 0;
3040 int i_ConvertCJCCalibration;
3064 if ((ui_StatusRegister & 0x2) == 0x2) {
3071 12) & 0x00060000) >>
3089 if (i_CalibrationFlag == 0) {
3094 i_Count + 0] = ui_DigitalInput;
3110 (dev, &ui_DummyValue);
3116 if (i_CalibrationFlag == 1) {
3126 i_Count + 1] = ui_DigitalInput;
3138 if (i_CalibrationFlag == 2) {
3147 i_Count + 2] = ui_DigitalInput;
3149 if (s_BoardInfos[dev->
minor].
3153 s_BoardInfos[dev->
minor].
3158 s_BoardInfos[dev->
minor].
3166 s_BoardInfos[dev->
minor].
3170 if (s_BoardInfos[dev->
minor].
3176 if (s_BoardInfos[dev->
minor].
3201 if ((ui_StatusRegister & 0x2) == 0x2) {
3209 4) & 0x00000400) >> 10);
3217 12) & 0x00060000) >>
3237 ui_DigitalTemperature =
3245 if ((i_CalibrationFlag == 0)
3246 && (i_CJCFlag == 0)) {
3252 ui_DigitalTemperature;
3266 if ((i_CJCFlag == 1)
3267 && (i_CalibrationFlag == 0)) {
3273 ui_DigitalTemperature;
3279 (dev, &ui_DummyValue);
3286 if ((i_CalibrationFlag == 1)
3287 && (i_CJCFlag == 0)) {
3293 ui_DigitalTemperature;
3307 if ((i_CalibrationFlag == 2)
3308 && (i_CJCFlag == 0)) {
3314 ui_DigitalTemperature;
3323 if (s_BoardInfos[dev->
minor].
3325 s_BoardInfos[dev->
minor].
3327 i_ConvertCJCCalibration = 1;
3331 if (s_BoardInfos[dev->
minor].
3336 i_ConvertCJCCalibration
3340 i_ConvertCJCCalibration
3344 if (i_ConvertCJCCalibration == 1) {
3355 s_BoardInfos[dev->
minor].
3360 s_BoardInfos[dev->
minor].
3372 if ((i_CalibrationFlag == 1)
3373 && (i_CJCFlag == 1)) {
3379 ui_DigitalTemperature;
3393 if ((i_CalibrationFlag == 2)
3394 && (i_CJCFlag == 1)) {
3400 ui_DigitalTemperature;
3403 if (s_BoardInfos[dev->
minor].
3407 s_BoardInfos[dev->
minor].
3412 s_BoardInfos[dev->
minor].
3420 s_BoardInfos[dev->
minor].
3425 if (s_BoardInfos[dev->
minor].
3431 if (s_BoardInfos[dev->
minor].
3474 unsigned int ui_StatusRegister = 0;
3495 if ((ui_StatusRegister & 0x2) == 0x2) {
3503 s->
async->events = 0;
3576 (7 + 12) *
sizeof(
unsigned int));
3579 if (n > ((7 + 12) *
sizeof(
unsigned int))) {
3580 printk(
"\ncomedi_buf_write_alloc n = %i", n);
3586 ui_ScanValueArray, (7 + 12) *
sizeof(
unsigned int));
3590 (7 + 12) *
sizeof(
unsigned int));