As I continue using the 1-Wire stuff I am trying to develop a more
general purpose library of functions to include in a project.· This means that
I need to be able to turn "tristate" on & off for a single bit without knowing·how the
other·ports bits are configured.
I have not seen a way to read the port config registers, or set/clear bits on them...
In the past I have kept a global "image" variable for the config registers, tweak that
value, then write it to the config register, but I would prefer to avoid the global image thing.
One thing that would make this possible is to create a library of port interface routines that would
keep a "private" image that only they would use.··Any part of the program that needs to mess
with the ports·would have to use the library routines...
What I may end up doing is keeping one 1-Wire bit set as an output, and simply wiring
a reverse-bias diode in series with the port pin to prevent it from driving the bus high,
and reading the 1-Wire bus with a separate port bit that is always set as an input.
However I would then have a 2-wire system, not 1.
Any ideas will be appreciated!