Notation
ℹ
In all pin names, j is the instance index (0–3) and i is the channel index (e.g. stepgen or encoder channel number). X is the GPIO pin number for digital I/O.
Type legend:
BIT
FLOAT
U32
S32
IN = HAL writes this pin OUT = module writes this pin
Global Pins (per instance)
| Pin name | Type | Dir | Description |
| module_name.j.connected | BIT | OUT | Connection status with hardware |
| module_name.j.period | U32 | IN | Period in nanoseconds |
| module_name.j.io-ready-in | BIT | IN | Input ready signal |
| module_name.j.io-ready-out | BIT | OUT | Output ready signal |
| module_name.j.stepgen.pulse-width | U32 | IN | Step pulse width in nanoseconds |
Stepgen Pins (per channel)
| Pin name | Type | Dir | Description |
| module_name.j.stepgen.i.command | FLOAT | IN | Command input (position or velocity) |
| module_name.j.stepgen.i.step-scale | FLOAT | IN | Steps per unit scaling |
| module_name.j.stepgen.i.feedback | FLOAT | OUT | Feedback position / velocity |
| module_name.j.stepgen.i.mode | BIT | IN | 0 = position mode, 1 = velocity mode |
| module_name.j.stepgen.i.enable | BIT | IN | Enable this channel |
Encoder Pins (per channel)
| Pin name | Type | Dir | Description |
| module_name.j.encoder.i.raw-count | S32 | IN | Raw encoder counts |
| module_name.j.encoder.i.scaled-count | S32 | OUT | Scaled encoder counts |
| module_name.j.encoder.i.scale | FLOAT | IN | Encoder scaling factor |
| module_name.j.encoder.i.position | FLOAT | OUT | Scaled position value |
| module_name.j.encoder.i.velocity | FLOAT | OUT | Scaled velocity value |
| module_name.j.encoder.i.index-enable | BIT | IN | Encoder index-enable |
Digital Input Pins
| Pin name | Type | Dir | Description |
| module_name.j.input.gpX | BIT | OUT | Digital input state (X = GPIO pin number) |
Digital Output Pins
Available when use_outputs=1:
| Pin name | Type | Dir | Description |
| module_name.j.output.gpX | BIT | IN | Digital output control (X = GPIO pin number) |
Spindle Pins
| Pin name | Type | Dir | Description |
| module_name.j.spindle.index-enabled | BIT | OUT | Spindle index pulse input |
PWM Pins
Available when use_pwm=1:
| Pin name | Type | Dir | Description |
| module_name.j.pwm.enable | BIT | IN | PWM enable |
| module_name.j.pwm.duty | U32 | IN | PWM duty cycle (min-limit to max-scale) |
| module_name.j.pwm.frequency | U32 | IN | PWM frequency (1907 – 1 000 000 Hz) |
| module_name.j.pwm.max-scale | U32 | IN | Maximum duty cycle scale |
| module_name.j.pwm.min-limit | U32 | IN | Minimum duty cycle output |
Debug Pins
Available when debug=1:
| Pin name | Type | Dir | Description |
| module_name.j.stepgen.max-freq-khz | FLOAT | OUT | Maximum step frequency (kHz) |
| module_name.j.stepgen.i.debug-steps | U32 | OUT | Step counter for debugging |
Functions (per instance)
| Function name | Description |
| module_name.j.watchdog-process | Watchdog timer function — add to servo-thread |
| module_name.j.process-send | UDP transmission function — add to servo-thread |
| module_name.j.process-recv | UDP reception function — add to servo-thread |
Example HAL wiring for functions
loadrt stepper-ninja ip_address="192.168.0.177:8888"
addf stepgen-ninja.0.watchdog-process servo-thread
addf stepgen-ninja.0.process-send servo-thread
addf stepgen-ninja.0.process-recv servo-thread
Configuration Parameters
| Parameter | Description |
| ip_address | Array of IP:port strings, e.g. "192.168.1.100:5000;192.168.1.101:5001" |
Notes
- Supports up to 4 stepgen and 4 encoder channels per instance.
- Multiple instances can be created with different IP:port pairs (max 4).
- Watchdog timeout is ~10 ms.
- All time values are in nanoseconds.
- Stepgen supports both position and velocity modes.
- PWM frequency range: 1907 Hz – 1 MHz.
- Digital I/O pins are configurable via
input_pins / output_pins arrays in config.h.