代码拉取完成,页面将自动刷新
/**
* @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 */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。