The 64-byte configuration memory of the bootloader, as 16 little-endian 32-bit words.
More...
#include <tmc9660_bootconfig.hpp>
|
|
constexpr | BootConfig () noexcept=default |
| | All zero. A configuration for the chip comes from BlReadConfig(), not from here.
|
| |
| constexpr | BootConfig (const std::array< uint32_t, kWords > &words) noexcept |
| | A configuration from 16 raw words (for example read from the chip).
|
| |
| constexpr Error | Set (BootField field, uint32_t value) noexcept |
| | Set a field.
|
| |
| constexpr uint32_t | Get (BootField field) const noexcept |
| | The value of a field.
|
| |
| constexpr uint32_t | Word (std::size_t index) const noexcept |
| | One raw word.
|
| |
| constexpr Error | SetWord (std::size_t index, uint32_t value) noexcept |
| | Replace one raw word.
|
| |
| constexpr const std::array< uint32_t, kWords > & | Words () const noexcept |
| |
| constexpr Error | CheckStart () const noexcept |
| | Check the rules that make a configuration unsafe to apply: the application must not start with a reserved BOOT_MODE, the motor-control clock must be 40 MHz and the device address odd when it starts.
|
| |
|
| static constexpr uint32_t | MaxOf (BootField field) noexcept |
| | The largest value a field holds.
|
| |
|
|
static constexpr std::size_t | kBytes = 64 |
| | Size of the configuration memory in bytes.
|
| |
|
static constexpr std::size_t | kWords = 16 |
| | Number of 32-bit words.
|
| |
The 64-byte configuration memory of the bootloader, as 16 little-endian 32-bit words.
Plain data: no I/O. Read it with TMC9660::BlReadConfig(), change fields, write it with TMC9660::BlWriteConfig().
◆ BootConfig()
| constexpr tmc9660::BootConfig::BootConfig |
( |
const std::array< uint32_t, kWords > & |
words | ) |
|
|
inlineexplicitconstexprnoexcept |
A configuration from 16 raw words (for example read from the chip).
- Parameters
-
| words | The words, little endian per the manual's byte layout. |
◆ CheckStart()
| constexpr Error tmc9660::BootConfig::CheckStart |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Check the rules that make a configuration unsafe to apply: the application must not start with a reserved BOOT_MODE, the motor-control clock must be 40 MHz and the device address odd when it starts.
- Returns
Error::Ok, or Error::Refused.
◆ Get()
| constexpr uint32_t tmc9660::BootConfig::Get |
( |
BootField |
field | ) |
const |
|
inlineconstexprnoexcept |
The value of a field.
- Parameters
-
- Returns
- The value; 0 for a value that is not a
BootField.
◆ MaxOf()
| static constexpr uint32_t tmc9660::BootConfig::MaxOf |
( |
BootField |
field | ) |
|
|
inlinestaticconstexprnoexcept |
The largest value a field holds.
- Parameters
-
- Returns
2^width - 1; 0 for a value that is not a BootField.
◆ Set()
| constexpr Error tmc9660::BootConfig::Set |
( |
BootField |
field, |
|
|
uint32_t |
value |
|
) |
| |
|
inlineconstexprnoexcept |
Set a field.
- Parameters
-
| field | Which field. |
| value | The new value; at most 2^width - 1. |
- Returns
Error::InvalidArgument (nothing changed) when field is not a field or value does not fit.
◆ SetWord()
| constexpr Error tmc9660::BootConfig::SetWord |
( |
std::size_t |
index, |
|
|
uint32_t |
value |
|
) |
| |
|
inlineconstexprnoexcept |
Replace one raw word.
- Parameters
-
| index | The word, 0 to 15. |
| value | The new word. |
- Returns
Ok, or InvalidArgument beyond the end.
◆ Word()
| constexpr uint32_t tmc9660::BootConfig::Word |
( |
std::size_t |
index | ) |
const |
|
inlineconstexprnoexcept |
One raw word.
- Parameters
-
- Returns
- The word as stored; 0 beyond the end.
◆ Words()
| constexpr const std::array< uint32_t, kWords > & tmc9660::BootConfig::Words |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ operator==
Equality of all words.
- Parameters
-
| lhs | One configuration. |
| rhs | The configuration to compare with. |
- Returns
- true when every word is equal.
The documentation for this class was generated from the following file: