Re: Hardware Abstraction



Rocky wrote:

Vladimir Vassilevsky wrote:

[%X]

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 following this with interest. I try to keep all references to the
hardware in one file or set of files so that even toggling pins becomes
a function call. If speed is needed then the entire function is taken
out of the main code and an API designed for it. While in some case
speed may suffer and then exceptions are made, in general the ease of
porting to different h/w is made much easier.

By their nature interrupt service routines are in this 'h/w' category.

If you find / develop a good 'standardised' concept that does not cause
total bloat it would be really great if you could share it here.

I am presuming that most of you already do abstraction of software functions
and I would have thought the same sort of thing would be applicable to
hardware also.

As one who leaves decisions of what is software and what is hardware until
quite a bit later in the project than most I have never seen any problem
with abstracting the functions in such a way that the decision on
hardware/software split can be delayed.

I know that the way I do it will not suit everyone out there. My HAL and SAL
are in Forth pseudo code. The function names are usually descriptive enough
to be able to select some of them from an archived library of functions.
One has to remember that none of it is finished code but just a way that,
with a little effort (mostly completing the coding work), can lead to
testing of design decisions before any scrap of hardware is available. It
is akin to building a hardware simulator under the application software.

--
********************************************************************
Paul E. Bennett ....................<email://peb@xxxxxxxxxxxxxxxxxx>
Forth based HIDECS Consultancy .....<http://www.amleth.demon.co.uk/>
Mob: +44 (0)7811-639972
Tel: +44 (0)1235-811095
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************
.



Relevant Pages

  • Re: Havent done anything real with OOP yet.
    ... But it is an algorithm description and, ... simulation needs. ... hardware to/from the network port. ... driving the abstraction of a rather specialized chunk of hardware. ...
    (comp.object)
  • Re: [OT] ALSA userspace API complexity
    ... So API might look a bit complicated for the first glance, but the ALSA interface code for simple applications is not so big, isn't? ... Wny applications myst know anything about hardware layer? ... Why we have X servers in user space then? ... All abstraction are NOW coded but some parts of this abstraction are on library level and you are wrong because this still ONE abstraction ...
    (Linux-Kernel)
  • Re: Hardware Abstraction
    ... hardware abstraction, and while LED's and motors are hardware in a ... hardware abstraction is generally about the ... peripherals used to control these devices. ... a bit-banged I2C bus driver doesn't care about ...
    (comp.arch.embedded)
  • Re: hardware geeks and software geeks
    ... I can certainly confirm that the hardware guys use levels ... of abstraction as much as the software guys do. ... the ramp voltage is zero. ... The ON-TIME value equating to the speed demand can be ...
    (comp.lang.forth)
  • Re: hardware geeks and software geeks
    ... > months back that included the hardware geeks vs software geeks threads? ... > C or fine tuned for Linux as abstraction. ...
    (comp.lang.forth)