可以参考一下这篇文章https://blog.csdn.net/wangyijieonline/article/details/77146112
此外,ST官方有个sensortile kit开发板,这上面有个LSM6传感器,可以去找这个板子的示例代码