File sstep_ctrl.h¶
FileList > inc > sstep_ctrl.h
Go to the source code of this file
#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include "sstep_config.h"#include "sstep_defs.h"
Classes¶
| Type | Name |
|---|---|
| struct | sstep Driver instance. |
| struct | sstep_callbacks Hardware callbacks. |
| struct | sstep_config Complete configuration given to sstep_init() . |
| struct | sstep_ctrl_cfg Control and motion parameters. |
| struct | sstep_motor_cfg Motor parameters, from the datasheet or measured. |
| struct | sstep_sample Raw measurements of one fast loop period, as read from the ADC. |
| struct | sstep_stage_cfg Power stage and measurement parameters. |
| struct | sstep_status Snapshot returned by sstep_get_status() , in engineering units. |
Public Types¶
| Type | Name |
|---|---|
| enum | sstep_drive_mode How the phase voltages are obtained. |
| enum | sstep_event Events reported through sstep_event_fn. |
| typedef void(* | sstep_event_fn Notify the application of a motion event (optional). |
| typedef void(* | sstep_fault_fn Notify the application of new faults (optional). |
| typedef int(* | sstep_output_enable_fn Enable or disable the power stage outputs (disabled = all legs high impedance). |
| typedef int(* | sstep_pwm_write_fn Write the PWM compare values of all legs. |
Macros¶
| Type | Name |
|---|---|
| define | SSTEP_CONFIG_BYTES 152UBytes of the configuration copy at the start of the instance and of the private driver state that follows it, for 32-bit (Cortex-M) and 64-bit pointers. |
| define | SSTEP_INSTANCE_WORDS ((SSTEP\_CONFIG\_BYTES + SSTEP\_STATE\_BYTES + 7U) / 8U)Size of sstep in 64-bit words. |
| define | SSTEP_STATE_BYTES 280U |
Public Types Documentation¶
enum sstep_drive_mode¶
How the phase voltages are obtained.
enum sstep_event¶
Events reported through sstep_event_fn.
typedef sstep_event_fn¶
Notify the application of a motion event (optional).
Called from sstep_slow_loop().
Parameters:
contextsstep_callbacks::context.eventThe event.
typedef sstep_fault_fn¶
Notify the application of new faults (optional).
Called from the context that detected the fault, which may be sstep_fast_loop() (interrupt).
Parameters:
contextsstep_callbacks::context.faultsNewly raised SSTEP_FAULT_OVERCURRENT ... flags.
typedef sstep_output_enable_fn¶
Enable or disable the power stage outputs (disabled = all legs high impedance).
Parameters:
contextsstep_callbacks::context.enabletrue to enable the gate drivers, false to switch every leg off.
Return value:
0Success.<0Error, reported as SSTEP_FAULT_HAL.
typedef sstep_pwm_write_fn¶
Write the PWM compare values of all legs.
Called from sstep_fast_loop().
Parameters:
contextsstep_callbacks::context.compareOne compare value per leg, 0 ..pwm_period_ticks(0 = low-side on,pwm_period_ticks= high-side on). Entries above the leg count of the topology are 0. Valid only during the call.
Return value:
0Success.<0Error: the driver switches the outputs off with SSTEP_FAULT_HAL.
Macro Definition Documentation¶
define SSTEP_CONFIG_BYTES¶
Bytes of the configuration copy at the start of the instance and of the private driver state that follows it, for 32-bit (Cortex-M) and 64-bit pointers.
Plain constants, so that the instance size needs no sizeof (static analysis); sstep_ctrl.c checks both at compile time.
define SSTEP_INSTANCE_WORDS¶
Size of sstep in 64-bit words.
define SSTEP_STATE_BYTES¶
The documentation for this class was generated from the following file inc/sstep_ctrl.h