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

parameters for construction of UART low-level drivers More...

Public Member Functions

constexpr Parameters (const uintptr_t uartBase, const uintptr_t rccEnBbAddress, const uintptr_t rccRstBbAddress)
 Parameters's constructor. 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 UART. More...
 
void enableTcInterrupt (const bool enable) const
 Enables or disables TC interrupt of UART. More...
 
void enableTxeInterrupt (const bool enable) const
 Enables or disables TXE interrupt of UART. More...
 
uint8_t getCharacterLength () const
 
uint32_t getPeripheralFrequency () const
 
USART_TypeDef & getUart () const
 
void resetPeripheral () const
 Resets all peripheral's registers via RCC. More...
 

Private Attributes

uintptr_t uartBase_
 base address of UART peripheral More...
 
uint32_t peripheralFrequency_
 peripheral clock frequency, Hz More...
 
uintptr_t rxneieBbAddress_
 address of bitband alias of RXNEIE bit in USART_CR1 register More...
 
uintptr_t tcieBbAddress_
 address of bitband alias of TCIE bit in USART_CR1 register More...
 
uintptr_t txeieBbAddress_
 address of bitband alias of TXEIE bit in USART_CR1 register More...
 
uintptr_t rccEnBbAddress_
 address of bitband alias of appropriate U[S]ARTxEN bit in RCC register More...
 
uintptr_t rccRstBbAddress_
 address of bitband alias of appropriate U[S]ARTxRST bit in RCC register More...
 

Detailed Description

parameters for construction of UART low-level drivers

Constructor & Destructor Documentation

◆ Parameters()

constexpr distortos::chip::ChipUartLowLevel::Parameters::Parameters ( const uintptr_t  uartBase,
const uintptr_t  rccEnBbAddress,
const uintptr_t  rccRstBbAddress 
)
inline

Parameters's constructor.

Parameters
[in]uartBaseis a base address of UART peripheral
[in]rccEnBbis an address of bitband alias of appropriate U[S]ARTxEN bit in RCC register
[in]rccRstBbis an address of bitband alias of appropriate U[S]ARTxRST bit in RCC register
Here is the call graph for this function:

Member Function Documentation

◆ enablePeripheralClock()

void distortos::chip::ChipUartLowLevel::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::ChipUartLowLevel::Parameters::enableRxneInterrupt ( const bool  enable) const
inline

Enables or disables RXNE interrupt of UART.

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

◆ enableTcInterrupt()

void distortos::chip::ChipUartLowLevel::Parameters::enableTcInterrupt ( const bool  enable) const
inline

Enables or disables TC interrupt of UART.

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::ChipUartLowLevel::Parameters::enableTxeInterrupt ( const bool  enable) const
inline

Enables or disables TXE interrupt of UART.

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

◆ getCharacterLength()

uint8_t distortos::chip::ChipUartLowLevel::Parameters::getCharacterLength ( ) const
inline
Returns
character length, bits
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPeripheralFrequency()

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

◆ getUart()

USART_TypeDef& distortos::chip::ChipUartLowLevel::Parameters::getUart ( ) const
inline
Returns
reference to USART_TypeDef object
Here is the caller graph for this function:

◆ resetPeripheral()

void distortos::chip::ChipUartLowLevel::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

◆ peripheralFrequency_

uint32_t distortos::chip::ChipUartLowLevel::Parameters::peripheralFrequency_
private

peripheral clock frequency, Hz

◆ rccEnBbAddress_

uintptr_t distortos::chip::ChipUartLowLevel::Parameters::rccEnBbAddress_
private

address of bitband alias of appropriate U[S]ARTxEN bit in RCC register

◆ rccRstBbAddress_

uintptr_t distortos::chip::ChipUartLowLevel::Parameters::rccRstBbAddress_
private

address of bitband alias of appropriate U[S]ARTxRST bit in RCC register

◆ rxneieBbAddress_

uintptr_t distortos::chip::ChipUartLowLevel::Parameters::rxneieBbAddress_
private

address of bitband alias of RXNEIE bit in USART_CR1 register

◆ tcieBbAddress_

uintptr_t distortos::chip::ChipUartLowLevel::Parameters::tcieBbAddress_
private

address of bitband alias of TCIE bit in USART_CR1 register

◆ txeieBbAddress_

uintptr_t distortos::chip::ChipUartLowLevel::Parameters::txeieBbAddress_
private

address of bitband alias of TXEIE bit in USART_CR1 register

◆ uartBase_

uintptr_t distortos::chip::ChipUartLowLevel::Parameters::uartBase_
private

base address of UART peripheral


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