Does anyone know where I can find some simple-minded QNX-based sample code
demonstrating simple read/write access on a PC104 stack? Any card will do
(I/O, ADC, Motor controller…).
Thanks in advance.
djw
Does anyone know where I can find some simple-minded QNX-based sample code
demonstrating simple read/write access on a PC104 stack? Any card will do
(I/O, ADC, Motor controller…).
Thanks in advance.
djw
David,
This is how I do it in my system. Device has 16 consecutive ports starting
at 300h
#include <sys/mman.h>
#include <hw/inout.h>
#include <sys/neutrino.h>
void main()
{
…
mmap_device_io(16, 0x300); // # consecutive bytes, starting address
ThreadCtl(_NTO_TCTL_IO, 0); // allow thread to call in*, out*, etc…
…
// can now do port I/O. i.e. in8, in16, out8, etc…
unsigned char ucImage = in8(0x300);
…
}
Same type of mechanism for physical memory, except you use
mmap_device_memory().
John
“David Wilson” <dwilson@ZymeQuest.com> wrote in message
news:aa1dh0$pb2$1@inn.qnx.com…
Does anyone know where I can find some simple-minded QNX-based sample code
demonstrating simple read/write access on a PC104 stack? Any card will do
(I/O, ADC, Motor controller…).Thanks in advance.
djw
“David Wilson” <dwilson@ZymeQuest.com> wrote in message
news:aa1dh0$pb2$1@inn.qnx.com…
Does anyone know where I can find some simple-minded QNX-based sample code
demonstrating simple read/write access on a PC104 stack? Any card will do
(I/O, ADC, Motor controller…).Thanks in advance.
Just to add: afaiu PC/104 stack is an odrinary ISA bus so you can access I/O
space with inp()/outp() instructions as usually for ISA.
// wbr
Thanks for the replies guys. Very helpful.
djw
“David Wilson” <dwilson@ZymeQuest.com> wrote in message
news:aa1dh0$pb2$1@inn.qnx.com…
Does anyone know where I can find some simple-minded QNX-based sample code
demonstrating simple read/write access on a PC104 stack? Any card will do
(I/O, ADC, Motor controller…).Thanks in advance.
djw