Skip to content

Analog outputs and digital I/O

These fragments run inside a connected asynchronous function after loading a compatible design. Signal numbers identify design signals, not physical connectors.

Analog outputs

Configure the output mapping, then enable the required group:

await device.A0.setup(signal=0, signal_range=[-1, 1], voltage_range=[-5, 5])
await device.enable_analog_outputs(
    A0_to_A3=True, A4_to_A7=False, A8_to_A11=False,
)

signal_range must match the design's AnalogOut block. voltage_range is the requested output range; the client selects the ±1.25 V or ±5 V range as appropriate. Use nonzero signal spans and values supported by your board.

Outputs are enabled in groups of four. Configure the relevant channels before enabling a group and check the connected equipment's voltage limits. Disable all groups with:

await device.enable_analog_outputs(False, False, False)

The API exposes A0–A11 for the reference design. This does not establish the number of analog outputs fitted to your hardware configuration. See the analog-output example.

Digital I/O

from noa.digital_io import PinMap, Voltage

await device.DB.setup(
    inputs=[PinMap(sig=0, bit=0, pin=31, v=Voltage.D3V3)],
    outputs=[PinMap(sig=1, bit=0, pin=16, v=Voltage.D3V3)],
)

This assumes the design provides digital input signal 0 and output signal 1. sig selects a design signal, bit selects one bit and pin is the client port pin index. Check the hardware connector mapping before wiring.

Each setup() call configures the whole port: include all mappings you want to retain. Unmapped pins are set to high impedance. Mapped pins in one bank must share direction and voltage.

Port Banks in the current NOA arch 1 client mapping
DA 0–3, 16–19; 4–7; 8–11; 12–15
DB 0–3, 16–19; 4–7, 20–23; 8–11, 24–27; 12–15, 28–31

Voltage choices are Voltage.D3V3 (the PinMap default) and Voltage.D5V0. Select the appropriate voltage for your board and external circuit.

The digital-I/O example specifies its required loopback wiring; it is not an unwired general-purpose test.