mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-17 13:26:18 +00:00
OOK transmit is mostly working, bit durations are wrong
Simplified messages carrying data (uses shared_memory instead) Added SymField widget (bitfield, symbol field...) Added some space for baseband code BMP palette loading bugfix
This commit is contained in:
@@ -160,11 +160,11 @@ set(CPPSRC
|
||||
ui_alphanum.cpp
|
||||
ui_spectrum.cpp
|
||||
ui_about.cpp
|
||||
ui_jammer.cpp
|
||||
# ui_jammer.cpp
|
||||
ui_handwrite.cpp
|
||||
ui_afsksetup.cpp
|
||||
ui_closecall.cpp
|
||||
ui_soundboard.cpp
|
||||
# ui_closecall.cpp
|
||||
# ui_soundboard.cpp
|
||||
ui_rds.cpp
|
||||
ui_lcr.cpp
|
||||
ui_xylos.cpp
|
||||
|
@@ -3654,30 +3654,6 @@ ui_channel.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_channel.cpp.s
|
||||
.PHONY : ui_channel.cpp.s
|
||||
|
||||
ui_closecall.obj: ui_closecall.cpp.obj
|
||||
.PHONY : ui_closecall.obj
|
||||
|
||||
# target to build an object file
|
||||
ui_closecall.cpp.obj:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_closecall.cpp.obj
|
||||
.PHONY : ui_closecall.cpp.obj
|
||||
|
||||
ui_closecall.i: ui_closecall.cpp.i
|
||||
.PHONY : ui_closecall.i
|
||||
|
||||
# target to preprocess a source file
|
||||
ui_closecall.cpp.i:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_closecall.cpp.i
|
||||
.PHONY : ui_closecall.cpp.i
|
||||
|
||||
ui_closecall.s: ui_closecall.cpp.s
|
||||
.PHONY : ui_closecall.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
ui_closecall.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_closecall.cpp.s
|
||||
.PHONY : ui_closecall.cpp.s
|
||||
|
||||
ui_debug.obj: ui_debug.cpp.obj
|
||||
.PHONY : ui_debug.obj
|
||||
|
||||
@@ -3798,30 +3774,6 @@ ui_handwrite.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_handwrite.cpp.s
|
||||
.PHONY : ui_handwrite.cpp.s
|
||||
|
||||
ui_jammer.obj: ui_jammer.cpp.obj
|
||||
.PHONY : ui_jammer.obj
|
||||
|
||||
# target to build an object file
|
||||
ui_jammer.cpp.obj:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_jammer.cpp.obj
|
||||
.PHONY : ui_jammer.cpp.obj
|
||||
|
||||
ui_jammer.i: ui_jammer.cpp.i
|
||||
.PHONY : ui_jammer.i
|
||||
|
||||
# target to preprocess a source file
|
||||
ui_jammer.cpp.i:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_jammer.cpp.i
|
||||
.PHONY : ui_jammer.cpp.i
|
||||
|
||||
ui_jammer.s: ui_jammer.cpp.s
|
||||
.PHONY : ui_jammer.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
ui_jammer.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_jammer.cpp.s
|
||||
.PHONY : ui_jammer.cpp.s
|
||||
|
||||
ui_lcr.obj: ui_lcr.cpp.obj
|
||||
.PHONY : ui_lcr.obj
|
||||
|
||||
@@ -4062,30 +4014,6 @@ ui_setup.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_setup.cpp.s
|
||||
.PHONY : ui_setup.cpp.s
|
||||
|
||||
ui_soundboard.obj: ui_soundboard.cpp.obj
|
||||
.PHONY : ui_soundboard.obj
|
||||
|
||||
# target to build an object file
|
||||
ui_soundboard.cpp.obj:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_soundboard.cpp.obj
|
||||
.PHONY : ui_soundboard.cpp.obj
|
||||
|
||||
ui_soundboard.i: ui_soundboard.cpp.i
|
||||
.PHONY : ui_soundboard.i
|
||||
|
||||
# target to preprocess a source file
|
||||
ui_soundboard.cpp.i:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_soundboard.cpp.i
|
||||
.PHONY : ui_soundboard.cpp.i
|
||||
|
||||
ui_soundboard.s: ui_soundboard.cpp.s
|
||||
.PHONY : ui_soundboard.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
ui_soundboard.cpp.s:
|
||||
cd /home/furrtek/portapack-hackrf && $(MAKE) -f firmware/application/CMakeFiles/application.elf.dir/build.make firmware/application/CMakeFiles/application.elf.dir/ui_soundboard.cpp.s
|
||||
.PHONY : ui_soundboard.cpp.s
|
||||
|
||||
ui_spectrum.obj: ui_spectrum.cpp.obj
|
||||
.PHONY : ui_spectrum.obj
|
||||
|
||||
@@ -4609,9 +4537,6 @@ help:
|
||||
@echo "... ui_channel.obj"
|
||||
@echo "... ui_channel.i"
|
||||
@echo "... ui_channel.s"
|
||||
@echo "... ui_closecall.obj"
|
||||
@echo "... ui_closecall.i"
|
||||
@echo "... ui_closecall.s"
|
||||
@echo "... ui_debug.obj"
|
||||
@echo "... ui_debug.i"
|
||||
@echo "... ui_debug.s"
|
||||
@@ -4627,9 +4552,6 @@ help:
|
||||
@echo "... ui_handwrite.obj"
|
||||
@echo "... ui_handwrite.i"
|
||||
@echo "... ui_handwrite.s"
|
||||
@echo "... ui_jammer.obj"
|
||||
@echo "... ui_jammer.i"
|
||||
@echo "... ui_jammer.s"
|
||||
@echo "... ui_lcr.obj"
|
||||
@echo "... ui_lcr.i"
|
||||
@echo "... ui_lcr.s"
|
||||
@@ -4660,9 +4582,6 @@ help:
|
||||
@echo "... ui_setup.obj"
|
||||
@echo "... ui_setup.i"
|
||||
@echo "... ui_setup.s"
|
||||
@echo "... ui_soundboard.obj"
|
||||
@echo "... ui_soundboard.i"
|
||||
@echo "... ui_soundboard.s"
|
||||
@echo "... ui_spectrum.obj"
|
||||
@echo "... ui_spectrum.i"
|
||||
@echo "... ui_spectrum.s"
|
||||
|
@@ -78,18 +78,17 @@ void WFMConfig::apply() const {
|
||||
audio::set_rate(audio::Rate::Hz_48000);
|
||||
}
|
||||
|
||||
void set_xylos_data(const char ccir_message[]) {
|
||||
const XylosConfigureMessage message {
|
||||
ccir_message
|
||||
void set_ccir_data( const uint32_t samples_per_tone, const uint16_t tone_count) {
|
||||
const CCIRConfigureMessage message {
|
||||
samples_per_tone,
|
||||
tone_count
|
||||
};
|
||||
send_message(&message);
|
||||
}
|
||||
|
||||
void set_afsk_data(const char message_data[], const uint32_t afsk_samples_per_bit, const uint32_t afsk_phase_inc_mark,
|
||||
const uint32_t afsk_phase_inc_space, const uint8_t afsk_repeat, const uint32_t afsk_bw,
|
||||
const bool afsk_alt_format) {
|
||||
void set_afsk_data(const uint32_t afsk_samples_per_bit, const uint32_t afsk_phase_inc_mark, const uint32_t afsk_phase_inc_space,
|
||||
const uint8_t afsk_repeat, const uint32_t afsk_bw, const bool afsk_alt_format) {
|
||||
const AFSKConfigureMessage message {
|
||||
message_data,
|
||||
afsk_samples_per_bit,
|
||||
afsk_phase_inc_mark,
|
||||
afsk_phase_inc_space,
|
||||
@@ -97,7 +96,7 @@ void set_afsk_data(const char message_data[], const uint32_t afsk_samples_per_bi
|
||||
afsk_bw,
|
||||
afsk_alt_format
|
||||
};
|
||||
send_message(&message);
|
||||
send_message(&message);
|
||||
}
|
||||
|
||||
void set_pwmrssi(int32_t avg, bool enabled) {
|
||||
@@ -109,14 +108,15 @@ void set_pwmrssi(int32_t avg, bool enabled) {
|
||||
send_message(&message);
|
||||
}
|
||||
|
||||
void set_ook_data(const char ook_bitstream[], uint32_t stream_length, uint32_t samples_per_bit, uint8_t repeat) {
|
||||
void set_ook_data(const uint32_t stream_length, const uint32_t samples_per_bit, const uint8_t repeat,
|
||||
const uint32_t pause_symbols) {
|
||||
const OOKConfigureMessage message {
|
||||
ook_bitstream,
|
||||
stream_length,
|
||||
samples_per_bit,
|
||||
repeat
|
||||
repeat,
|
||||
pause_symbols
|
||||
};
|
||||
send_message(&message);
|
||||
send_message(&message);
|
||||
}
|
||||
|
||||
static bool baseband_image_running = false;
|
||||
|
@@ -52,12 +52,12 @@ struct WFMConfig {
|
||||
void apply() const;
|
||||
};
|
||||
|
||||
void set_xylos_data(const char ccir_message[]);
|
||||
void set_ccir_data( const uint32_t samples_per_tone, const uint16_t tone_count);
|
||||
void set_pwmrssi(int32_t avg, bool enabled);
|
||||
void set_afsk_data(const char message_data[], const uint32_t afsk_samples_per_bit, const uint32_t afsk_phase_inc_mark,
|
||||
const uint32_t afsk_phase_inc_space, const uint8_t afsk_repeat, const uint32_t afsk_bw,
|
||||
const bool afsk_alt_format);
|
||||
void set_ook_data(const char ook_bitstream[], uint32_t stream_length, uint32_t samples_per_bit, uint8_t repeat);
|
||||
void set_afsk_data(const uint32_t afsk_samples_per_bit, const uint32_t afsk_phase_inc_mark, const uint32_t afsk_phase_inc_space,
|
||||
const uint8_t afsk_repeat, const uint32_t afsk_bw, const bool afsk_alt_format);
|
||||
void set_ook_data(const uint32_t stream_length, const uint32_t samples_per_bit, const uint8_t repeat,
|
||||
const uint32_t pause_symbols);
|
||||
|
||||
void run_image(const portapack::spi_flash::image_tag_t image_tag);
|
||||
void shutdown();
|
||||
|
@@ -37,20 +37,20 @@
|
||||
//TODO: Check jammer bandwidths
|
||||
//TODO: Closecall wide range fix
|
||||
//TODO: SD card wiper
|
||||
//TODO: Use progressbars
|
||||
//TODO: GSM channel detector
|
||||
//TODO: SIGFOX RX/TX
|
||||
//TODO: Bodet :)
|
||||
//TODO: Whistler
|
||||
|
||||
//TODO: LCR full message former (see norm)
|
||||
//TODO: AFSK NRZI, parity and format
|
||||
//TODO: AFSK NRZI
|
||||
//TODO: TX power setting
|
||||
|
||||
//TODO: Playdead amnesia and login
|
||||
//TODO: Setup: Play dead by default ? Enable/disable ?
|
||||
//TODO: Hide statusview when playing dead
|
||||
//TODO: Persistent playdead !
|
||||
|
||||
//TODO: Show MD5 mismatches for modules not found, etc...
|
||||
//TODO: Module name/filename in modules.hpp to indicate requirement in case it's not found ui_loadmodule
|
||||
//BUG: Description doesn't show up first time going to system>module info (UI drawn on top)
|
||||
|
@@ -36,7 +36,7 @@ using namespace portapack;
|
||||
namespace ui {
|
||||
|
||||
void EncodersView::focus() {
|
||||
bitfields[0].focus();
|
||||
bitfield.focus();
|
||||
}
|
||||
|
||||
EncodersView::~EncodersView() {
|
||||
@@ -45,48 +45,56 @@ EncodersView::~EncodersView() {
|
||||
}
|
||||
|
||||
void EncodersView::generate_frame() {
|
||||
uint8_t i;
|
||||
size_t i;
|
||||
|
||||
debug_text = encoder_def->sync;
|
||||
debug_text.clear();
|
||||
|
||||
i = 0;
|
||||
for (auto c : encoder_def->word_def) {
|
||||
if (c <= 'J')
|
||||
debug_text += encoder_def->bit_format.at(bitfields[i++].value());
|
||||
if (c < 'S')
|
||||
debug_text += encoder_def->bit_format.at(bitfield.value(i));
|
||||
else if (c == 'S')
|
||||
debug_text += encoder_def->sync;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (visible()) parent()->set_dirty();
|
||||
//if (visible()) parent()->set_dirty(); // Might be called before on_show ?
|
||||
}
|
||||
|
||||
void EncodersView::paint(Painter& painter) {
|
||||
void EncodersView::draw_waveform() {
|
||||
float x = 0, x_inc;
|
||||
Coord y, prev_y = 1;
|
||||
uint8_t prelude_length = encoder_def->sync.length();
|
||||
uint8_t prelude_length = 0; //encoder_def->sync.length();
|
||||
|
||||
painter.fill_rectangle( { 0, 160, 240, 24 }, Color::black() );
|
||||
// Clear
|
||||
painter_->fill_rectangle( { 0, 160, 240, 24 }, Color::black() );
|
||||
|
||||
x_inc = 230.0 / (debug_text.length() - prelude_length);
|
||||
|
||||
for (auto c : debug_text.substr(prelude_length)) {
|
||||
for (auto c : debug_text) { //.substr(prelude_length)
|
||||
if (c == '0')
|
||||
y = 23;
|
||||
else
|
||||
y = 0;
|
||||
|
||||
if (prev_y != y) painter.draw_rectangle( { (Coord)x, 160, 1, 24 }, Color::yellow() );
|
||||
painter.draw_rectangle( { (Coord)x, 160 + y, ceil(x_inc), 1 }, Color::yellow() );
|
||||
if (prev_y != y) painter_->draw_rectangle( { (Coord)x, 160, 1, 24 }, Color::yellow() );
|
||||
painter_->draw_rectangle( { (Coord)x, 160 + y, ceil(x_inc), 1 }, Color::yellow() );
|
||||
|
||||
prev_y = y;
|
||||
x += x_inc;
|
||||
}
|
||||
}
|
||||
|
||||
void EncodersView::paint(Painter& painter) {
|
||||
painter_ = &painter;
|
||||
}
|
||||
|
||||
void EncodersView::update_progress() {
|
||||
char str[16];
|
||||
|
||||
text_status.set(" ");
|
||||
// text_status.set(" ");
|
||||
|
||||
//if (tx_mode == SINGLE) {
|
||||
if (tx_mode == SINGLE) {
|
||||
strcpy(str, to_string_dec_uint(repeat_index).c_str());
|
||||
strcat(str, "/");
|
||||
strcat(str, to_string_dec_uint(encoder_def->repeat_min).c_str());
|
||||
@@ -101,11 +109,11 @@ void EncodersView::update_progress() {
|
||||
strcat(str, "/");
|
||||
strcat(str, to_string_dec_uint(scan_count).c_str());
|
||||
text_status.set(str);
|
||||
progress.set_value(scan_progress);
|
||||
progress.set_value(scan_progress);*/
|
||||
} else {
|
||||
text_status.set("Ready");
|
||||
progress.set_value(0);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
void EncodersView::on_txdone(int n) {
|
||||
@@ -186,9 +194,9 @@ void EncodersView::start_tx(const bool scan) {
|
||||
n++;
|
||||
}
|
||||
|
||||
ook_bitstream_length = n - 1;
|
||||
ook_bitstream_length = n; // - 1;
|
||||
|
||||
transmitter_model.set_tuning_frequency(433920000); // TODO: Change !
|
||||
transmitter_model.set_tuning_frequency(433920000); // TODO: Make modifiable !
|
||||
transmitter_model.set_baseband_configuration({
|
||||
.mode = 0,
|
||||
.sampling_rate = 2280000U,
|
||||
@@ -200,44 +208,34 @@ void EncodersView::start_tx(const bool scan) {
|
||||
transmitter_model.set_baseband_bandwidth(1750000);
|
||||
transmitter_model.enable();
|
||||
|
||||
memcpy(shared_memory.tx_data, ook_bitstream, 64);
|
||||
|
||||
baseband::set_ook_data(
|
||||
ook_bitstream,
|
||||
ook_bitstream_length,
|
||||
// 2280000/2 = 1140000Hz = 0,877192982us
|
||||
// numberfield_clk.value() / encoder_def->clk_per_symbol
|
||||
// 455000 / 12 = 37917Hz = 26,37339452us
|
||||
1140000 / ((numberfield_clk.value() * 1000) / encoder_def->clk_per_symbol),
|
||||
encoder_def->repeat_min
|
||||
encoder_def->repeat_min,
|
||||
encoder_def->pause_symbols
|
||||
);
|
||||
}
|
||||
|
||||
void EncodersView::on_bitfield() {
|
||||
generate_frame();
|
||||
}
|
||||
|
||||
void EncodersView::on_type_change(size_t index) {
|
||||
std::string word_format;
|
||||
size_t data_length;
|
||||
size_t address_length;
|
||||
//size_t data_length;
|
||||
//size_t address_length;
|
||||
|
||||
enc_type = index;
|
||||
|
||||
|
||||
encoder_def = &encoder_defs[enc_type];
|
||||
|
||||
|
||||
numberfield_clk.set_value(encoder_def->default_frequency / 1000);
|
||||
|
||||
size_t n = 0;
|
||||
for (auto& bitfield : bitfields) {
|
||||
if (n < encoder_def->word_length) {
|
||||
bitfield.hidden(false);
|
||||
bitfield.set_range(0, encoder_def->bit_states - 1);
|
||||
} else {
|
||||
bitfield.hidden(true);
|
||||
}
|
||||
n++;
|
||||
}
|
||||
bitfield.set_length(encoder_def->word_length);
|
||||
bitfield.set_range(0, encoder_def->address_bit_states - 1);
|
||||
|
||||
word_format = encoder_def->word_format;
|
||||
/*word_format = encoder_def->word_format;
|
||||
size_t address_start = word_format.find_first_of("A");
|
||||
size_t data_start = word_format.find_first_of("D");
|
||||
size_t format_length = word_format.length();
|
||||
@@ -274,7 +272,7 @@ void EncodersView::on_type_change(size_t index) {
|
||||
text_format_d.set(std::string(data_length, 'D'));
|
||||
} else {
|
||||
text_format_d.hidden(true);
|
||||
}
|
||||
}*/
|
||||
|
||||
generate_frame();
|
||||
}
|
||||
@@ -285,6 +283,13 @@ void EncodersView::on_show() {
|
||||
}
|
||||
|
||||
EncodersView::EncodersView(NavigationView& nav) {
|
||||
using name_t = std::string;
|
||||
using value_t = int32_t;
|
||||
using option_t = std::pair<name_t, value_t>;
|
||||
using options_t = std::vector<option_t>;
|
||||
options_t enc_options;
|
||||
size_t i;
|
||||
|
||||
baseband::run_image(portapack::spi_flash::image_tag_ook);
|
||||
|
||||
encoder_def = &encoder_defs[0];
|
||||
@@ -302,14 +307,27 @@ EncodersView::EncodersView(NavigationView& nav) {
|
||||
&numberfield_wordduration,
|
||||
&text_us2,
|
||||
&text_bitfield,
|
||||
&text_format_a,
|
||||
&text_format_d,
|
||||
&bitfield,
|
||||
//&text_format_a, // DEBUG
|
||||
//&text_format_d, // DEBUG
|
||||
&text_waveform,
|
||||
&text_status,
|
||||
&progress,
|
||||
&button_transmit
|
||||
} });
|
||||
|
||||
for (i = 0; i < ENC_TYPES_COUNT; i++)
|
||||
enc_options.emplace_back(std::make_pair(encoder_defs[i].name, i));
|
||||
|
||||
options_enctype.set_options(enc_options);
|
||||
options_enctype.set_selected_index(0);
|
||||
|
||||
bitfield.on_change = [this]() {
|
||||
this->generate_frame();
|
||||
};
|
||||
|
||||
button_transmit.set_style(&style_val);
|
||||
|
||||
options_enctype.on_change = [this](size_t index, int32_t value) {
|
||||
(void)value;
|
||||
this->on_type_change(index);
|
||||
@@ -339,30 +357,7 @@ EncodersView::EncodersView(NavigationView& nav) {
|
||||
}
|
||||
};
|
||||
|
||||
const auto bitfield_fn = [this](int32_t value) {
|
||||
(void)value;
|
||||
this->on_bitfield();
|
||||
};
|
||||
|
||||
size_t n = 0;
|
||||
for (auto& bitfield : bitfields) {
|
||||
bitfield.on_change = bitfield_fn;
|
||||
bitfield.id = n;
|
||||
bitfield.set_value(0);
|
||||
bitfield.set_parent_rect({
|
||||
static_cast<Coord>(16 + 8 * n),
|
||||
static_cast<Coord>(80),
|
||||
8, 16
|
||||
});
|
||||
add_child(&bitfield);
|
||||
n++;
|
||||
}
|
||||
|
||||
//options_enctype.set_selected_index(0);
|
||||
|
||||
button_transmit.set_style(&style_val);
|
||||
|
||||
button_transmit.on_select = [this](Button&) {
|
||||
button_transmit.on_select = [this, &nav](Button&) {
|
||||
if (tx_mode == IDLE) start_tx(false);
|
||||
};
|
||||
}
|
||||
|
@@ -28,6 +28,8 @@
|
||||
|
||||
namespace ui {
|
||||
|
||||
#define ENC_TYPES_COUNT 13
|
||||
|
||||
class EncodersView : public View {
|
||||
public:
|
||||
EncodersView(NavigationView& nav);
|
||||
@@ -41,97 +43,179 @@ public:
|
||||
|
||||
private:
|
||||
struct encoder_def_t {
|
||||
uint8_t bit_states;
|
||||
uint16_t clk_per_bit;
|
||||
uint16_t clk_per_symbol;
|
||||
std::string name;
|
||||
uint8_t address_bit_states; // Often 0, 1, [f, [4]]
|
||||
uint8_t data_bit_states; // Often 0, 1
|
||||
uint16_t clk_per_bit; // Oscillator periods per bit
|
||||
uint16_t clk_per_symbol; // Oscillator periods per bit fragment
|
||||
std::vector<std::string> bit_format;
|
||||
uint8_t word_length;
|
||||
uint8_t word_length; // Total # of bits
|
||||
std::string word_def;
|
||||
std::string word_format;
|
||||
std::string sync;
|
||||
uint32_t default_frequency;
|
||||
std::string sync; // Like bit_format
|
||||
uint32_t default_frequency; // Default encoder clk frequency
|
||||
uint8_t repeat_min;
|
||||
uint32_t pause_symbols;
|
||||
};
|
||||
|
||||
// S = Sync
|
||||
// 0~9 A~J = Address/data bits
|
||||
const encoder_def_t encoder_defs[11] = {
|
||||
// PT2260: Data bits can only be 0 or 1 !
|
||||
{ 3, 1024, 128,
|
||||
// 0~9 A~R = Address/data bits
|
||||
const encoder_def_t encoder_defs[ENC_TYPES_COUNT] = {
|
||||
// PT2260
|
||||
{
|
||||
"xx2260",
|
||||
3, 2,
|
||||
1024, 128,
|
||||
{ "10001000", "11101110", "10001110" },
|
||||
12, "0123456789ABS", "AAAAAAAAAADD",
|
||||
"10000000000000000000000000000000",
|
||||
200000, 1 },
|
||||
200000, 1,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// PT2262
|
||||
{ 3, 32, 4,
|
||||
{
|
||||
"xx2262",
|
||||
3, 2,
|
||||
32, 4,
|
||||
{ "10001000", "11101110", "10001110" },
|
||||
12, "0123456789ABS", "AAAAAAAAADDD",
|
||||
12, "0123456789ABS", "AAAAAADDDDDD",
|
||||
"10000000000000000000000000000000",
|
||||
30000, 4 },
|
||||
30000, 4,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// 16bit?
|
||||
{
|
||||
"16bit?",
|
||||
2, 2,
|
||||
32, 8,
|
||||
{ "1110", "1000" }, // Opposite ?
|
||||
16, "0123456789ABCDEFS", "AAAAAAAAAAAAAAAA",
|
||||
"10000000000000000000000000000000",
|
||||
114000, 50,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// RT1527
|
||||
{
|
||||
"xx1527",
|
||||
2, 2,
|
||||
128, 32,
|
||||
{ "1000", "1110" },
|
||||
12, "0123456789ABS", "AAAAAAAADD",
|
||||
"10000000000000000000000000000000",
|
||||
100000, 4,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// HK526E
|
||||
{ 2, 24, 8,
|
||||
{
|
||||
"xx526 ",
|
||||
2, 2,
|
||||
24, 8,
|
||||
{ "110", "100" },
|
||||
12, "0123456789AB", "AAAAAAAAAAAA",
|
||||
12, "0123456789AB", "AAAAAAAADDDD",
|
||||
"",
|
||||
20000, 4 },
|
||||
20000, 4,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// HT12E
|
||||
{ 2, 3, 1,
|
||||
{
|
||||
"xx12E ",
|
||||
2, 2,
|
||||
3, 1,
|
||||
{ "011", "001" },
|
||||
12, "S0123456789AB", "AAAAAAAADDDD",
|
||||
"0000000000000000000000000000000000001",
|
||||
3000, 4 },
|
||||
3000, 4,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// VD5026 13 bits ?
|
||||
{ 4, 128, 8,
|
||||
{
|
||||
"xx5026",
|
||||
4, 4,
|
||||
128, 8,
|
||||
{ "1000000010000000", "1111111011111110", "1111111010000000", "1000000011111110" },
|
||||
12, "S0123456789AB", "AAAAAAAADDDD",
|
||||
"000000000000000000000000000000000000000000000001", // ?
|
||||
100000, 4 },
|
||||
100000, 4,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// UM3750
|
||||
{ 2, 96, 32,
|
||||
{
|
||||
"UM3750",
|
||||
2, 2,
|
||||
96, 32,
|
||||
{ "011", "001" },
|
||||
12, "S0123456789AB", "AAAAAAAAAAAA",
|
||||
"1",
|
||||
100000, 4 },
|
||||
100000, 4,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// UM3758
|
||||
{ 3, 96, 16,
|
||||
{
|
||||
"UM3758",
|
||||
3, 2,
|
||||
96, 16,
|
||||
{ "011011", "001001", "011001" },
|
||||
18, "S0123456789ABCDEFGH", "AAAAAAAAAADDDDDDDD",
|
||||
"1",
|
||||
160000, 4 },
|
||||
160000, 4,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// BA5104
|
||||
{ 2, 3072, 768,
|
||||
{
|
||||
"BA5104",
|
||||
2, 2,
|
||||
3072, 768,
|
||||
{ "1000", "1110" },
|
||||
9, "S012345678", "DDAAAAAAA",
|
||||
"",
|
||||
455000, 4 },
|
||||
455000, 4,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// MC145026
|
||||
{ 3, 16, 1,
|
||||
{
|
||||
"145026",
|
||||
3, 2,
|
||||
16, 1,
|
||||
{ "0111111101111111", "0100000001000000", "0111111101000000" },
|
||||
9, "S012345678", "AAAAADDDD",
|
||||
"000000000000000000",
|
||||
455000, 2 },
|
||||
455000, 2,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// HT6xxx
|
||||
{ 3, 198, 33,
|
||||
{
|
||||
"HT6xxx",
|
||||
3, 2,
|
||||
198, 33,
|
||||
{ "011011", "001001", "001011" },
|
||||
18, "S0123456789ABCDEFGH", "AAAAAAAAAAAADDDDDD",
|
||||
"0000000000000000000000000000000000001011001011001",
|
||||
100000, 3 },
|
||||
100000, 3,
|
||||
10 // ?
|
||||
},
|
||||
|
||||
// TC9148
|
||||
{ 2, 48, 12,
|
||||
{
|
||||
"TC9148",
|
||||
2, 2,
|
||||
48, 12,
|
||||
{ "1000", "1110", },
|
||||
12, "0123456789AB", "DDDDDDDDDDDD",
|
||||
"",
|
||||
455000, 3 }
|
||||
455000, 3,
|
||||
10 // ?
|
||||
}
|
||||
};
|
||||
|
||||
enum tx_modes {
|
||||
@@ -140,6 +224,7 @@ private:
|
||||
SCAN
|
||||
};
|
||||
|
||||
Painter * painter_;
|
||||
uint8_t enc_type = 0;
|
||||
const encoder_def_t * encoder_def;
|
||||
tx_modes tx_mode = IDLE;
|
||||
@@ -151,6 +236,7 @@ private:
|
||||
//rf::Frequency f;
|
||||
uint8_t repeat_index;
|
||||
|
||||
void draw_waveform();
|
||||
void on_bitfield();
|
||||
void on_type_change(size_t index);
|
||||
void generate_frame();
|
||||
@@ -158,17 +244,6 @@ private:
|
||||
void start_tx(const bool scan);
|
||||
void on_txdone(int n);
|
||||
|
||||
radio::Configuration ook_radio_config = {
|
||||
0,
|
||||
2280000,
|
||||
2500000, // ?
|
||||
rf::Direction::Transmit,
|
||||
true,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
};
|
||||
|
||||
const Style style_val {
|
||||
.font = font::fixed_8x16,
|
||||
.background = Color::green(),
|
||||
@@ -191,7 +266,11 @@ private:
|
||||
.foreground = Color::blue(),
|
||||
};
|
||||
|
||||
std::array<NumberField, 18> bitfields;
|
||||
SymField bitfield {
|
||||
{ 16 + 8, 80 },
|
||||
12,
|
||||
{ 0, 1 }
|
||||
};
|
||||
|
||||
Text text_enctype {
|
||||
{ 2 * 8, 3 * 8, 8 * 8, 16 },
|
||||
@@ -199,19 +278,8 @@ private:
|
||||
};
|
||||
OptionsField options_enctype {
|
||||
{ 2 * 8, 5 * 8 },
|
||||
8,
|
||||
6,
|
||||
{
|
||||
{ "PT2260 ", 0 },
|
||||
{ "PT2262 ", 1 },
|
||||
{ "HK526E ", 2 },
|
||||
{ "HT12E ", 3 },
|
||||
{ "VD5026 ", 4 },
|
||||
{ "UM3750 ", 5 },
|
||||
{ "UM3758 ", 6 },
|
||||
{ "BA5104 ", 7 },
|
||||
{ "MC145026", 8 },
|
||||
{ "HT6xxx ", 9 },
|
||||
{ "TC9148 ", 10 }
|
||||
}
|
||||
};
|
||||
|
||||
@@ -267,8 +335,8 @@ private:
|
||||
{ 2 * 8, 8 * 8, 5 * 8, 16 },
|
||||
"Word:"
|
||||
};
|
||||
Text text_format_a;
|
||||
Text text_format_d;
|
||||
//Text text_format_a; // DEBUG
|
||||
//Text text_format_d; // DEBUG
|
||||
|
||||
Text text_waveform {
|
||||
{ 1 * 8, 16 * 8, 9 * 8, 16 },
|
||||
|
@@ -251,7 +251,7 @@ void LCRView::start_tx(const bool scan) {
|
||||
transmitter_model.set_tuning_frequency(portapack::persistent_memory::tuned_frequency());
|
||||
transmitter_model.set_baseband_configuration({
|
||||
.mode = 0,
|
||||
.sampling_rate = 2280000U,
|
||||
.sampling_rate = 1536000,
|
||||
.decimation_factor = 1,
|
||||
});
|
||||
transmitter_model.set_rf_amp(true);
|
||||
@@ -259,12 +259,13 @@ void LCRView::start_tx(const bool scan) {
|
||||
transmitter_model.set_vga(40);
|
||||
transmitter_model.set_baseband_bandwidth(1750000);
|
||||
transmitter_model.enable();
|
||||
|
||||
memcpy(shared_memory.tx_data, lcr_message_data, 300);
|
||||
|
||||
baseband::set_afsk_data(
|
||||
lcr_message_data,
|
||||
228000 / portapack::persistent_memory::afsk_bitrate(),
|
||||
portapack::persistent_memory::afsk_mark_freq() * (0x40000 * 256) / (228000 / 25),
|
||||
portapack::persistent_memory::afsk_space_freq() * (0x40000 * 256) / (228000 / 25),
|
||||
(153600 * 5) / portapack::persistent_memory::afsk_bitrate(),
|
||||
portapack::persistent_memory::afsk_mark_freq() * 437 * 5, //(0x40000 * 256) / (153600 / 25),
|
||||
portapack::persistent_memory::afsk_space_freq() * 437 * 5, //(0x40000 * 256) / (153600 / 25),
|
||||
afsk_repeats,
|
||||
portapack::persistent_memory::afsk_bw() * 115, // See proc_fsk_lcr.cpp
|
||||
afsk_format
|
||||
|
@@ -34,8 +34,8 @@
|
||||
#include "ui_setup.hpp"
|
||||
#include "ui_debug.hpp"
|
||||
|
||||
#include "ui_soundboard.hpp" // DEBUG
|
||||
#include "ui_closecall.hpp" // DEBUG
|
||||
//#include "ui_soundboard.hpp" // DEBUG
|
||||
//#include "ui_closecall.hpp" // DEBUG
|
||||
#include "ui_freqman.hpp" // DEBUG
|
||||
|
||||
#include "ui_encoders.hpp"
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "ui_lcr.hpp"
|
||||
#include "analog_audio_app.hpp"
|
||||
#include "ui_audiotx.hpp" // DEBUG
|
||||
#include "ui_jammer.hpp" // DEBUG
|
||||
//#include "ui_jammer.hpp" // DEBUG
|
||||
|
||||
#include "analog_audio_app.hpp"
|
||||
#include "ais_app.hpp"
|
||||
@@ -238,13 +238,13 @@ ReceiverMenuView::ReceiverMenuView(NavigationView& nav) {
|
||||
/* SystemMenuView ********************************************************/
|
||||
|
||||
SystemMenuView::SystemMenuView(NavigationView& nav) {
|
||||
add_items<14>({ {
|
||||
add_items<12>({ {
|
||||
{ "Play dead", ui::Color::red(), [&nav](){ nav.push<PlayDeadView>(false); } },
|
||||
{ "Receiver RX", ui::Color::cyan(), [&nav](){ nav.push<ReceiverMenuView>(); } },
|
||||
{ "Capture RX", ui::Color::cyan(), [&nav](){ nav.push<CaptureAppView>(); } },
|
||||
{ "Close Call RX", ui::Color::cyan(), [&nav](){ nav.push<CloseCallView>(); } },
|
||||
//{ "Close Call RX", ui::Color::cyan(), [&nav](){ nav.push<CloseCallView>(); } },
|
||||
{ "Numbers station TX", ui::Color::purple(), [&nav](){ nav.push<NotImplementedView>(); } }, //nav.push<NumbersStationView>();
|
||||
{ "Pokemon GO Away TX", ui::Color::blue(), [&nav](){ nav.push<JammerView>(); } },
|
||||
//{ "Pokemon GO Away TX", ui::Color::blue(), [&nav](){ nav.push<JammerView>(); } },
|
||||
//{ "Soundboard TX", ui::Color::yellow(), [&nav](){ nav.push<LoadModuleView>(md5_baseband_tx, SoundBoard); } },
|
||||
//{ "Audio TX", ui::Color::yellow(), [&nav](){ nav.push<LoadModuleView>(md5_baseband_tx, AudioTX); } },
|
||||
//{ "Frequency manager", ui::Color::white(), [&nav](){ nav.push<FreqManView>(); } },
|
||||
|
@@ -173,7 +173,8 @@ void XylosView::start_tx() {
|
||||
transmitter_model.set_baseband_bandwidth(1750000);
|
||||
transmitter_model.enable();
|
||||
|
||||
baseband::set_xylos_data(ccir_message);
|
||||
memcpy(shared_memory.tx_data, ccir_message, 21);
|
||||
baseband::set_ccir_data(CCIR_TONELENGTH, 20);
|
||||
}
|
||||
|
||||
// ASCII to frequency LUT index
|
||||
|
@@ -35,6 +35,8 @@
|
||||
//#include "receiver_model.hpp"
|
||||
#include "portapack.hpp"
|
||||
|
||||
#define CCIR_TONELENGTH (15360*2)-1 // 1536000/10/10
|
||||
|
||||
namespace ui {
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user