Hardware abstraction layers (HALs) are an important layer to every embedded software application. A HAL allows a developer to abstract or decouple the hardware details from the application code.
Take advantage of the inversion of control pattern to loosely couple the components of your application and make them easier to test and maintain. Both inversion of control and dependency injection ...