6#ifndef TMC9660_GLOBALS_HPP
7#define TMC9660_GLOBALS_HPP
56constexpr std::array<GlobalInfo, 55> MakeGlobals()
noexcept {
57 std::array<GlobalInfo, 55> t{};
59 const auto add = [&t, &n](uint8_t bank, uint16_t number,
Access access, int64_t lo, int64_t hi,
62 .
bank = bank, .number = number, .access = access, .min = lo, .max = hi, .odd_only = odd};
78 for (uint16_t i = 0U; i < 16U; ++i) {
81 for (uint16_t i = 0U; i < 3U; ++i) {
84 for (uint16_t i = 10U; i < 32U; ++i) {
93inline constexpr std::array<GlobalInfo, 55>
kGlobals = detail::MakeGlobals();
103 if ((g.bank == bank) && (g.number == number)) {
constexpr uint16_t IO_DIRECTION_MASK
GPIO direction mask.
Definition tmc9660_globals.hpp:40
constexpr uint16_t AUTO_START_ENABLE
Start the script after power-up.
Definition tmc9660_globals.hpp:49
constexpr uint16_t CLEAR_USER_VARIABLES
Clear the user variables at start-up.
Definition tmc9660_globals.hpp:50
constexpr uint16_t IO_INPUT_PULLUP_PULLDOWN_DIRECTION_MASK
Pull direction mask.
Definition tmc9660_globals.hpp:42
constexpr uint16_t WAKE_PIN_CONTROL_ENABLE
Enable the WAKE pin function.
Definition tmc9660_globals.hpp:43
constexpr uint16_t HEARTBEAT_MONITORING_TIMEOUT
Timeout in ms.
Definition tmc9660_globals.hpp:39
constexpr uint16_t VELOCITY_LOOPS
Read only: velocity loops per second.
Definition tmc9660_globals.hpp:48
constexpr uint16_t SERIAL_ADDRESS
Module address, odd values only.
Definition tmc9660_globals.hpp:36
constexpr uint16_t IO_INPUT_PULLUP_PULLDOWN_ENABLE_MASK
Pull resistor enable mask.
Definition tmc9660_globals.hpp:41
constexpr uint16_t TORQUE_LOOPS
Read only: torque loops per second.
Definition tmc9660_globals.hpp:47
constexpr uint16_t SERIAL_HOST_ADDRESS
Host address.
Definition tmc9660_globals.hpp:37
constexpr uint16_t GO_TO_TIMEOUT_POWER_DOWN_STATE
Write only: power down for 250 ms to 32 s.
Definition tmc9660_globals.hpp:44
constexpr uint16_t HEARTBEAT_MONITORING_CONFIG
0 off, 1 UART, 2 SPI, 3 both.
Definition tmc9660_globals.hpp:38
constexpr uint16_t MAIN_LOOPS
Read only: main loops per second.
Definition tmc9660_globals.hpp:46
The TMC9660 driver: everything it declares lives here; internals in detail.
Definition tmc9660.hpp:37
constexpr std::array< GlobalInfo, 55 > kGlobals
Tables 61 to 63, sorted by bank and number.
Definition tmc9660_globals.hpp:93
constexpr const GlobalInfo * FindGlobal(uint8_t bank, uint32_t number) noexcept
The row of a global parameter.
Definition tmc9660_globals.hpp:101
Access
Access class of a parameter (the R/W column of Table 57).
Definition tmc9660_params.hpp:19
@ ReadWriteStored
RWE: SAP and GAP, STAP stores it.
@ ReadWrite
RW: SAP and GAP, not stored by STAP.
GlobalBank
Banks of global parameters.
Definition tmc9660_globals.hpp:28
@ System
Bank 0: communication, I/O masks, heartbeat, power-down, auto start.
@ UserVars
Bank 2: 16 user variables of the scripting feature.
@ Interrupts
Bank 3: timers and trigger transitions.
One global parameter: its bank, number, access and range.
Definition tmc9660_globals.hpp:18
Access access
Access class.
Definition tmc9660_globals.hpp:21
int64_t min
Smallest value.
Definition tmc9660_globals.hpp:22
uint8_t bank
Bank 0 (system), 2 (user variables) or 3 (interrupt configuration).
Definition tmc9660_globals.hpp:19
int64_t max
Largest value.
Definition tmc9660_globals.hpp:23
uint16_t number
Parameter number in the bank.
Definition tmc9660_globals.hpp:20
bool odd_only
Only odd values are valid (SERIAL_ADDRESS).
Definition tmc9660_globals.hpp:24
The axis parameters of parameter mode (SAP, GAP, STAP, AAP): number, range, default and access of eve...