Driver for NXP accelerometer on I²C Bus

Hi,

I´m using a BBB, rev C, running debian 8 (4.4.54)

My goal is to write a little c/c++ programm that will log the data from an accelerometer (nxp mma8451). Since I am still a beginner with Embedded Linux and programming hardware I have some issues understanding what are the necessary steps for this.

My situation:

I got the sensor running on the I²C bus. All registers of the sensor are readable/writetable with i2c-tools.
But what are the next steps?
There is a Linux driver written in C available for the MMA8x5x series.
http://www.nxp.com/webapp/sps/download/license.jsp?colCode=MMA8X5X-DRVR
Readme file doesn´t really help me. How do I install that driver?
What I have to include into my programm then to use the functions of the driver?

Any hints?

Cheers

Max

use the mainline iio driver:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/drivers/iio/accel/mma8452.c?h=v4.9.36

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/Documentation/devicetree/bindings/iio/accel/mma8452.txt?h=v4.9.36

Regards,

Thanks Robert,

I will try to implement that driver.

Cheers