Re: Hardware Abstraction
- From: "Rocky" <robert@xxxxxxxxxxx>
- Date: 28 Nov 2006 04:53:14 -0800
Michael N. Moran wrote:
Vladimir Vassilevsky wrote:<snip>
Hello All,
I am looking for a concept for abstracting of a hardware. It is desired
that the concept should be convenient, clear, consistent, logical and
pretty universal.
IMHO, operations which are not available on a particular
piece of hardware should not appear in the abstraction
supported by that hardware. For example, a having the
ability to read the value of a GPIO at the pin or as
a read-back of the register associated with the pin.
Some GPIO implementations have one or the other and
some have both. Thus there are two possible operations:
bool readAtPin()
bool readPinRegister()
A GPIO implementation that supports only one of these
should not have the other available in its interface.
The result is there is no error condition if an application
calls an "unsupported" operation.
If the higher level s/w requires a readPinRegister would it not be
better to implement it for example by keeping a copy that is written to
RAM?
When using a PIC it is sometimes necessary to do this anyway to prevent
corruption of output pins that change slowly due to loading. One alway
does the BSF or BCF on the RAM copy and then writes that out to the
port.
Regards
Rocky
.
- References:
- Hardware Abstraction
- From: Vladimir Vassilevsky
- Re: Hardware Abstraction
- From: Michael N. Moran
- Hardware Abstraction
- Prev by Date: Re: interested in wombats
- Next by Date: Re: which object orient language is most suitable for embedded programming?
- Previous by thread: Re: Hardware Abstraction
- Next by thread: Re: Hardware Abstraction
- Index(es):
Relevant Pages
|