Skip to content

Commit

Permalink
gr-cariboulite now accepts and sets pmod
Browse files Browse the repository at this point in the history
  • Loading branch information
alon committed Jun 23, 2024
1 parent bf60fd8 commit 6b37fb1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ namespace gr {
float rx_bw=2500000,
float sample_rate=4000000,
float freq=900000000,
bool provide_meta = false);
bool provide_meta = false,
uint8_t pmod_state = 0);
};

} // namespace caribouLite
Expand Down
17 changes: 12 additions & 5 deletions software/gr-caribouLite/lib/caribouLiteSource_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ namespace gr {

if (CaribouLite::DetectBoard(&ver, name, guid))
{
std::cout << "Detected Version: " << CaribouLite::GetSystemVersionStr(ver) << ", Name: " << name << ", GUID: " << guid << std::endl;
std::cout << "Detected Version: " << CaribouLite::GetSystemVersionStr(ver) <<
", Name: " << name <<
", GUID: " << guid <<
std::endl;
}
else
{
Expand All @@ -34,15 +37,17 @@ namespace gr {
float rx_bw,
float sample_rate,
float freq,
bool provide_meta)
bool provide_meta,
uint8_t pmod_state)
{
return gnuradio::make_block_sptr<caribouLiteSource_impl>(channel,
enable_agc,
rx_gain,
rx_bw,
sample_rate,
freq,
provide_meta);
provide_meta,
pmod_state);
}


Expand All @@ -54,7 +59,8 @@ namespace gr {
float rx_bw,
float sample_rate,
float freq,
bool provide_meta)
bool provide_meta,
uint8_t pmod_state)
: gr::sync_block("caribouLiteSource",
gr::io_signature::make(0, 0, 0),
gr::io_signature::make2(1, 2, sizeof(gr_complex), sizeof(uint8_t))
Expand All @@ -71,9 +77,10 @@ namespace gr {
_provide_meta = provide_meta;

CaribouLite &cl = CaribouLite::GetInstance(false);
_cl = &cl;
cl.SetPmodState(pmod_state);
_radio = cl.GetRadioChannel(_channel);
_mtu_size = _radio->GetNativeMtuSample();
_cl = &cl;

// setup parameters
_radio->SetRxGain(rx_gain);
Expand Down
3 changes: 2 additions & 1 deletion software/gr-caribouLite/lib/caribouLiteSource_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ namespace gr
float rx_bw,
float sample_rate,
float freq,
bool provide_meta);
bool provide_meta,
uint8_t pmod_state);
~caribouLiteSource_impl();

int work(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(caribouLiteSource.h) */
/* BINDTOOL_HEADER_FILE_HASH(2af106876738c9927aadb177d064272d) */
/* BINDTOOL_HEADER_FILE_HASH(08b8583f23bc4fa60b6251c2a4b0fb9f) */
/***********************************************************************************/

#include <pybind11/complex.h>
Expand Down Expand Up @@ -48,6 +48,7 @@ void bind_caribouLiteSource(py::module& m)
py::arg("sample_rate") = 4000000,
py::arg("freq") = 900000000,
py::arg("provide_meta") = false,
py::arg("pmod_state") = 0,
D(caribouLiteSource, make))


Expand Down

0 comments on commit 6b37fb1

Please sign in to comment.