distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
distortos::chip::SpiPeripheral Class Reference

SpiPeripheral class is a raw SPI peripheral for SPIv1 in STM32. More...

#include "distortos/chip/STM32-SPIv1-SpiPeripheral.hpp"

Public Member Functions

constexpr SpiPeripheral (const uintptr_t spiBase)
 SpiPeripheral's constructor. More...
 
uintptr_t getDrAddress () const
 
uint32_t getPeripheralFrequency () const
 
uint32_t readCr1 () const
 
uint32_t readCr2 () const
 
uint32_t readDr () const
 
uint32_t readSr () const
 
void writeCr1 (const uint32_t cr1) const
 Writes value to CR1 register. More...
 
void writeCr2 (const uint32_t cr2) const
 Writes value to CR2 register. More...
 
void writeDr (const uint32_t dr) const
 Writes value to DR register. More...
 
void writeSr (const uint32_t sr) const
 Writes value to SR register. More...
 

Private Member Functions

SPI_TypeDef & getSpi () const
 

Private Attributes

uintptr_t spiBase_
 base address of SPI peripheral More...
 
uint32_t peripheralFrequency_
 peripheral clock frequency, Hz More...
 

Detailed Description

SpiPeripheral class is a raw SPI peripheral for SPIv1 in STM32.

Constructor & Destructor Documentation

◆ SpiPeripheral()

constexpr distortos::chip::SpiPeripheral::SpiPeripheral ( const uintptr_t  spiBase)
inlineexplicit

SpiPeripheral's constructor.

Parameters
[in]spiBaseis a base address of SPI peripheral

Member Function Documentation

◆ getDrAddress()

uintptr_t distortos::chip::SpiPeripheral::getDrAddress ( ) const
inline
Returns
address of DR register
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPeripheralFrequency()

uint32_t distortos::chip::SpiPeripheral::getPeripheralFrequency ( ) const
inline
Returns
peripheral clock frequency, Hz
Here is the caller graph for this function:

◆ getSpi()

SPI_TypeDef& distortos::chip::SpiPeripheral::getSpi ( ) const
inlineprivate
Returns
reference to SPI_TypeDef object
Here is the caller graph for this function:

◆ readCr1()

uint32_t distortos::chip::SpiPeripheral::readCr1 ( ) const
inline
Returns
current value of CR1 register
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readCr2()

uint32_t distortos::chip::SpiPeripheral::readCr2 ( ) const
inline
Returns
current value of CR2 register
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDr()

uint32_t distortos::chip::SpiPeripheral::readDr ( ) const
inline
Returns
current value of DR register
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readSr()

uint32_t distortos::chip::SpiPeripheral::readSr ( ) const
inline
Returns
current value of SR register
Here is the call graph for this function:

◆ writeCr1()

void distortos::chip::SpiPeripheral::writeCr1 ( const uint32_t  cr1) const
inline

Writes value to CR1 register.

Parameters
[in]cr1is the value that will be written to CR1 register
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeCr2()

void distortos::chip::SpiPeripheral::writeCr2 ( const uint32_t  cr2) const
inline

Writes value to CR2 register.

Parameters
[in]cr2is the value that will be written to CR2 register
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeDr()

void distortos::chip::SpiPeripheral::writeDr ( const uint32_t  dr) const
inline

Writes value to DR register.

Parameters
[in]dris the value that will be written to DR register
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeSr()

void distortos::chip::SpiPeripheral::writeSr ( const uint32_t  sr) const
inline

Writes value to SR register.

Parameters
[in]sris the value that will be written to SR register
Here is the call graph for this function:

Member Data Documentation

◆ peripheralFrequency_

uint32_t distortos::chip::SpiPeripheral::peripheralFrequency_
private

peripheral clock frequency, Hz

◆ spiBase_

uintptr_t distortos::chip::SpiPeripheral::spiBase_
private

base address of SPI peripheral


The documentation for this class was generated from the following file: