![]() | Embedded software consultancy specializing in ARM Powered systems | Home | Site Map | Clients | Contact |
Firmware Design | ||||
| ||||
Device DriversCodeSprite encourages strict isolation of software that accesses hardware from the application software. To simplify the implementation details slightly, typically device drivers written by CodeSprite contain two layers, the lowest layer performs all the finicky timing details and accesses into hardware registers. The upper layer performs the translation from the data and activities required by the hardware into a form more useful for the application programmer. As an example, a simple UART allows single characters to be written to and read from a port, with some small amount of FIFO buffering. The Service layer of a CodeSprite device driver would provide a second layer of buffering, and allow data packets and character strings to be sent and received over the UART. The point of all this is to make the application code as generic as possible, such that the actual source or destination of any data is irrelevant to the application. This allows maximum code reuse, means that the application can largely be written and debugged in the absence of final product hardware, and ensures that the minimum of code is affected by changes in underlying hardware. |