generate_burst_trigger_external.c 650 B

12345678910111213141516171819202122232425262728293031323334
  1. /* Red Pitaya external trigger pulse generation Example */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <unistd.h>
  5. #include "rp.h"
  6. int main(int argc, char **argv){
  7. /* Print error, if rp_Init() function failed */
  8. if(rp_Init() != RP_OK){
  9. fprintf(stderr, "Rp api init failed!\n");
  10. }
  11. rp_GenReset();
  12. rp_GenWaveform(RP_CH_1, RP_WAVEFORM_SINE);
  13. rp_GenFreq(RP_CH_1, 200);
  14. rp_GenAmp(RP_CH_1, 1);
  15. rp_GenBurstCount(RP_CH_1, 1);
  16. rp_GenMode(RP_CH_1, RP_GEN_MODE_BURST);
  17. rp_GenTriggerSource(RP_CH_1, RP_GEN_TRIG_SRC_EXT_PE);
  18. rp_GenOutEnable(RP_CH_1);
  19. rp_GenTriggerOnly(RP_CH_1);
  20. /* Release rp resources */
  21. rp_Release();
  22. return 0;
  23. }