12 #ifndef SOURCE_CHIP_STM32_PERIPHERALS_SPIV1_INCLUDE_DISTORTOS_CHIP_SPIMASTERLOWLEVELINTERRUPTBASED_HPP_ 13 #define SOURCE_CHIP_STM32_PERIPHERALS_SPIV1_INCLUDE_DISTORTOS_CHIP_SPIMASTERLOWLEVELINTERRUPTBASED_HPP_ 82 uint32_t dummyData)
override;
100 int start()
override;
122 void startTransfer(devices::SpiMasterBase& spiMasterBase,
const void* writeBuffer,
void* readBuffer,
123 size_t size)
override;
134 void stop()
override;
197 #endif // SOURCE_CHIP_STM32_PERIPHERALS_SPIV1_INCLUDE_DISTORTOS_CHIP_SPIMASTERLOWLEVELINTERRUPTBASED_HPP_ Definition: SpiMasterBase.hpp:28
bool started_
true if driver is started, false otherwise
Definition: SpiMasterLowLevelInterruptBased.hpp:187
volatile size_t size_
size of transfer (size of readBuffer_ and/or writeBuffer_), bytes
Definition: SpiMasterLowLevelInterruptBased.hpp:175
bool isStarted() const
Definition: SpiMasterLowLevelInterruptBased.hpp:142
SpiMasterLowLevel class header.
bool isTransferInProgress() const
Definition: SpiMasterLowLevelInterruptBased.hpp:151
int start() override
Starts low-level SPI master driver.
Definition: STM32-SPIv1-SpiMasterLowLevelInterruptBased.cpp:84
void startTransfer(devices::SpiMasterBase &spiMasterBase, const void *writeBuffer, void *readBuffer, size_t size) override
Starts asynchronous transfer.
Definition: STM32-SPIv1-SpiMasterLowLevelInterruptBased.cpp:96
volatile size_t writePosition_
current position in writeBuffer_
Definition: SpiMasterLowLevelInterruptBased.hpp:181
SpiMode
Definition: SpiMode.hpp:29
constexpr SpiMasterLowLevelInterruptBased(const SpiPeripheral &spiPeripheral)
SpiMasterLowLevelInterruptBased's constructor.
Definition: SpiMasterLowLevelInterruptBased.hpp:43
void interruptHandler()
Interrupt handler.
Definition: STM32-SPIv1-SpiMasterLowLevelInterruptBased.cpp:47
Definition: SpiMasterLowLevel.hpp:33
const SpiPeripheral & spiPeripheral_
reference to raw SPI peripheral
Definition: SpiMasterLowLevelInterruptBased.hpp:163
SpiPeripheral class is a raw SPI peripheral for SPIv1 in STM32.
Definition: STM32-SPIv1-SpiPeripheral.hpp:24
Top-level namespace of distortos project.
Definition: buttons.hpp:33
volatile size_t readPosition_
current position in readBuffer_
Definition: SpiMasterLowLevelInterruptBased.hpp:178
uint16_t dummyData_
dummy data that will be sent if write buffer of transfer is nullptr
Definition: SpiMasterLowLevelInterruptBased.hpp:184
uint8_t wordLength_
selected word length, bits, {8, 16}
Definition: SpiMasterLowLevelInterruptBased.hpp:190
void stop() override
Stops low-level SPI master driver.
Definition: STM32-SPIv1-SpiMasterLowLevelInterruptBased.cpp:114
~SpiMasterLowLevelInterruptBased() override
SpiMasterLowLevelInterruptBased's destructor.
Definition: STM32-SPIv1-SpiMasterLowLevelInterruptBased.cpp:31
void configure(devices::SpiMode mode, uint32_t clockFrequency, uint8_t wordLength, bool lsbFirst, uint32_t dummyData) override
Configures parameters of low-level SPI master driver.
Definition: STM32-SPIv1-SpiMasterLowLevelInterruptBased.cpp:36
void writeNextItem()
Writes next item to SPI peripheral.
Definition: STM32-SPIv1-SpiMasterLowLevelInterruptBased.cpp:129
Definition: SpiMasterLowLevelInterruptBased.hpp:33
devices::SpiMasterBase *volatile spiMasterBase_
pointer to SpiMasterBase object associated with this one
Definition: SpiMasterLowLevelInterruptBased.hpp:166
uint8_t *volatile readBuffer_
buffer to which the data is being written, nullptr to ignore received data
Definition: SpiMasterLowLevelInterruptBased.hpp:169
const uint8_t *volatile writeBuffer_
buffer with data that is being transmitted, nullptr to send dummy data
Definition: SpiMasterLowLevelInterruptBased.hpp:172