iRiser Getting Started
A SANBlaze iRiser provides precise, timed control of PCIe and power signals on a drive slot.
Concepts
Bits
Bits are the lowest level of control. Each bit has a name, direction (input or output), and value.
Use get_bits() to read the current GPIO state.
Actions
An action defines a GPIO direction/value pair, a hold time, and the next action number.
Program actions with edit_action() or
add_transition().
Each action contains:
- Direction
Hex representation of pin directions. Outputs are
0; inputs are1.- Value
Hex representation of pin values.
- Time delay
How long to hold the current direction and value before advancing (for example
50msor1s).- Next action
The next action index, or
stopto end the sequence.
Sequences
A sequence runs a chain of actions starting at a configured first action.
Start execution with start_sequence(), then call
wait_for_stopped() to block until the sequencer finishes.
Creating a Riser object
Supply the iRiser slot number when constructing the object. Valid slots are 0–18 on rackmount (RM) systems and 0–4 on desktop (DT) systems.
from sanblaze import riser
slot = 1
device = riser.Riser(slot)
result = device.init()
Pass check_hardware=True to call _is_supported()
during construction and skip when no iRiser is present on the slot.
Import riser from sanblaze (recommended) or from sanblaze.system.iRiser.
Immediate signal control (set and clear)
For a single GPIO change with no timing or sequencer, use set()
and clear(). These map directly to the iRiser CLI
set and clear commands. Signal names are sent to the CLI in uppercase; use the same names
returned by get_bits().
To read GPIO state, use get_bits() (there is no
separate get() method on Riser).
from sanblaze import riser
r = riser.Riser(0)
r.clear('12VEDSF')
r.set('12VEDSF')
r.clear('12VEDSF')
Each call returns a status dict. On success, result contains CLI output such as pin index,
direction ([In] / [Out]), and value:
{'status': 0, 'result': '210:[02][Out] 0', 'reason': ''}
{'status': 0, 'result': '210:[02][In] 1', 'reason': ''}
Use Examples for a full console transcript. For timed or multi-step changes, use
sequences (add_transition() or
edit_action()) instead of repeated set/clear calls.
Programming models
High-level API
Use create_sequence(), add_transition(),
and start_sequence() for straightforward signal toggles.
Pass final=True on the last add_transition call so the sequence stops cleanly.
See Examples for examples.
create_sequence(start) sets the first action index used by subsequent add_transition calls.
It does not configure the iRiser sequence table on the device; it tracks state in Python only.
Low-level API
Use get_bits(), set_dir(),
toggle_bit(), and edit_action()
when you need full control over direction masks, individual bit toggles, or precise action chains.
Set output pins (such as perst0l) to direction 'O' before driving them.
Mark the final action with _next='stop', or pass final=True to the last
add_transition() call.
See Examples for a PERST/refclk example based on the reference-clock removal scripts.
Reading GPIO state
Most get_* methods return a status dictionary. Pass raw=True to receive the underlying object
instead of a wrapper dict.
from sanblaze import riser
device = riser.Riser(1)
device.init()
# Status dictionary with one entry per signal name
gpio = device.get_bits()
print(gpio['perst0l'])
# Bits object with aggregated dir/val hex strings
bits = device.get_bits(raw=True)
print(bits.dir)
print(bits.val)
# List signal names on this slot
for bit in bits.bits:
print(bit.name, bit.dir, bit.val)
Other useful queries:
device.get_status() # sequencer state, current action/sequence
device.get_actions() # programmed actions
device.get_sequences() # sequence definitions
device.get_state() # 'stopped' or 'running'
Typical workflow
device.init()— reset GPIO and sequencer memory.Program actions (high-level
add_transitionor low-leveledit_action).device.start_sequence(n)— run sequence n.device.wait_for_stopped()— wait for the sequencer to finish.
For additional examples, see Examples, iRiser Signal Reference, iRiser Power Measurement, and iRiser FAQ.