libxr 1.0
Want to be the best embedded framework
|
Public Member Functions | |
STM32SPI (SPI_HandleTypeDef *spi_handle, RawData dma_buff_rx, RawData dma_buff_tx, uint32_t dma_enable_min_size=3) | |
ErrorCode | ReadAndWrite (RawData read_data, ConstRawData write_data, OperationRW &op) override |
进行 SPI 读写操作。Performs SPI read and write operations. | |
ErrorCode | SetConfig (SPI::Configuration config) override |
设置 SPI 配置参数。Sets SPI configuration parameters. | |
ErrorCode | MemRead (uint16_t reg, RawData read_data, OperationRW &op) override |
从 SPI 设备的寄存器读取数据。 Reads data from a specific register of the SPI device. | |
ErrorCode | MemWrite (uint16_t reg, ConstRawData write_data, OperationRW &op) override |
向 SPI 设备的寄存器写入数据。 Writes data to a specific register of the SPI device. | |
![]() | |
SPI () | |
默认构造函数。Default constructor. | |
virtual ErrorCode | Read (RawData read_data, OperationRW &op) |
进行 SPI 读取操作。Performs SPI read operation. | |
virtual ErrorCode | Write (ConstRawData write_data, OperationRW &op) |
进行 SPI 写入操作。Performs SPI write operation. | |
Data Fields | |
RawData | dma_buff_rx_ |
RawData | dma_buff_tx_ |
SPI_HandleTypeDef * | spi_handle_ |
stm32_spi_id_t | id_ = STM32_SPI_ID_ERROR |
uint32_t | dma_enable_min_size_ = 3 |
OperationRW | rw_op_ |
RawData | read_buff_ |
bool | mem_read_ = false |
Static Public Attributes | |
static STM32SPI * | map [STM32_SPI_NUMBER] = {nullptr} |
Additional Inherited Members | |
![]() | |
enum class | ClockPolarity : uint8_t { LOW = 0 , HIGH = 1 } |
定义 SPI 时钟极性。Defines the SPI clock polarity. More... | |
enum class | ClockPhase : uint8_t { EDGE_1 = 0 , EDGE_2 = 1 } |
定义 SPI 时钟相位。Defines the SPI clock phase. More... | |
using | OperationRW = WriteOperation |
定义读写操作类型的别名。Defines an alias for the read/write operation type. | |
Definition at line 49 of file stm32_spi.hpp.
|
inline |
Definition at line 52 of file stm32_spi.hpp.
|
inlineoverridevirtual |
从 SPI 设备的寄存器读取数据。 Reads data from a specific register of the SPI device.
reg | 寄存器地址。Register address. |
read_data | 读取的数据缓冲区。Buffer to store read data. |
op | 操作类型(同步/异步)。Operation mode (sync/async). |
Implements LibXR::SPI.
Definition at line 145 of file stm32_spi.hpp.
|
inlineoverridevirtual |
向 SPI 设备的寄存器写入数据。 Writes data to a specific register of the SPI device.
reg | 寄存器地址。Register address. |
write_data | 写入的数据缓冲区。Buffer containing data to write. |
op | 操作类型(同步/异步)。Operation mode (sync/async). |
Implements LibXR::SPI.
Definition at line 205 of file stm32_spi.hpp.
|
inlineoverridevirtual |
进行 SPI 读写操作。Performs SPI read and write operations.
read_data | 存储读取数据的缓冲区。Buffer to store the read data. |
write_data | 需要写入的数据缓冲区。Buffer containing the data to be written. |
op | 读写操作类型。Type of read/write operation. |
Implements LibXR::SPI.
Definition at line 66 of file stm32_spi.hpp.
|
inlineoverridevirtual |
设置 SPI 配置参数。Sets SPI configuration parameters.
Implements LibXR::SPI.
Definition at line 120 of file stm32_spi.hpp.
RawData LibXR::STM32SPI::dma_buff_rx_ |
Definition at line 259 of file stm32_spi.hpp.
RawData LibXR::STM32SPI::dma_buff_tx_ |
Definition at line 259 of file stm32_spi.hpp.
uint32_t LibXR::STM32SPI::dma_enable_min_size_ = 3 |
Definition at line 265 of file stm32_spi.hpp.
stm32_spi_id_t LibXR::STM32SPI::id_ = STM32_SPI_ID_ERROR |
Definition at line 263 of file stm32_spi.hpp.
Definition at line 273 of file stm32_spi.hpp.
Definition at line 271 of file stm32_spi.hpp.
RawData LibXR::STM32SPI::read_buff_ |
Definition at line 269 of file stm32_spi.hpp.
OperationRW LibXR::STM32SPI::rw_op_ |
Definition at line 267 of file stm32_spi.hpp.
SPI_HandleTypeDef* LibXR::STM32SPI::spi_handle_ |
Definition at line 261 of file stm32_spi.hpp.