distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
distortos::chip::ChipSpiMasterLowLevel::Parameters Class Reference

parameters for construction of SPI master low-level drivers More...

Public Member Functions

constexpr Parameters (const uintptr_t spiBase, const uintptr_t rccEnBbAddress, const uintptr_t rccRstBbAddress)
 Parameters's constructor. More...
 
void enableErrInterrupt (const bool enable) const
 Enables or disables ERR interrupt of SPI. More...
 
void enablePeripheral (const bool enable) const
 Enables or disables peripheral in SPI_CR1. More...
 
void enablePeripheralClock (const bool enable) const
 Enables or disables peripheral clock in RCC. More...
 
void enableRxneInterrupt (const bool enable) const
 Enables or disables RXNE interrupt of SPI. More...
 
void enableTxeInterrupt (const bool enable) const
 Enables or disables TXE interrupt of SPI. More...
 
uint32_t getPeripheralFrequency () const
 
SPI_TypeDef & getSpi () const
 
uint8_t getWordLength () const
 
void resetPeripheral () const
 Resets all peripheral's registers via RCC. More...
 

Private Attributes

uintptr_t spiBase_
 base address of SPI peripheral More...
 
uint32_t peripheralFrequency_
 peripheral clock frequency, Hz More...
 
uintptr_t speBbAddress_
 address of bitband alias of SPE bit in SPI_CR1 register More...
 
uintptr_t errieBbAddress_
 address of bitband alias of ERRIE bit in SPI_CR2 register More...
 
uintptr_t rxneieBbAddress_
 address of bitband alias of RXNEIE bit in SPI_CR2 register More...
 
uintptr_t txeieBbAddress_
 address of bitband alias of TXEIE bit in SPI_CR2 register More...
 
uintptr_t rccEnBbAddress_
 address of bitband alias of appropriate SPIxEN bit in RCC register More...
 
uintptr_t rccRstBbAddress_
 address of bitband alias of appropriate SPIxRST bit in RCC register More...
 

Detailed Description

parameters for construction of SPI master low-level drivers

Constructor & Destructor Documentation

◆ Parameters()

constexpr distortos::chip::ChipSpiMasterLowLevel::Parameters::Parameters ( const uintptr_t  spiBase,
const uintptr_t  rccEnBbAddress,
const uintptr_t  rccRstBbAddress 
)
inline

Parameters's constructor.

Parameters
[in]spiBaseis a base address of SPI peripheral
[in]rccEnBbAddressis an address of bitband alias of appropriate SPIxEN bit in RCC register
[in]rccRstBbAddressis an address of bitband alias of appropriate SPIxRST bit in RCC register
Here is the call graph for this function:

Member Function Documentation

◆ enableErrInterrupt()

void distortos::chip::ChipSpiMasterLowLevel::Parameters::enableErrInterrupt ( const bool  enable) const
inline

Enables or disables ERR interrupt of SPI.

Parameters
[in]enableselects whether the interrupt will be enabled (true) or disabled (false)
Here is the caller graph for this function:

◆ enablePeripheral()

void distortos::chip::ChipSpiMasterLowLevel::Parameters::enablePeripheral ( const bool  enable) const
inline

Enables or disables peripheral in SPI_CR1.

Parameters
[in]enableselects whether the peripheral will be enabled (true) or disabled (false)
Here is the caller graph for this function:

◆ enablePeripheralClock()

void distortos::chip::ChipSpiMasterLowLevel::Parameters::enablePeripheralClock ( const bool  enable) const
inline

Enables or disables peripheral clock in RCC.

Parameters
[in]enableselects whether the clock will be enabled (true) or disabled (false)
Here is the caller graph for this function:

◆ enableRxneInterrupt()

void distortos::chip::ChipSpiMasterLowLevel::Parameters::enableRxneInterrupt ( const bool  enable) const
inline

Enables or disables RXNE interrupt of SPI.

Parameters
[in]enableselects whether the interrupt will be enabled (true) or disabled (false)
Here is the caller graph for this function:

◆ enableTxeInterrupt()

void distortos::chip::ChipSpiMasterLowLevel::Parameters::enableTxeInterrupt ( const bool  enable) const
inline

Enables or disables TXE interrupt of SPI.

Parameters
[in]enableselects whether the interrupt will be enabled (true) or disabled (false)
Here is the caller graph for this function:

◆ getPeripheralFrequency()

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

◆ getSpi()

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

◆ getWordLength()

uint8_t distortos::chip::ChipSpiMasterLowLevel::Parameters::getWordLength ( ) const
inline
Returns
current word length, bits, {8, 16}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resetPeripheral()

void distortos::chip::ChipSpiMasterLowLevel::Parameters::resetPeripheral ( ) const
inline

Resets all peripheral's registers via RCC.

Note
Peripheral clock must be enabled in RCC for this operation to work.
Here is the caller graph for this function:

Member Data Documentation

◆ errieBbAddress_

uintptr_t distortos::chip::ChipSpiMasterLowLevel::Parameters::errieBbAddress_
private

address of bitband alias of ERRIE bit in SPI_CR2 register

◆ peripheralFrequency_

uint32_t distortos::chip::ChipSpiMasterLowLevel::Parameters::peripheralFrequency_
private

peripheral clock frequency, Hz

◆ rccEnBbAddress_

uintptr_t distortos::chip::ChipSpiMasterLowLevel::Parameters::rccEnBbAddress_
private

address of bitband alias of appropriate SPIxEN bit in RCC register

◆ rccRstBbAddress_

uintptr_t distortos::chip::ChipSpiMasterLowLevel::Parameters::rccRstBbAddress_
private

address of bitband alias of appropriate SPIxRST bit in RCC register

◆ rxneieBbAddress_

uintptr_t distortos::chip::ChipSpiMasterLowLevel::Parameters::rxneieBbAddress_
private

address of bitband alias of RXNEIE bit in SPI_CR2 register

◆ speBbAddress_

uintptr_t distortos::chip::ChipSpiMasterLowLevel::Parameters::speBbAddress_
private

address of bitband alias of SPE bit in SPI_CR1 register

◆ spiBase_

uintptr_t distortos::chip::ChipSpiMasterLowLevel::Parameters::spiBase_
private

base address of SPI peripheral

◆ txeieBbAddress_

uintptr_t distortos::chip::ChipSpiMasterLowLevel::Parameters::txeieBbAddress_
private

address of bitband alias of TXEIE bit in SPI_CR2 register


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