Hello,
I hope all is great with you.
Such functions are used as a reference. To read and write data using the I2C module, you need to create your own functions or use a driver.
In this case, I would like to recommend the examples below as a reference for your design. The source code is attached.
FXLS8471Q - Accelerometer orientation detection function example code
MMA8451Q - Bare metal example project
Please note that the MMA8451Q accelerometer is obsolete. You may consider it for further designs.
Regards,
David