AX10445 Module Series User
’
s Manual
Application
29
}
else {
oldch = getvect(intno);
setvect(intno,CH2_ISR);
}
/* set Interrupt Enable Register,only enable Receive Data Available
interrupt */
outportb(pa+IER,0x01);
/* set modem control register, only set OUT2 to enable interrupt */
outportb(pa+MCR,0x08);
/* unmask PC 8259 interrupt controller */
outportb(0x21, inportb(0x21)&mask);
enable();
}
/* send a byte */
void Write1_Com(int ch, unsigned char data)
{
unsigned pa;
/* select port */
if (ch=1) pa = CH1_PA;
else if (ch=2) pa = CH2_PA;
else return;
/* is 485 turn on send driver */
if (Is_RS485) outportb (pa+MCR,0x0a);
/* check Transmit Holding Register Empty, if ok then write data */
while ((inportb(pa+LSR) & 0x40) =0) ;
/* wait a moment if needed */
/* write data to Data Register */
outportb(pa,data);
/* is 485 turn off send driver */
while ((inportb(pa+LSR) & 0x40) == 0);
if (Is_RS485) outportb(pa+MCR,0x08);
/* wait for Transmit Holding Register Empty if needed then return
while ((inportb(pa+LSR) & 0x40) == 0) ; */
}
/* sned a string of data */
void Write_Com(int ch, char *data, int wlen)
{
Содержание AX10445 Series
Страница 1: ...AX10445 Series Isolated Dual Channel RS422 485 Interface Module User s Manual...
Страница 10: ...AX10445 Module Series User s Manual 4 This page does not contain any information...
Страница 20: ...AX10445 Module Series User s Manual Setting up the AX10445 14 This page does not contain any information...
Страница 41: ...AX10445 Module Series User s Manual Application 33 return 0 void Reset_Buf rear1 front1 rear2 front2 0...
Страница 46: ...AX10445 Module Series User s Manual 36 This page does not contain any information...
Страница 48: ...AX10445 Module Series User s Manual 38 This page does not contain any information...
Страница 50: ...AX10445 Module Series User s Manual 40 This page does not contain any information...
Страница 52: ...AX10445 Module Series User s Manual 42 This page does not contain any information...
Страница 54: ...AX10445 Module Series User s Manual 44 This page does not contain any information...
Страница 58: ...AX10445 Module Series User s Manual 48 This page does not contain any information...