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.

I find that when abstracting hardware, like any other abstraction,
it is useful and important to separate the construction/initialization
and mode selection from the abstract interface that is used during
most of the application life cycle.

To use a GPIO pin as an example, a bit-banging application can
generally perform two operations:

setHIGH()
setLOW()

The initialization, that selects mutiplexed function routing,
direction, open-drain operation and other configuration belongs
to another interface that is most likely not abstract.

What if I need to dynamically change pin properties ? For instance,
bitbanging an I2C port may involve changing SDA/SCL from input to
output on some architectures.

What if 8 of those GPIO pins are available on the same port, and I need
to access them simultaneously, for instance to access an 8 bit
peripheral ?

What if precise timing is required, for instance bitbanging a UART
peripheral ?

Frankly, I don't see where providing an abstraction for a single GPIO
pin is going to make life easier. There are just too many variations in
hardware capabilities, and application requirements. Even if you could
design a model, it would probably be slow and bloated, and a much
bigger hassle than just accessing the hardware ports directly.

.



Relevant Pages

  • 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)
  • Hardware Abstraction
    ... 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. ... I am not very interested in the specifics of a particular OS or board, but in the good concepts and ideas. ...
    (comp.arch.embedded)
  • Re: Hardware Abstraction
    ... I am looking for a concept for abstracting of a hardware. ... a read-back of the register associated with the pin. ... Some GPIO implementations have one or the other and ...
    (comp.arch.embedded)
  • Re: Hardware Abstraction
    ... I am looking for a concept for abstracting of a hardware. ... tries to implement a serial protocol on serial hardware ... zero advantage. ...
    (comp.arch.embedded)