how to program driver for 8255 mode 0

I have a 24-bit DIO card which provide 24 lines of parallel digital I/O
capability and can emulates mode 0 of an 8255 programable peripheral
interface chip.
Now I want to program driver with it in 8255 mode 0.
My question is
I named my driver as “/dev/pio24”
if I want to read or write A, B and C port of the card ,how could I
program in client port? use read ,and write or other functions?
and how could I program in server?

A resource manager may, I think, regester more than one name. It can also
register a name with subnames or unit numbers. I.E. One resource manager
manages /dev/ser1, /dev/ser2, etc.

The real problem, I think, is that you’ll need to ensure that two different
client tasks are not trying to use the device at the same time in two
different modes.


Bill Caroselli – 1(626) 824-7983
Q-TPS Consulting
QTPS@EarthLink.net


“zhz_zhang” <zhz_zhang@263.net> wrote in message
news:a426a0$nft$1@inn.qnx.com

I have a 24-bit DIO card which provide 24 lines of parallel digital I/O
capability and can emulates mode 0 of an 8255 programable peripheral
interface chip.
Now I want to program driver with it in 8255 mode 0.
My question is
I named my driver as “/dev/pio24”
if I want to read or write A, B and C port of the card ,how could I
program in client port? use read ,and write or other functions?
and how could I program in server?

As you say the I use resource manager register more than one name.
I define the card port A as “/dev/PIO24/A”,port B as “/dev/PIO24/B”…
I use
port_a=open("/dev/PIO24/A,IO_RDWR);
function in client,In resource manager ,how could I know that the client 's
open message 's
content is that he want to open A port ,not B or C.

In another words,
in the function:
int io_open (resmgr_context_t *ctp, io_open_t *msg,RESMGR_HANDLE_T
*handle, void *extra);
how could I know that client want to open A port,not B or C,and the same as
io_read(),and io_write();


“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:a43kkv$p3h$1@inn.qnx.com

A resource manager may, I think, regester more than one name. It can also
register a name with subnames or unit numbers. I.E. One resource manager
manages /dev/ser1, /dev/ser2, etc.

The real problem, I think, is that you’ll need to ensure that two
different
client tasks are not trying to use the device at the same time in two
different modes.


Bill Caroselli – 1(626) 824-7983
Q-TPS Consulting
QTPS@EarthLink.net


“zhz_zhang” <> zhz_zhang@263.net> > wrote in message
news:a426a0$nft$> 1@inn.qnx.com> …
I have a 24-bit DIO card which provide 24 lines of parallel digital I/O
capability and can emulates mode 0 of an 8255 programable peripheral
interface chip.
Now I want to program driver with it in 8255 mode 0.
My question is
I named my driver as “/dev/pio24”
if I want to read or write A, B and C port of the card ,how could I
program in client port? use read ,and write or other functions?
and how could I program in server?