UP Task,Argpase
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
//
|
||||
// Created by lydxh on 2024/4/8.
|
||||
//
|
||||
|
||||
#ifndef HW_LIB_SPI_H
|
||||
#define HW_LIB_SPI_H
|
||||
#ifndef SW_LIB_SPI_H
|
||||
#define SW_LIB_SPI_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define HIGH 1
|
||||
#define LOW 0
|
||||
#define NOP() ;
|
||||
#define NOP() 0
|
||||
#define DELAY1US() NOP()
|
||||
|
||||
/**
|
||||
@@ -42,7 +38,7 @@ typedef struct {
|
||||
mode MODE; // SPI模式
|
||||
uint8_t CS; // CS引脚编号
|
||||
endian ENDIAN; // 数据端序
|
||||
} HW_Dev_Spi;
|
||||
} SW_Dev_Spi;
|
||||
|
||||
/**
|
||||
* @brief 向 SPI 设备写入一个字节并读取返回的数据
|
||||
@@ -50,7 +46,7 @@ typedef struct {
|
||||
* @param Write_Date: [输入]要写入的数据
|
||||
* @return 读取到的数据
|
||||
**/
|
||||
uint8_t HW_SPI_RW(HW_Dev_Spi Dev, uint8_t Write_Date);
|
||||
uint8_t SW_SPI_RW(SW_Dev_Spi Dev, uint8_t Write_Date);
|
||||
|
||||
/**
|
||||
* @brief 向 SPI 设备写入数据流
|
||||
@@ -59,7 +55,7 @@ uint8_t HW_SPI_RW(HW_Dev_Spi Dev, uint8_t Write_Date);
|
||||
* @param Len: [输入] 数据流长度
|
||||
* @return void
|
||||
**/
|
||||
void HW_SPI_WL(HW_Dev_Spi Dev, uint8_t *Write_Date, uint32_t Len);
|
||||
void SW_SPI_WL(SW_Dev_Spi Dev, uint8_t *Write_Date, uint32_t Len);
|
||||
|
||||
/**
|
||||
* @brief 从 SPI 设备读取数据流
|
||||
@@ -68,7 +64,7 @@ void HW_SPI_WL(HW_Dev_Spi Dev, uint8_t *Write_Date, uint32_t Len);
|
||||
* @param Len: [输入] 读取数据流长度
|
||||
* @return void
|
||||
**/
|
||||
void HW_SPI_RL(HW_Dev_Spi Dev, uint8_t *Read_Date, uint32_t Len);
|
||||
void SW_SPI_RL(SW_Dev_Spi Dev, uint8_t *Read_Date, uint32_t Len);
|
||||
|
||||
/**
|
||||
* @brief 向 SPI 设备写入数据并读取返回数据流
|
||||
@@ -78,7 +74,7 @@ void HW_SPI_RL(HW_Dev_Spi Dev, uint8_t *Read_Date, uint32_t Len);
|
||||
* @param Len: [输入] 数据流长度
|
||||
* @return void
|
||||
**/
|
||||
void HW_SPI_RWL(HW_Dev_Spi Dev, uint8_t *Read_Date, uint8_t *Write_Date, uint32_t Len);
|
||||
void SW_SPI_RWL(SW_Dev_Spi Dev, uint8_t *Read_Date, uint8_t *Write_Date, uint32_t Len);
|
||||
|
||||
/**
|
||||
* @brief 向 SPI 设备写入一个字(16位)并读取返回的数据
|
||||
@@ -86,7 +82,7 @@ void HW_SPI_RWL(HW_Dev_Spi Dev, uint8_t *Read_Date, uint8_t *Write_Date, uint32_
|
||||
* @param Write_Date: [输入]要写入的数据
|
||||
* @return 读取到的数据
|
||||
**/
|
||||
uint16_t HW_SPI_RW16(HW_Dev_Spi Dev, uint16_t Write_Date);
|
||||
uint16_t SW_SPI_RW16(SW_Dev_Spi Dev, uint16_t Write_Date);
|
||||
|
||||
/**
|
||||
* @brief 从 SPI 设备读取数据流(16位)
|
||||
@@ -95,7 +91,7 @@ uint16_t HW_SPI_RW16(HW_Dev_Spi Dev, uint16_t Write_Date);
|
||||
* @param Len: [输入] 读取数据流长度
|
||||
* @return void
|
||||
**/
|
||||
void HW_SPI_RL16(HW_Dev_Spi Dev, uint16_t *Read_Date, uint32_t Len);
|
||||
void SW_SPI_RL16(SW_Dev_Spi Dev, uint16_t *Read_Date, uint32_t Len);
|
||||
|
||||
/**
|
||||
* @brief 向 SPI 设备写入数据流(16位)
|
||||
@@ -104,7 +100,7 @@ void HW_SPI_RL16(HW_Dev_Spi Dev, uint16_t *Read_Date, uint32_t Len);
|
||||
* @param Len: [输入] 数据流长度
|
||||
* @return void
|
||||
**/
|
||||
void HW_SPI_WL16(HW_Dev_Spi Dev, uint16_t *Write_Date, uint32_t Len);
|
||||
void SW_SPI_WL16(SW_Dev_Spi Dev, uint16_t *Write_Date, uint32_t Len);
|
||||
|
||||
/**
|
||||
* @brief 向 SPI 设备写入数据并读取返回数据流(16位)
|
||||
@@ -114,6 +110,6 @@ void HW_SPI_WL16(HW_Dev_Spi Dev, uint16_t *Write_Date, uint32_t Len);
|
||||
* @param Len: [输入] 数据流长度
|
||||
* @return void
|
||||
**/
|
||||
void HW_SPI_RWL16(HW_Dev_Spi Dev, uint16_t *Read_Date, uint16_t *Write_Date, uint32_t Len);
|
||||
void SW_SPI_RWL16(SW_Dev_Spi Dev, uint16_t *Read_Date, uint16_t *Write_Date, uint32_t Len);
|
||||
|
||||
#endif //HW_LIB_SPI_H
|
||||
#endif //SW_LIB_SPI_H
|
||||
|
Reference in New Issue
Block a user