os/various/devices_lib is a leftover, replaced by ex, it will be removed soon.

About drivers:

Normal Drivers: HAL drivers meant to interact with application on the high side and HW on the low side. The API is standard.Platform Drivers: Generic drivers for platform-specific functionalities and use the HAL "style" but the API is custom.Complex Drivers: Anything that sits only on HAL and OSAL without touching RTOS and/or HW is classified as complex driver.Abstract Interfaces: C++/like interfaces, just written in C.

High level subsystems like graphic libraries, communication stacks or file systems can be classified as Complex Drivers.

This is an I2C devices so it is a complex driver interfacing to hal/src/hal_12c.c

In hal/lib/sensor/ I would make a hal_imu.h and I can use hal_sensors.h as a template to work from.

If I also had a mpu-9150 i would do the same for this similar device. I include my choice of device to use in my project makefile and don't have to touch the hal_imu assuming they support all the same features.