Re: Hardware Abstraction




Michael N. Moran wrote:
Vladimir Vassilevsky wrote:
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.
<snip>
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

.



Relevant Pages

  • Re: Hardware Abstraction
    ... I am looking for a concept for abstracting of a hardware. ... and mode selection from the abstract interface that is used during ... To use a GPIO pin as an example, ... Some GPIO implementations have one or the other and ...
    (comp.arch.embedded)
  • Re: Hardware Abstraction
    ... supported by that hardware. ... a read-back of the register associated with the pin. ... Some GPIO implementations have one or the other and ... any significant hardware abstraction. ...
    (comp.arch.embedded)
  • Re: remote access solution with mobile phone / SMS-based authentication?
    ... Password, PIN and Hardware. ... > dial-up internet accounts with dynamic ip) the ability to access our ... > corporate LAN. ...
    (comp.security.misc)
  • Re: Hardware Abstraction
    ... I am looking for a concept for abstracting of a hardware. ... to another interface that is most likely not abstract. ... I have been abstracting whole uart routine to the hardware file. ...
    (comp.arch.embedded)
  • Re: Hardware Abstraction
    ... I am looking for a concept for abstracting of a hardware. ... To use a GPIO pin as an example, ... What if 8 of those GPIO pins are available on the same port, ...
    (comp.arch.embedded)