Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AWG control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
whuie2
AWG control
Commits
a9b2a103
Commit
a9b2a103
authored
1 year ago
by
xiyehu2
Browse files
Options
Downloads
Patches
Plain Diff
stable build
parent
338bdca0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Cpp/src/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Cpp/src/CMakeLists.txt
Cpp/src/example.cpp
+77
-0
77 additions, 0 deletions
Cpp/src/example.cpp
with
78 additions
and
0 deletions
Cpp/src/CMakeLists.txt
0 → 100644
+
1
−
0
View file @
a9b2a103
add_executable
(
main example.cpp
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Cpp/src/example.cpp
0 → 100644
+
77
−
0
View file @
a9b2a103
#include
<iostream>
#include
<set>
#include
"../lib/waveform.h"
#include
"../lib/AWG.h"
int
main
()
{
auto
sr
=
614.4e6
;
auto
wfm
=
ArrayWaveform
();
// idealy, waveform param setting here are loaded from
// another waveform via some sort of config file
wfm
.
setSamplingRate
(
sr
);
wfm
.
setFreqResolution
(
1e3
);
wfm
.
setFreqTone
(
105e6
,
1e6
,
5
);
wfm
.
setAmplitude
(
std
::
vector
<
double
>
(
5
,
2000
));
wfm
.
setPhase
(
std
::
vector
<
double
>
(
5
,
0
));
wfm
.
printParam
();
// generate waveform
auto
wfmData
=
wfm
.
getStaticWaveform
();
// auto awg = AWG();
// awg.open(0); // open card at index 0
// awg.setSampleRate(sr); // set card sampling rate
// awg.setActiveChannels(std::set<int> {0}); // set output channels
// awg.setChannel( // set channel output params
// 0,
// 2500,
// AWG::CHANNEL_STOPLVL::ZERO,
// true
// );
// awg.setTrigMode(
// 0,
// AWG::TRIGGER_MODE::POS
// ); // set trigger channel 0 (EXT0) mode to be positve edge
// awg.setTrigMaskOr({
// AWG::TRIGGER_MASK::EXT0,
// // AWG::TRIGGER_MASK::EXT1
// }); // set the trigger engine to be OR and enable both
// // channel EXT0 and/or EXT1
// awg.initReplayModeSeq(2); // intializes card for sequence replay mode
// // with two memory segments
// awg.writeSeqModeSegment(
// 0,
// wfmData.first,
// wfmData.second
// );
// awg.writeSeqModeSegment(
// 1,
// wfmData.first,
// wfmData.second
// ); // load wfms onto both memory segements for simplicity,
// // a memory segment needs only be initialized with data
// // if it is configured as part of the step sequence below
// awg.setSeqModeStep(
// 0,
// 0,
// 1,
// 1,
// AWG::SEQ_LOOPCONDITION::ONTRIG
// );
// awg.setSeqModeStep(
// 1,
// 1,
// 0,
// 1,
// AWG::SEQ_LOOPCONDITION::ONTRIG
// );
// awg.cardRun();
// awg.cardStop();
// awg.close();
return
0
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment