Skip to content

Group sstep_defs

Modules > sstep_defs

Constants shared by the public API. More...

Public Types

Type Name
enum sstep_state
Driver state.
enum sstep_topology
Power stage topology.

Macros

Type Name
define SSTEP_ERR_CONFIG (-2)
Configuration is consistent field by field but not as a whole (for example rated current above the power stage limit).
define SSTEP_ERR_PARAM (-1)
NULL pointer or a value outside its documented range.
define SSTEP_ERR_STATE (-3)
Call not allowed in the current state (for example a move while faulted).
define SSTEP_ERR_UNSUPPORTED (-4)
Topology not compiled in (see SSTEP_CFG_TOPOLOGY_FULL_BRIDGE ).
define SSTEP_FAULT_EXTERNAL 0x0010U
Reported by the application through sstep_report_fault() (driver fault pin, over-temperature...).
define SSTEP_FAULT_HAL 0x0008U
A hardware callback returned an error.
define SSTEP_FAULT_NONE 0x0000U
Fault flags reported by sstep_get_status() and the fault callback.
define SSTEP_FAULT_OVERCURRENT 0x0001U
Measured phase current above the configured trip level.
define SSTEP_FAULT_OVERVOLTAGE 0x0002U
Bus voltage above the configured maximum.
define SSTEP_FAULT_STALL 0x0020U
The rotor does not follow the commanded electrical angle: lost synchronism in motion, or rotor motion while the command is at rest (sensorless back-EMF observer, enabled with sstep_ctrl_cfg::stall_time_ms ).
define SSTEP_FAULT_UNDERVOLTAGE 0x0004U
Bus voltage below the configured minimum.
define SSTEP_LEGS_MAX 4U
Number of half-bridge legs of the largest supported topology.
define SSTEP_OK 0
Success.

Detailed Description

Units. Configuration values are integers in engineering units (milliohm, microhenry, milliampere, millivolt, hertz, nanosecond) so that sstep_init() needs no floating point with the fixed point backend. The unit is part of every field name (r_mohm, l_uh...). Positions are in microsteps, velocities in microsteps per second.

Sign convention. A positive phase voltage drives a positive phase current; positive velocity increases the position. Phase A leads phase B by 90 electrical degrees for positive motion.

Public Types Documentation

enum sstep_state

Driver state.

enum sstep_state {
    SSTEP_STATE_DISABLED = 0,
    SSTEP_STATE_HOLDING = 1,
    SSTEP_STATE_MOVING = 2,
    SSTEP_STATE_FAULT = 3
};


enum sstep_topology

Power stage topology.

enum sstep_topology {
    SSTEP_TOPOLOGY_FULL_BRIDGE = 0,
    SSTEP_TOPOLOGY_SHARED_LEG = 1
};


Macro Definition Documentation

define SSTEP_ERR_CONFIG

Configuration is consistent field by field but not as a whole (for example rated current above the power stage limit).

#define SSTEP_ERR_CONFIG `(-2)`


define SSTEP_ERR_PARAM

NULL pointer or a value outside its documented range.

#define SSTEP_ERR_PARAM `(-1)`


define SSTEP_ERR_STATE

Call not allowed in the current state (for example a move while faulted).

#define SSTEP_ERR_STATE `(-3)`


define SSTEP_ERR_UNSUPPORTED

Topology not compiled in (see SSTEP_CFG_TOPOLOGY_FULL_BRIDGE ).

#define SSTEP_ERR_UNSUPPORTED `(-4)`


define SSTEP_FAULT_EXTERNAL

Reported by the application through sstep_report_fault() (driver fault pin, over-temperature...).

#define SSTEP_FAULT_EXTERNAL `0x0010U`


define SSTEP_FAULT_HAL

A hardware callback returned an error.

#define SSTEP_FAULT_HAL `0x0008U`


define SSTEP_FAULT_NONE

Fault flags reported by sstep_get_status() and the fault callback.

#define SSTEP_FAULT_NONE `0x0000U`

A fault switches the outputs off; sstep_clear_faults() re-arms the driver.


define SSTEP_FAULT_OVERCURRENT

Measured phase current above the configured trip level.

#define SSTEP_FAULT_OVERCURRENT `0x0001U`


define SSTEP_FAULT_OVERVOLTAGE

Bus voltage above the configured maximum.

#define SSTEP_FAULT_OVERVOLTAGE `0x0002U`


define SSTEP_FAULT_STALL

The rotor does not follow the commanded electrical angle: lost synchronism in motion, or rotor motion while the command is at rest (sensorless back-EMF observer, enabled with sstep_ctrl_cfg::stall_time_ms ).

#define SSTEP_FAULT_STALL `0x0020U`


define SSTEP_FAULT_UNDERVOLTAGE

Bus voltage below the configured minimum.

#define SSTEP_FAULT_UNDERVOLTAGE `0x0004U`


define SSTEP_LEGS_MAX

Number of half-bridge legs of the largest supported topology.

#define SSTEP_LEGS_MAX `4U`


define SSTEP_OK

Success.

#define SSTEP_OK `0`