09-01-2010 09:31 AM
I am trying to import / convert an old c code to LabWindows CVI. I am not sure wether the inportb and outportb function are supported. The error I get is "Missing Prototype".
Here is the sample code. below.
/************************************************************************=
**********
* Name: Enable_Receive_Interrupts_COMM1
* Function: Sets the 8250 and 8259 registers to receive data
*************************************************************************=
**********/
void Enable_Receive_Interrupts_COMM1(void)
{
unsigned char tempbyte;
tempbyte = inportb(LSR_1);
tempbyte = inportb(INTCL); /* 8259 interupt mask register */
tempbyte =tempbyte & 0xef;
outportb(INTCL,tempbyte);
tempbyte = inportb(LCR_1);
outportb(LCR_1,(tempbyte & 0x7F));
tempbyte = inportb(LCR_1); /* 8250 line control register */
tempbyte = tempbyte & 0x7f;
outportb(LCR_1, tempbyte);
outportb(IER_1,0x01); /* 8250 interrupt enable register */
outportb(MCR_1,0x08); /* 8250 modem control register */
outportb(MSR_1,0x80); /* 8250 modem status register */
outportb(0x20,0x20); /* 8259 interupt control register */
tempbyte = inportb(MSR_1);
tempbyte = inportb(DATAPORT_1);
tempbyte = inportb(DATAPORT_1);
}
Thanks all
09-01-2010 09:51 AM
Hi,
the reason for your error is that the functions inportb() outportb() are not standard C library functions.
However there are similar low level functions in CVI, they are called inp and outp, an example for their use can be found here