A hardware peripheral is similar to any other shared resource. When there is a single resource with multiple tasks that need access to the resource, some sort of arbitration needs to be created to guarantee orderly access to the resource across tasks. In the previous chapter, we focused on different ways of developing low-level peripheral drivers. Some guidance as to driver selection was provided and it was suggested that the appropriate interface the driver provides should be based on how the driver was to be used in the system (Chapter 10, Drivers and ISR's, under the section entitled Choosing a driver model).
There are many different examples of sharing peripherals in real-world applications. Communication peripherals such as SPI, I2C,...