1 Star 0 Fork 0

NEO/ADIS16505

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
platform_specific_impl.h 2.34 KB
一键复制 编辑 原始数据 按行查看 历史
/**
* @file platform_specific_impl.h
* @brief Header file for platform-specific implementations of the ADIS16505 driver.
*
* This header file contains declarations for functions and types that are specific to
* different hardware platforms and required for porting the ADIS16505 driver.
* It allows for conditional compilation and inclusion of the appropriate platform-specific code.
*
* @note Developers should modify this file and the corresponding source file to adapt the driver
* to their specific hardware platform.
*
* @author Neo
* @date March, 2024
* @version V1.0
*/
#ifndef __PLATFORM_SPECIFIC_IMPL_H
#define __PLATFORM_SPECIFIC_IMPL_H
/* Platform define */
#define PLATFORM_STM32_USE_HAL
// #define PLATFORM_LINUX_USE_MRAA
// #define SPI_ADIS16505_DATASIZE_8BIT
#define ADIS16505_USE_HARDWARE_RST
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef PLATFORM_STM32_USE_HAL
#include "main.h"
#define CS_ADIS16505_GPIO_PORT ADIS_CS_GPIO_Port
#define CS_ADIS16505_PIN ADIS_CS_Pin
#define SPI_ADIS16505_HANDLE hspi5 // SPI_HandleTypeDef
#define DLY_US_TIM_HANDLE htim11 // TIM_HandleTypeDef
// Optional
#define RSTn_ADIS16505_GPIO_PORT ADIS_RSTn_GPIO_Port
#define RSTn_ADIS16505_PIN ADIS_RSTn_Pin
// CS (use MACRO for frequent invocations)
#define ADIS16505_Select() HAL_GPIO_WritePin(CS_ADIS16505_GPIO_PORT, CS_ADIS16505_PIN, GPIO_PIN_RESET)
#define ADIS16505_Deselect() HAL_GPIO_WritePin(CS_ADIS16505_GPIO_PORT, CS_ADIS16505_PIN, GPIO_PIN_SET)
#elif defined PLATFORM_LINUX_USE_MRAA
#define CS_ADIS16505 cs_gpio // mraa_spi_context
#define SPI_ADIS16505 spi // mraa_spi_context
// Optional
#define RSTn_ADIS16505 rstn_gpio // mraa_gpio_context
// CS (use MACRO for frequent invocations)
#define ADIS16505_Select() mraa_gpio_write(CS_ADIS16505, 0)
#define ADIS16505_Deselect() mraa_gpio_write(CS_ADIS16505, 1)
#endif /* PLATFORM MACRO */
/* Declaration of functions. */
void delay_ms(uint32_t nms);
void delay_us(uint16_t nus);
uint8_t SPI_ADIS16505_WR_Word(const uint16_t word, uint16_t* pRxData);
uint8_t SPI_ADIS16505_WR_Words(const uint16_t* pTxData, uint16_t* pRxData, uint16_t num);
#ifdef ADIS16505_USE_HARDWARE_RST
void ADIS16505_HardwareReset();
#endif /* ADIS16505_USE_HARDWARE_RST */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __PLATFORM_SPECIFIC_IMPL_H */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qCwCp/ADIS16505.git
git@gitee.com:qCwCp/ADIS16505.git
qCwCp
ADIS16505
ADIS16505
main

搜索帮助