SpiPeripheral class is a raw SPI peripheral for SPIv1 in STM32.
More...
#include "distortos/chip/STM32-SPIv1-SpiPeripheral.hpp"
SpiPeripheral class is a raw SPI peripheral for SPIv1 in STM32.
◆ SpiPeripheral()
constexpr distortos::chip::SpiPeripheral::SpiPeripheral |
( |
const uintptr_t |
spiBase | ) |
|
|
inlineexplicit |
SpiPeripheral's constructor.
- Parameters
-
[in] | spiBase | is a base address of SPI peripheral |
◆ getDrAddress()
uintptr_t distortos::chip::SpiPeripheral::getDrAddress |
( |
| ) |
const |
|
inline |
- Returns
- address of DR register
◆ getPeripheralFrequency()
uint32_t distortos::chip::SpiPeripheral::getPeripheralFrequency |
( |
| ) |
const |
|
inline |
- Returns
- peripheral clock frequency, Hz
◆ getSpi()
SPI_TypeDef& distortos::chip::SpiPeripheral::getSpi |
( |
| ) |
const |
|
inlineprivate |
- Returns
- reference to SPI_TypeDef object
◆ readCr1()
uint32_t distortos::chip::SpiPeripheral::readCr1 |
( |
| ) |
const |
|
inline |
- Returns
- current value of CR1 register
◆ readCr2()
uint32_t distortos::chip::SpiPeripheral::readCr2 |
( |
| ) |
const |
|
inline |
- Returns
- current value of CR2 register
◆ readDr()
uint32_t distortos::chip::SpiPeripheral::readDr |
( |
| ) |
const |
|
inline |
- Returns
- current value of DR register
◆ readSr()
uint32_t distortos::chip::SpiPeripheral::readSr |
( |
| ) |
const |
|
inline |
- Returns
- current value of SR register
◆ writeCr1()
void distortos::chip::SpiPeripheral::writeCr1 |
( |
const uint32_t |
cr1 | ) |
const |
|
inline |
Writes value to CR1 register.
- Parameters
-
[in] | cr1 | is the value that will be written to CR1 register |
◆ writeCr2()
void distortos::chip::SpiPeripheral::writeCr2 |
( |
const uint32_t |
cr2 | ) |
const |
|
inline |
Writes value to CR2 register.
- Parameters
-
[in] | cr2 | is the value that will be written to CR2 register |
◆ writeDr()
void distortos::chip::SpiPeripheral::writeDr |
( |
const uint32_t |
dr | ) |
const |
|
inline |
Writes value to DR register.
- Parameters
-
[in] | dr | is the value that will be written to DR register |
◆ writeSr()
void distortos::chip::SpiPeripheral::writeSr |
( |
const uint32_t |
sr | ) |
const |
|
inline |
Writes value to SR register.
- Parameters
-
[in] | sr | is the value that will be written to SR register |
◆ 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: