Skip to content

API Reference

Drivers for the NOA hardware and IPs are implemented using a subclass of Pynq's Overlay class (NoaOverlay) in a pre-installed noa python module.

See the Boost Converter jupyter notebook for a complete usage example.

Classes:

Name Description
NoaOverlay

Subclass of the pynq.Overlay class that implements drivers for NOA IPs and hardware

AnalogChannel

Analog output channel configuration. Instantiated by the NoaOverlay.

DAQ

Driver for the NOA DAQ IP. Instantiated by the NoaOverlay when a DAQ IP is present in the bitstream.

Scale

Analog output voltage scale.

Voltage

Digital Voltage Level

Direction

Digital IO Direction

TriggerKind

DAQ Trigger Kind

NoaOverlay

Bases: Overlay

Subclass of the pynq.Overlay class that implements drivers for NOA IPs and hardware

Attributes:

Name Type Description
A(0..11) AnalogChannel

Analog output channel configuration

Methods:

Name Description
__init__

Load specified bitstream file and initialize NoaOverlay instance

enable_analog_outputs

Enables all or some analog output modules

setup_digital_module

Configure a digital IO module with specified parameters.

__init__(bitfile, ip_names=None, log=None, **kwargs)

Load specified bitstream file and initialize NoaOverlay instance

Parameters:

Name Type Description Default
bitfile str

Path to bitstream file. Expects a matching .hwh file in the same directory

required
log Logger | None

Overwrite logger instance

None
ip_names dict[str, str] | None

Overwrite the names of IPs used by NoaOverlay drivers

None
kwargs

Keyword arguments are supplied to the Overlay init function

{}

enable_analog_outputs(A0_to_A3=True, A4_to_A7=True, A8_to_A11=True)

Enables all or some analog output modules

Parameters:

Name Type Description Default
A0_to_A3 bool

Enables analog outputs A0..A3 when True, disables them when False

True
A4_to_A7 bool

Enables analog outputs A4..A7 when True, disables them when False

True
A8_to_A11 bool

Enables analog outputs A8..A11 when True, disables them when False

True

setup_digital_module(addr, direction=None, voltage=None, enable=True)

Configure a digital IO module with specified parameters.

Parameters:

Name Type Description Default
addr Addr

Module to configure (e.g. Digital0)

required
direction Direction | List[Direction] | None

IO direction (e.g. Direction.OUTPUT)

None
voltage Voltage | None

IO voltage level (e.g. Voltage.D3V3)

None
enable bool

Set to False to disable the module.

True

Raises:

Type Description
ValueError

If the module is not found or if arguments are invalid

AnalogChannel

Analog output channel configuration. Instantiated by the NoaOverlay.

Methods:

Name Description
setup

Set analog output parameters.

setup(scale, user_offset=0.0, user_gain=1.0)

Set analog output parameters.

User offset and gain are applied digitally in the analog outputs IP.

Parameters:

Name Type Description Default
scale Scale

Output voltage scale

required
user_offset

Voltage offset

0.0
user_gain

Optional gain in Volts

1.0

DAQ

Bases: DefaultIP

Driver for the NOA DAQ IP. Instantiated by the NoaOverlay when a DAQ IP is present in the bitstream.

Methods:

Name Description
read

Read one capture window. Must be called after trigger().

setup_data

Set data and windowing options

trigger

Trigger acquisiton once. Must be called after setup_data

read()

Read one capture window. Must be called after trigger().

Returns:

Type Description
ndarray

A np.ndarray of shape (nb_channels, window_size)

setup_data(window_size=1000, decimation=0, delay=0, dtype=None, channels=None)

Set data and windowing options

Parameters:

Name Type Description Default
window_size int

number of samples per acquisition window

1000
decimation int

keep one in every N samples

0
delay int

include N before-trigger samples in the acquisition window

0
dtype

Data type of the signals being sampled. Must have the same number of bytes as the channel size

None

trigger(kind, channel=None, a=None, b=None, threshold=None, hysteresis=None, tolerate_extra_args=False)

Trigger acquisiton once. Must be called after setup_data

Examples:

ol.daq_0.trigger(TriggerKind.Immediate)
ol.daq_0.trigger(TriggerKind.TriggerIn)

ol.daq_0.trigger(TriggerKind.RisingEdge, channel=1, threshold=0, hysteresis=100)
ol.daq_0.trigger(TriggerKind.FallingEdge, channel=1, threshold=0, hysteresis=100)
ol.daq_0.trigger(TriggerKind.BothEdges, channel=1, threshold=0, hysteresis=100)

ol.daq_0.trigger(TriggerKind.EqualTo, channel=1, a=100)
ol.daq_0.trigger(TriggerKind.GreaterThan, channel=1, a=100)
ol.daq_0.trigger(TriggerKind.LessThan, channel=1, a=100)
ol.daq_0.trigger(TriggerKind.Between, channel=1, a=100, b=200)

Parameters:

Name Type Description Default
kind TriggerKind

Trigger kind to use

required
channel

Channel used to trigger on

None
a

First comparator parameter

None
b

Second comparator parameter

None
threshold

Edge detection threshold

None
hysteresis

Edge detection hysteresis

None

Scale

Bases: IntEnum

Analog output voltage scale.

Values
  • PLUS_MINUS_1V25: ±1.25V output voltage range
  • PLUS_MINUS_5V0: ±5V output voltage range

Voltage

Bases: IntEnum

Digital Voltage Level

Direction

Bases: IntEnum

Digital IO Direction

TriggerKind

Bases: Enum

DAQ Trigger Kind