-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate_DC, generate_DC_LO was added.
- Loading branch information
1 parent
7eae646
commit df9df47
Showing
4 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CC = $(CROSS_COMPILE)gcc | ||
|
||
CFLAGS = -g -std=gnu99 -Wall -Werror | ||
CFLAGS += -I../api/include | ||
LFLAGS = -L../api/lib | ||
LIBS = -lm -lpthread -lrp | ||
|
||
SRCS=$(wildcard *.c) | ||
OBJS=$(SRCS:.c=) | ||
|
||
all: $(OBJS) | ||
|
||
%: %.c | ||
$(CC) $(CFLAGS) $(LFLAGS) $< -o $@ $(LIBS) | ||
|
||
clean: | ||
$(RM) $(OBJS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* Red Pitaya C API example Generating continuous signal | ||
* This application generates a specific signal */ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
#include "redpitaya/rp.h" | ||
|
||
int main(int argc, char **argv){ | ||
|
||
/* Print error, if rp_Init() function failed */ | ||
if(rp_Init() != RP_OK){ | ||
fprintf(stderr, "Rp api init failed!\n"); | ||
} | ||
|
||
/* Generator reset */ | ||
rp_GenReset(); | ||
|
||
/* Generating frequency */ | ||
rp_GenFreq(RP_CH_1, 0); | ||
rp_GenFreq(RP_CH_2, 0); | ||
|
||
/* Generating wave form */ | ||
rp_GenWaveform(RP_CH_1, RP_WAVEFORM_DC); | ||
rp_GenWaveform(RP_CH_2, RP_WAVEFORM_DC); | ||
|
||
/* Generating amplitude */ | ||
rp_GenAmp(RP_CH_1, 0.9); | ||
rp_GenOffset(RP_CH_1, 0); | ||
|
||
rp_GenAmp(RP_CH_2, 0.9); | ||
rp_GenOffset(RP_CH_2, 0); | ||
|
||
/* Enable channel */ | ||
rp_GenOutEnable(RP_CH_1); | ||
rp_GenOutEnable(RP_CH_2); | ||
|
||
/* Releasing resources */ | ||
rp_Release(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* Red Pitaya C API example Generating continuous signal | ||
* This application generates a specific signal */ | ||
|
||
#include <stdio.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
#include "redpitaya/rp.h" | ||
|
||
int main(int argc, char **argv){ | ||
|
||
/* Print error, if rp_Init() function failed */ | ||
if(rp_Init() != RP_OK){ | ||
fprintf(stderr, "Rp api init failed!\n"); | ||
} | ||
|
||
/* Generator reset */ | ||
rp_GenReset(); | ||
|
||
/* Generating frequency */ | ||
rp_GenFreq(RP_CH_1, 0); | ||
rp_GenFreq(RP_CH_2, 0); | ||
|
||
/* Generating wave form */ | ||
rp_GenWaveform(RP_CH_1, RP_WAVEFORM_DC); | ||
rp_GenWaveform(RP_CH_2, RP_WAVEFORM_DC); | ||
|
||
/* Generating amplitude */ | ||
rp_GenAmp(RP_CH_1, 0.45); | ||
rp_GenOffset(RP_CH_1, 0); | ||
|
||
rp_GenAmp(RP_CH_2, 0.45); | ||
rp_GenOffset(RP_CH_2, 0); | ||
|
||
/* Enable channel */ | ||
rp_GenOutEnable(RP_CH_1); | ||
rp_GenOutEnable(RP_CH_2); | ||
|
||
/* Releasing resources */ | ||
rp_Release(); | ||
|
||
return 0; | ||
} |