Appendix D Register-Level Programming
PC-DIO-96/PnP User Manual
D-20
©
National Instruments Corporation
/* EXAMPLE 1–port A output */
outp(cnfg,0xA0);
/* Port A is an output in mode 1.*/
while (!(inp(portc) & 0x80));
/* Wait until OBFA* is set,
indicating that the data last
written to port A has been
read.*/
outp(porta,0x12);
/* Write data to port A. */
/* EXAMPLE 2–port B output */
outp(cnfg,0x84);
/* Port B is an output in mode 1.*/
while (!(inp(portc) & 0x02));
/* Wait until OBFB* is set,
indicating that the data last
written to port B has been
read.*/
outp(portb,0x34);
/* Write the data to port B. */
}
Содержание PC-DIO-96/PnP
Страница 46: ......
Страница 47: ......
Страница 48: ......
Страница 49: ......
Страница 50: ......
Страница 51: ......
Страница 52: ......
Страница 53: ......
Страница 54: ......
Страница 55: ......
Страница 56: ......
Страница 57: ......
Страница 58: ......
Страница 59: ......
Страница 60: ......
Страница 61: ......
Страница 63: ......
Страница 64: ......
Страница 65: ......
Страница 66: ......
Страница 67: ......
Страница 68: ......
Страница 69: ......
Страница 70: ......
Страница 71: ......
Страница 72: ......
Страница 73: ......