1 Star 0 Fork 0

寵蟲/ADIS16505

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

ADIS16505驱动

硬件连接

ADIS16505 MCU
CS* SS*
SCLK SCLK
DIN MOSI
DOUT MISO

注意:RST*引脚接高阻或拉高

SPI设置

See Theory of Operation -> SPI in datasheet for detail.

:exclamation::exclamation::exclamation: SPI初始化一定要正确

Processor Setting Description
Master SS*
SCLK ≤ 2MHz (≤ 1MHz for burst mode) Maximum serial clock rate
SPI Mode 3 CPOL=1 (polarity), CPHA=1 (phase)
MSB First Mode Bit sequence
8-Bit or 16-Bit Mode Shift register and data length

注意,ADIS默认应将SPI配置为16-Bit Mode,但本驱动库也兼容了8-Bit Mode,通过定义宏 ADIS16505_SPI_DataSize_8BIT来使用该模式。

移植说明

主要文件目录

/root  
├── docs/
│	└── adis16505.pdf
├── adis16505.c
├── adis16505.h
├── platform_specific_impl.c
├── platform_specific_impl.h
└── README.md

其中,adis16505.c & adis16505.h移植时不需要更改

platform_specific_impl.c & platform_specific_impl.h需要根据移植平台适配更改

需要实现的函数包括:

void delay_ms(uint32_t nms); // 毫秒延时
void delay_us(uint16_t nus); // 微秒延时
void ADIS16505_Select(); // 片选拉低
void ADIS16505_Deselect(); // 片选拉高
uint8_t SPI_ADIS16505_WR_Word(const uint16_t word, uint16_t* pRxData); // SPI全双工读写单字 (16bits)
uint8_t SPI_ADIS16505_WR_Words(const uint16_t* pTxData, uint16_t* pRxData, uint16_t num); // SPI全双工读写多字 (16bits)

通过定义宏(e.g.PLATFORM_STM32_USE_HAL)来进行平台管理,这里详见代码

使用该驱动库的方法为:

/* USER CODE BEGIN Includes */
#include "adis16505.h"
/* USER CODE END Includes */

/* USER CODE BEGIN PV */
ADIS16505 imu; // 定义结构体变量  
/* USER CODE END PV */

/* SYSTEM BEGIN Init */
// Clock_Init();
// GPIO_Init();
// SPI_Init();
// ...
/* SYSTEM END Init */

ADIS16505_Init(&imu); // 初始化IMU

/* USE IMU */
// e.g. ADIS16505_BurstRead(&imu);
The MIT License (MIT) Copyright (c) 2024 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

ADIS16505驱动 展开 收起
C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qCwCp/adis16505.git
git@gitee.com:qCwCp/adis16505.git
qCwCp
adis16505
ADIS16505
main

搜索帮助

344bd9b3 5694891 D2dac590 5694891