首页 > 其他分享 >apoll4 读取ldm6dsrtr

apoll4 读取ldm6dsrtr

时间:2023-03-03 17:59:37浏览次数:32  
标签:apoll4 读取 write platform ldm6dsrtr GPIO uint32

6轴传感器数据读取,通过spi

ST官网下载传感器对应的C语言扩增库lsm6dsr_STdC 中间还把型号搞错了浪费了些时间

下载好之后只要修改两个接口即可

platform_read, platform_write,tx_com 打印   CS 要自己控制 static int32_t platform_write(void *handle, uint8_t reg, const uint8_t *bufp, uint16_t len) { am_hal_gpio_state_write(32, AM_HAL_GPIO_OUTPUT_CLEAR ); iom_spi_write(1, (uint32_t)reg, (uint32_t*) bufp, (uint32_t)len); am_hal_gpio_state_write(32, AM_HAL_GPIO_OUTPUT_SET ); return 0; }

标签:apoll4,读取,write,platform,ldm6dsrtr,GPIO,uint32
From: https://www.cnblogs.com/yinseyingji/p/15710978.html

相关文章