Classification
Revision
Public
PA6
Document Number
Date
17-1957
2018-06-07
•
ATDUpdateNofAccumulations()
•
ATDWaitForWFABuffer()
•
ATDWaitForWFACompletion()
Warning
The ADQAPI is not thread safe. Calling API functions from multiple threads may yield undefined
behavior.
5
User Application Example
This section aims to explain how to write the core code in the user application interfacing to ADQ7-FWATD
by using the provided C code as an example.
The ADQAPI reference guide [
3
] lists all the functions available in the ADQAPI and is a good supple-
mentary source of information. Please note that not all functions are valid for ADQ7.
5.1
Overview
The code implementing the digitizer interface in the user application centers around memory manage-
ment, configuration, running the measurement and reacting to any unexpected events in a way that
makes sense in the context of the user application.
Since ADQ7-FWATD extends the functionality of the base product, ADQ7-FWDAQ, almost all of the
functions listed as valid for ADQ7 in the ADQAPI reference guide [
3
] are valid for ADQ7-FWATD as
well. This includes functions handling trigger configuration, adjustable bias in the analog front-end, di-
gital baseline stabilization, clocking etc. The exceptions are the data management functions where the
FWATD-specific functions should be used instead of the general streaming functions.
The example is divided into five parts and the principal actions should be imitated in any code inter-
facing to ADQ7-FWATD.
Parameter definition
The digitizer settings are defined in this step together with the allocation of static memory.
Memory allocation
The application dynamically allocates system memory to be used as target buffers, used to shuttle
data between the API and user space.
Digitizer setup
Based on the defined parameters, relevant API functions are called to carry out the digitizer con-
figuration. The order of operations does not matter in this step as long as no data collection
functions are called and the digitizer is disarmed (default state).
Data collection
The heart of the application is the data collection loop. There are two versions, controlled by the
define
SINGLE_SHOT_COLLECTION
(disabled by default). The define will cause either the streaming-
ADQ7-FWATD User Guide
www.teledyne-spdevices.com
Page 18 of 26