Embedded device drivers development notes [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this questionI 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 wit开发者_Go百科h good books/websites?
I'll start with one that I've found a few weeks ago: http://www.kalinskyassociates.com/OnLineLearning.html
Thanks
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.
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.
精彩评论