-
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.
Merge pull request #16 from JuliaTelecom/bladerf
Bladerf
- Loading branch information
Showing
14 changed files
with
2,007 additions
and
72 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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
name = "AbstractSDRs" | ||
uuid = "0bdde9fc-719a-4dc7-8589-49ca6634fa6b" | ||
authors = ["Robin Gerzaguet <[email protected]>"] | ||
version = "0.4.1" | ||
version = "0.5.0" | ||
|
||
[deps] | ||
AdalmPluto = "af34ca7c-e544-47d5-a6fe-72495f08728e" | ||
BladeRFHardwareDriver_jll = "ddcda2f0-0770-5eff-b02e-03a583a735ee" | ||
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" | ||
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" | ||
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" | ||
|
@@ -17,9 +18,9 @@ librtlsdr_jll = "d1c10d9e-0af6-511b-a44d-62fc8e59b084" | |
|
||
[compat] | ||
AdalmPluto = "0.3" | ||
CEnum = "0.4" | ||
Reexport = "0.2,1.0" | ||
UHDBindings = "0.4" | ||
ZMQ = "1.2" | ||
julia = "1.6" | ||
CEnum="0.4" | ||
librtlsdr_jll="0.6" | ||
librtlsdr_jll = "0.6" |
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,43 @@ | ||
using AbstractSDRs | ||
|
||
""" A simple sine wave transmitter | ||
""" | ||
|
||
|
||
|
||
function main() | ||
carrierFreq = 868e6 | ||
samplingRate = 40e6 | ||
gain = 20 | ||
sdr = :bladerf | ||
|
||
#N = 1_000_000 | ||
N = 8192 * 16 | ||
fc = 0.5e6 | ||
|
||
fc = -1.0e6; | ||
ω = 2*pi * fc / samplingRate; | ||
# | ||
d = 0.5*[exp(1im*ω.*n) for n ∈ (0:N-1)]; | ||
radio = openSDR(sdr,carrierFreq,samplingRate,gain) | ||
print(radio) | ||
|
||
cnt = 0 | ||
ϕ = 0 | ||
try | ||
while(true) | ||
d = d * exp(1im*ϕ) | ||
ϕ = angle(d[end]) | ||
send(radio,d,false) | ||
cnt += 1 | ||
end | ||
catch(exception) | ||
close(radio) | ||
@info "Transmitted $cnt buffers" | ||
rethrow(exception) | ||
end | ||
|
||
end | ||
|
||
|
||
main() |
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,50 @@ | ||
using AbstractSDRs | ||
|
||
C = AbstractSDRs.BladeRFBindings.LibBladeRF | ||
|
||
|
||
carrierFreq = 868e6 | ||
samplingRate = 50e6 | ||
gain = 12 | ||
|
||
|
||
sdr = AbstractSDRs.openBladeRF(carrierFreq,samplingRate,gain) | ||
|
||
@info "Initial config" | ||
print(sdr) | ||
|
||
##sleep(2) | ||
|
||
@info "Update config" | ||
AbstractSDRs.BladeRFBindings.updateCarrierFreq!(sdr,2400e6) | ||
AbstractSDRs.BladeRFBindings.updateSamplingRate!(sdr,20e6) | ||
AbstractSDRs.BladeRFBindings.updateRFBandwidth!(sdr,15e6) | ||
AbstractSDRs.BladeRFBindings.updateGain!(sdr,15) | ||
|
||
print(sdr) | ||
|
||
close(sdr) | ||
|
||
|
||
#ptr_bladerf = Ref{Ptr{C.bladerf}}() | ||
#status = C.bladerf_open(ptr_bladerf,"") | ||
#@info "Open BladeRF with status $status" | ||
|
||
#@show theChannel = C.BLADERF_CHANNEL_RX(0) | ||
|
||
#@info "status Carrier is $status" | ||
|
||
#container = Ref{C.bladerf_sample_rate}(0) | ||
#status = C.bladerf_set_sample_rate(ptr_bladerf[],theChannel,convert(C.bladerf_sample_rate,samplingRate),container) | ||
#@info "status sampling is $status -> value $(container[])" | ||
|
||
|
||
#container = Ref{C.bladerf_bandwidth}(0) | ||
#status = C.bladerf_set_bandwidth(ptr_bladerf[],theChannel,convert(C.bladerf_bandwidth,gain),container) | ||
#@info "status band is $status-> value $(container[])" | ||
|
||
#status = C.bladerf_set_gain(ptr_bladerf[],theChannel,convert(C.bladerf_gain,gain)) | ||
#@info "status gain is $status" | ||
|
||
|
||
#C.bladerf_close(ptr_bladerf[]) |
Oops, something went wrong.
e3ffd48
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
e3ffd48
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/84130
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: