Group sstep_config¶
Macros that select the code compiled into the library. More...
Macros¶
| Type | Name |
|---|---|
| define | SSTEP_CFG_ARG_CHECKS 11: every public function validates its pointer arguments (MISRA Dir 4.11). |
| define | SSTEP_CFG_MATH_BACKEND [**SSTEP\_MATH\_BACKEND\_FIXED**](group__sstep__config.md#define-sstep_math_backend_fixed)Selected numeric backend: SSTEP_MATH_BACKEND_FIXED orSSTEP_MATH_BACKEND_FLOAT . |
| define | SSTEP_CFG_MICROSTEPS_MAX 256ULargest microstep division accepted by sstep_init() (power of two, 1..256). |
| define | SSTEP_CFG_SINE_TABLE_BITS 8Ulog2 of the number of entries of the quarter-wave sine table (6..10). |
| define | SSTEP_CFG_TOPOLOGY_FULL_BRIDGE 11: compile support for two full H-bridges (4 half-bridge legs). |
| define | SSTEP_CFG_TOPOLOGY_SHARED_LEG 11: compile support for three half-bridges with a common leg (3 legs), for example STMicroelectronics B-G431B-ESC1. |
| define | SSTEP_MATH_BACKEND_FIXED 0Fixed point backend: Q15 signals, Q31 accumulators, integer-only arithmetic. |
| define | SSTEP_MATH_BACKEND_FLOAT 1Single-precision float backend. |
Detailed Description¶
Every macro has a default and may be overridden in one of two ways:
* on the compiler command line (-DSSTEP_CFG_MATH_BACKEND=SSTEP_MATH_BACKEND_FLOAT), or
* in a user header sstep_user_config.h, included when the macro SSTEP_USER_CONFIG is defined (CMake: set SSTEP_CONFIG_DIR to its folder).
Values that cannot change at run time (code size, table sizes, which code paths exist) live here. Motor and board parameters are run-time values passed to sstep_init().
Macro Definition Documentation¶
define SSTEP_CFG_ARG_CHECKS¶
1: every public function validates its pointer arguments (MISRA Dir 4.11).
0 removes the checks from sstep_fast_loop() only, the function called from the PWM interrupt; all other functions always check.
define SSTEP_CFG_MATH_BACKEND¶
Selected numeric backend: SSTEP_MATH_BACKEND_FIXED orSSTEP_MATH_BACKEND_FLOAT .
define SSTEP_CFG_MICROSTEPS_MAX¶
Largest microstep division accepted by sstep_init() (power of two, 1..256).
define SSTEP_CFG_SINE_TABLE_BITS¶
log2 of the number of entries of the quarter-wave sine table (6..10).
The table is static const (flash): 2^bits + 1 entries of 2 bytes (fixed) or 4 bytes (float). Values between entries are linearly interpolated.
define SSTEP_CFG_TOPOLOGY_FULL_BRIDGE¶
1: compile support for two full H-bridges (4 half-bridge legs).
define SSTEP_CFG_TOPOLOGY_SHARED_LEG¶
1: compile support for three half-bridges with a common leg (3 legs), for example STMicroelectronics B-G431B-ESC1.
define SSTEP_MATH_BACKEND_FIXED¶
Fixed point backend: Q15 signals, Q31 accumulators, integer-only arithmetic.
For MCUs without an FPU (Cortex-M0/M0+/M3, RISC-V RV32IMC, 8/16-bit cores).
define SSTEP_MATH_BACKEND_FLOAT¶
Single-precision float backend.
For MCUs with a hardware FPU (Cortex-M4F/M7/M33 with FPU, STM32G4, ESP32-S3...).