Author |
Topic |
|
bearmos
0 Posts |
Posted - 03 Oct 2006 : 14:47:03
|
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
|
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. |
|
|
bearmos
0 Posts |
Posted - 03 Oct 2006 : 16:57:28
|
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 |
|
|
|
Topic |
|
|
|