Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedded device drivers development notes [closed]

I want to develop some HAL (Hardware Abstraction Layers) to use in PIC32 and some ARM.

Basically I want to make some code that's usually available on a OS, like generic pin access, communication libraries, device I/O, etc.

Could you advise me with good books/websites?

I'll start with one that I've found a few weeks ago: http://www.kalinskyassociates.com/OnLineLearning.html

Thanks

like image 745
rnunes Avatar asked Apr 16 '11 19:04

rnunes


2 Answers

You can try also looking at the OSEK interface documents. The standard does a good job of abstracting accesses to most commonly used peripherals. However, bear in mind that this is only a spec and you'd have to work out all implementation details.

like image 22
user648318 Avatar answered Oct 20 '22 20:10

user648318


Have you tried looking at some implementations?

  • eCos has a HAL, which has some documentation to go along with it.
  • eLua also has a HAL that has grown around it to support the platforms it runs on (ARM, AVR32, etc..), check the architecture information and the "Platform Interface" and "Generic Modules" menus. If you strip out the Lua, eLua is essentially a HAL.

There are likely other examples as well, but I'd recommend looking at living examples of cross-platform and non-cross-platform hardware APIs. Also, if/when you go and start putting together interfaces, make sure to examine individual platform peripheral implementations before nailing down the API. You will find that certain interaction models are commonly supported across many platforms, and others are very platform specific. If your API assumes functionality will always be available, it will be difficult to port to platforms that either have lacking or non-existent support for the functionality you want. Sometimes you may be able to work around this in software with simple solutions, other times you may find it is either impossible or horribly complicated to make behavior consistent across platforms.

like image 130
James Snyder Avatar answered Oct 20 '22 20:10

James Snyder