#define SUCCESS 1
/* variable type definition */
-typedef unsigned short USHORT, *PUSHORT;
typedef unsigned short WORD, *PWORD;
typedef int INT, *PINT;;
typedef unsigned int UINT, *PUINT;
#define LOBYTE(W) (unsigned char)((W) & 0xFF)
#define HIBYTE(W) (unsigned char)(((W) >> 8) & 0xFF)
-#define MAKEWORD(H, L) (USHORT)((L) | ((H) << 8))
-#define LOWORD(W) (USHORT)((W) & 0xFFFF)
-#define HIWORD(W) (USHORT)(((W) >> 16) & 0xFFFF)
+#define MAKEWORD(H, L) (unsigned short)((L) | ((H) << 8))
+#define LOWORD(W) (unsigned short)((W) & 0xFFFF)
+#define HIWORD(W) (unsigned short)(((W) >> 16) & 0xFFFF)
#define MAKEDWORD(H, L) (UINT)((L) | ((H) << 16))
#define ADDI_ENABLE 1
UINT ui_AiDataLength;
short *AiData; // Pointer to sample data
UINT ui_AiNbrofScans; // number of scans to do
- USHORT us_UseDma; // To use Dma or not
+ unsigned short us_UseDma; // To use Dma or not
unsigned char b_DmaDoubleBuffer; // we can use double buffering
UINT ui_DmaActualBuffer; // which buffer is used now
//*UPDATE-0.7.57->0.7.68
unsigned char b_AnalogOutputChannelNbr; // Analog input Output Nbr
unsigned char b_TimerSelectMode; // Contain data written at iobase + 0C
unsigned char b_ModeSelectRegister; // Contain data written at iobase + 0E
- USHORT us_OutputRegister; // Contain data written at iobase + 0
+ unsigned short us_OutputRegister; // Contain data written at iobase + 0
unsigned char b_InterruptState;
unsigned char b_TimerInit; // Specify if InitTimerWatchdog was load
unsigned char b_TimerStarted; // Specify if timer 2 is running or not
int i_APCI3120_InsnReadAnalogInput(struct comedi_device * dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data)
{
- USHORT us_ConvertTiming, us_TmpValue, i;
+ unsigned short us_ConvertTiming, us_TmpValue, i;
unsigned char b_Tmp;
// fix convertion time to 10 us
printk("No timer0 Value using 10 us\n");
us_ConvertTiming = 10;
} else
- us_ConvertTiming = (USHORT) (devpriv->ui_EocEosConversionTime / 1000); // nano to useconds
+ us_ConvertTiming = (unsigned short) (devpriv->ui_EocEosConversionTime / 1000); // nano to useconds
// this_board->i_hwdrv_InsnReadAnalogInput(dev,us_ConvertTiming,insn->n,&insn->chanspec,data,insn->unused[0]);
//to set in the timer
us_TmpValue =
- (USHORT) inw(devpriv->iobase + APCI3120_RD_STATUS);
+ (unsigned short) inw(devpriv->iobase + APCI3120_RD_STATUS);
//EL250804: Testing if board APCI3120 have the new Quartz or if it is an APCI3001
if ((us_TmpValue & 0x00B0) == 0x00B0
((us_ConvertTiming * 12926) / 10000) - 1;
}
- us_TmpValue = (USHORT) devpriv->b_InterruptMode;
+ us_TmpValue = (unsigned short) devpriv->b_InterruptMode;
switch (us_TmpValue) {
devpriv->iobase + APCI3120_TIMER_VALUE);
us_TmpValue =
- (USHORT) inw(dev->iobase + APCI3120_RD_STATUS);
+ (unsigned short) inw(dev->iobase + APCI3120_RD_STATUS);
if (devpriv->b_EocEosInterrupt == APCI3120_DISABLE) {
UINT ui_Tmp, ui_DelayTiming = 0, ui_TimerValue1 = 0, dmalen0 =
0, dmalen1 = 0, ui_TimerValue2 =
0, ui_TimerValue0, ui_ConvertTiming;
- USHORT us_TmpValue;
+ unsigned short us_TmpValue;
//BEGIN JK 07.05.04: Comparison between WIN32 and Linux driver
//devpriv->b_AiCyclicAcquisition=APCI3120_ENABLE;
devpriv->pui_AiChannelList, 0))
return -EINVAL;
- us_TmpValue = (USHORT) inw(dev->iobase + APCI3120_RD_STATUS);
+ us_TmpValue = (unsigned short) inw(dev->iobase + APCI3120_RD_STATUS);
/*** EL241003 : add this section in comment because floats must not be used
if((us_TmpValue & 0x00B0)==0x00B0)
{
APCI3120_SELECT_TIMER_0_WORD;
outb(b_Tmp, dev->iobase + APCI3120_TIMER_CRT0);
//Set the convertion time
- outw(((USHORT) ui_TimerValue0),
+ outw(((unsigned short) ui_TimerValue0),
dev->iobase + APCI3120_TIMER_VALUE);
break;
APCI3120_SELECT_TIMER_1_WORD;
outb(b_Tmp, dev->iobase + APCI3120_TIMER_CRT0);
//Set the convertion time
- outw(((USHORT) ui_TimerValue1),
+ outw(((unsigned short) ui_TimerValue1),
dev->iobase + APCI3120_TIMER_VALUE);
// init timer0 in mode 2
outb(b_Tmp, dev->iobase + APCI3120_TIMER_CRT0);
//Set the convertion time
- outw(((USHORT) ui_TimerValue0),
+ outw(((unsigned short) ui_TimerValue0),
dev->iobase + APCI3120_TIMER_VALUE);
break;
void v_APCI3120_Interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
- USHORT int_daq;
+ unsigned short int_daq;
unsigned int int_amcc, ui_Check, i;
- USHORT us_TmpValue;
+ unsigned short us_TmpValue;
unsigned char b_DummyRead;
struct comedi_subdevice *s = dev->subdevices + 0;
{
UINT ui_Timervalue2;
- USHORT us_TmpValue;
+ unsigned short us_TmpValue;
unsigned char b_Tmp;
if (!data[1])
ui_Timervalue2 = data[1] / 1000; // convert nano seconds to u seconds
//this_board->i_hwdrv_InsnConfigTimer(dev, ui_Timervalue2,(unsigned char)data[0]);
- us_TmpValue = (USHORT) inw(devpriv->iobase + APCI3120_RD_STATUS);
+ us_TmpValue = (unsigned short) inw(devpriv->iobase + APCI3120_RD_STATUS);
//EL250804: Testing if board APCI3120 have the new Quartz or if it is an APCI3001
// and calculate the time value to set in the timer
{
UINT ui_Timervalue2 = 0;
- USHORT us_TmpValue;
+ unsigned short us_TmpValue;
unsigned char b_Tmp;
if ((devpriv->b_Timer2Mode != APCI3120_WATCHDOG)
}
// ui_Timervalue2=data[1]; // passed as argument
us_TmpValue =
- (USHORT) inw(devpriv->iobase + APCI3120_RD_STATUS);
+ (unsigned short) inw(devpriv->iobase + APCI3120_RD_STATUS);
//EL250804: Testing if board APCI3120 have the new Quartz or if it is an APCI3001
// and calculate the time value to set in the timer
struct comedi_insn * insn, unsigned int * data)
{
unsigned char b_Tmp;
- USHORT us_TmpValue, us_TmpValue_2, us_StatusValue;
+ unsigned short us_TmpValue, us_TmpValue_2, us_StatusValue;
if ((devpriv->b_Timer2Mode != APCI3120_WATCHDOG)
&& (devpriv->b_Timer2Mode != APCI3120_TIMER)) {
unsigned int *data)
{
UINT ui_Range, ui_Channel;
- USHORT us_TmpValue;
+ unsigned short us_TmpValue;
ui_Range = CR_RANGE(insn->chanspec);
ui_Channel = CR_CHAN(insn->chanspec);
do //Waiting of DA_READY BIT
{
us_TmpValue =
- ((USHORT) inw(devpriv->iobase +
+ ((unsigned short) inw(devpriv->iobase +
APCI3120_RD_STATUS)) & 0x0001;
} while (us_TmpValue != 0x0001);
if (ui_Channel <= 3)
// for channel 0-3 out at the register 1 (wrDac1-8)
// data[i] typecasted to ushort since word write is to be done
- outw((USHORT) data[0],
+ outw((unsigned short) data[0],
devpriv->iobase + APCI3120_ANALOG_OUTPUT_1);
else
// for channel 4-7 out at the register 2 (wrDac5-8)
//data[i] typecasted to ushort since word write is to be done
- outw((USHORT) data[0],
+ outw((unsigned short) data[0],
devpriv->iobase + APCI3120_ANALOG_OUTPUT_2);
return insn->n;