Driver for NXP accelerometer on I²C Bus


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.
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?



use the mainline iio driver:


Thanks Robert,

I will try to implement that driver.