Because nothing is better than an example, you will find below a typical implementation of an application program (Myapp.c) for STM32 as well as an example of a low-level driver (Driver i2c.c). Both of these programs are independent from the hardware and embed their own documentation. Enjoy!
DRIVERS AND PROTOCOLS’ PORTAGES vs HARDWARE PLATFORM
The following table represents the legacy of all the drivers and protocols previously developed as part of hardware platforms already on the market. Each of these porting is documented and will be soon available online. This list is not exhaustive of drivers developed in the context of non-commercial prototypes.