generate_burst_trigger_software.c 843 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Red Pitaya C API example Generating signal pulse on an external trigger
  2. * This application generates a specific signal */
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <unistd.h>
  6. #include "rp.h"
  7. int main(int argc, char **argv){
  8. /* Burst count */
  9. /* Print error, if rp_Init() function failed */
  10. if(rp_Init() != RP_OK){
  11. fprintf(stderr, "Rp api init failed!\n");
  12. }
  13. rp_GenReset();
  14. rp_GenWaveform(RP_CH_1, RP_WAVEFORM_SINE);
  15. rp_GenFreq(RP_CH_1, 1000);
  16. rp_GenAmp(RP_CH_1, 1.0);
  17. rp_GenMode(RP_CH_1, RP_GEN_MODE_BURST);
  18. rp_GenBurstCount(RP_CH_1, 1);
  19. rp_GenBurstRepetitions(RP_CH_1, 10000);
  20. rp_GenBurstPeriod(RP_CH_1, 5000);
  21. rp_GenOutEnable(RP_CH_1);
  22. rp_GenTriggerOnly(RP_CH_1);
  23. rp_Release();
  24. }