All Forums
 Hardware
 General Hardware, ADSmartIO, Digital I/O and A/Ds
 ADSmartIO: reading value of DDR
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

bearmos

0 Posts

Posted - 03 Oct 2006 :  14:47:03  Show Profile
Hello,

I'm trying to create a wrapper for ADSmartIO. The general idea is to provide command line access to individual bits. One of the challenges I've run into is not overwriting the DDR settings for a particular port.

I've read through topic 471 (and a few others) and understand that to setup a port I need something similar to
"ioctl(fd, SMARTIO_PORT_CONFIG, &config);" (or make a call to the appropriate SIOInitDDRX() function)

Is there a way to read a particular port's current direction settings? The goal is to be able to change a particular bit's direction without disturbing the rest of the bits on that port.

Thanks,
Brian Amos

jlackey

213 Posts

Posted - 03 Oct 2006 :  16:06:53  Show Profile  Email Poster
Hi Brian,

It looks like you have a good understanding of how to make the IOCTL calls. Unfortunately, there is no way to read the current direction settings for a given port.

If it were me, rather than make an additional wrapper, I would modifiy the library in Topic 471 to remember the direction settings for each port. Then I would add functions to set and clear the direction bits for a given port by applying a mask to the saved settings.
Go to Top of Page

bearmos

0 Posts

Posted - 03 Oct 2006 :  16:57:28  Show Profile
Thanks a lot for the quick reply. I hadn't even thought of simply adding functionality to the current library, but I like it.

Thanks again,
Brian
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000