Re: Hardware Abstraction
- From: "Paul E. Bennett" <peb@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 19:19:04 +0000
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..
********************************************************************
.
- References:
- Hardware Abstraction
- From: Vladimir Vassilevsky
- Re: Hardware Abstraction
- From: Rocky
- Hardware Abstraction
- Prev by Date: NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- Next by Date: Re: NewQ: Difference between an isr and a subroutine is that an isr has no arguments
- Previous by thread: Re: Hardware Abstraction
- Next by thread: Re: Hardware Abstraction
- Index(es):
Relevant Pages
|