I tried to produce a single burst of a square wave (see code below), but instead of producing just one waveform, it generates continuous output. I assumed that whenever the trigger happens, the buffer would be output exactly one time and then the voltage level should return to 0 V. However, it doesn't. I think the online API library is not very clear in its explanations, so if anyone could answer my questions, I would appreciate it very much.
Code: Select all
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <errno.h>
#include <sys/param.h>
#include "redpitaya/rp.h"
#include "main.h"
int main();
{
if(rp_Init() != 0){
fprintf(stderr, "RP API init failed\n");
}
rp_GenReset();
rp_GenAmp(RP_CH_1, 1.0);
rp_GenFreq(RP_CH_1, 10000);
rp_GenWaveform(RP_CH_1, RP_WAVEFORM_SQUARE);
rp_GenMode(RP_CH_1, RP_GEN_MODE_BURST);
rp_GenBurstCount(RP_CH_1, 1);
rp_GenBurstRepetitions(RP_CH_1, 1);
rp_GenTriggerSource(RP_CH_1, RP_GEN_TRIG_SRC_INTERNAL);
rp_GenOutEnable(RP_CH_1);
rp_Release();
return 0;
}