mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-15 06:07:42 +00:00
Added basic APRS transmit
Added goertzel algo Updated binary
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "string_format.hpp"
|
||||
#include "portapack.hpp"
|
||||
#include "baseband_api.hpp"
|
||||
#include "portapack_shared_memory.hpp"
|
||||
#include "portapack_persistent_memory.hpp"
|
||||
|
||||
#include <cstring>
|
||||
@@ -46,21 +47,29 @@ APRSTXView::~APRSTXView() {
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
void APRSTXView::paint(Painter& painter) {
|
||||
(void)painter;
|
||||
}
|
||||
|
||||
void APRSTXView::generate_frame() {
|
||||
|
||||
}
|
||||
|
||||
void APRSTXView::start_tx() {
|
||||
//generate_frame();
|
||||
make_aprs_frame(
|
||||
sym_source.value_string().c_str(), num_ssid_source.value(),
|
||||
sym_dest.value_string().c_str(), num_ssid_dest.value(),
|
||||
payload);
|
||||
|
||||
/*transmitter_model.set_tuning_frequency(144800000);
|
||||
//uint8_t * bb_data_ptr = shared_memory.bb_data.data;
|
||||
//text_payload.set(to_string_hex_array(bb_data_ptr + 56, 15));
|
||||
|
||||
transmitter_model.set_tuning_frequency(persistent_memory::tuned_frequency());
|
||||
transmitter_model.set_sampling_rate(AFSK_TX_SAMPLERATE);
|
||||
transmitter_model.set_rf_amp(true);
|
||||
transmitter_model.set_baseband_bandwidth(2500000);
|
||||
transmitter_model.enable();*/
|
||||
transmitter_model.set_baseband_bandwidth(1750000);
|
||||
transmitter_model.enable();
|
||||
|
||||
baseband::set_afsk_data(
|
||||
AFSK_TX_SAMPLERATE / 1200,
|
||||
1200,
|
||||
2200,
|
||||
1,
|
||||
10000, //transmitter_model.channel_bandwidth(),
|
||||
8
|
||||
);
|
||||
}
|
||||
|
||||
void APRSTXView::on_tx_progress(const uint32_t progress, const bool done) {
|
||||
@@ -69,9 +78,6 @@ void APRSTXView::on_tx_progress(const uint32_t progress, const bool done) {
|
||||
if (done) {
|
||||
transmitter_model.disable();
|
||||
tx_view.set_transmitting(false);
|
||||
//progress.set_value(0);
|
||||
} else {
|
||||
//progress.set_value(n);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,10 +87,26 @@ APRSTXView::APRSTXView(NavigationView& nav) {
|
||||
|
||||
add_children({
|
||||
&labels,
|
||||
&text_frame_a,
|
||||
&sym_source,
|
||||
&num_ssid_source,
|
||||
&sym_dest,
|
||||
&num_ssid_dest,
|
||||
&text_payload,
|
||||
&button_set,
|
||||
&tx_view
|
||||
});
|
||||
|
||||
button_set.on_select = [this, &nav](Button&) {
|
||||
text_prompt(
|
||||
nav,
|
||||
&payload,
|
||||
30,
|
||||
[this](std::string* s) {
|
||||
text_payload.set(*s);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
tx_view.on_edit_frequency = [this, &nav]() {
|
||||
return;
|
||||
};
|
||||
|
@@ -38,8 +38,6 @@ public:
|
||||
APRSTXView(NavigationView& nav);
|
||||
~APRSTXView();
|
||||
|
||||
void paint(Painter& painter) override;
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "APRS TX (beta)"; };
|
||||
@@ -53,25 +51,58 @@ private:
|
||||
|
||||
tx_modes tx_mode = IDLE;*/
|
||||
|
||||
std::string payload { "" };
|
||||
|
||||
void start_tx();
|
||||
void generate_frame();
|
||||
void generate_frame_pos();
|
||||
void on_tx_progress(const uint32_t progress, const bool done);
|
||||
|
||||
Labels labels {
|
||||
{ { 2 * 8, 2 * 8 }, "Work in progress...", Color::light_grey() }
|
||||
{ { 0 * 8, 1 * 16 }, "Source: SSID:", Color::light_grey() }, // 6 alphanum + SSID
|
||||
{ { 0 * 8, 2 * 16 }, " Dest.: SSID:", Color::light_grey() },
|
||||
{ { 0 * 8, 4 * 16 }, "Info field:", Color::light_grey() },
|
||||
};
|
||||
|
||||
Text text_frame_a {
|
||||
{ 2 * 8, 13 * 16, 14 * 8, 16 },
|
||||
SymField sym_source {
|
||||
{ 7 * 8, 1 * 16 },
|
||||
6,
|
||||
SymField::SYMFIELD_ALPHANUM
|
||||
};
|
||||
NumberField num_ssid_source {
|
||||
{ 19 * 8, 1 * 16 },
|
||||
2,
|
||||
{ 0, 15 },
|
||||
1,
|
||||
' '
|
||||
};
|
||||
|
||||
SymField sym_dest {
|
||||
{ 7 * 8, 2 * 16 },
|
||||
6,
|
||||
SymField::SYMFIELD_ALPHANUM
|
||||
};
|
||||
NumberField num_ssid_dest {
|
||||
{ 19 * 8, 2 * 16 },
|
||||
2,
|
||||
{ 0, 15 },
|
||||
1,
|
||||
' '
|
||||
};
|
||||
|
||||
Text text_payload {
|
||||
{ 0 * 8, 5 * 16, 30 * 8, 16 },
|
||||
"-"
|
||||
};
|
||||
Button button_set {
|
||||
{ 0 * 8, 6 * 16, 80, 32 },
|
||||
"Set"
|
||||
};
|
||||
|
||||
TransmitterView tx_view {
|
||||
16 * 16,
|
||||
144800000,
|
||||
2000000,
|
||||
true
|
||||
5000,
|
||||
10
|
||||
};
|
||||
|
||||
MessageHandlerRegistration message_handler_tx_progress {
|
||||
|
52
firmware/application/apps/ui_tone_search.cpp
Normal file
52
firmware/application/apps/ui_tone_search.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2018 Furrtek
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "ui_tone_search.hpp"
|
||||
|
||||
#include "baseband_api.hpp"
|
||||
#include "string_format.hpp"
|
||||
|
||||
using namespace portapack;
|
||||
|
||||
namespace ui {
|
||||
|
||||
void ToneSearchView::focus() {
|
||||
//field_frequency_min.focus();
|
||||
}
|
||||
|
||||
ToneSearchView::~ToneSearchView() {
|
||||
receiver_model.disable();
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
ToneSearchView::ToneSearchView(
|
||||
NavigationView& nav
|
||||
) : nav_ (nav)
|
||||
{
|
||||
//baseband::run_image(portapack::spi_flash::image_tag_wideband_spectrum);
|
||||
|
||||
add_children({
|
||||
&labels
|
||||
});
|
||||
}
|
||||
|
||||
} /* namespace ui */
|
61
firmware/application/apps/ui_tone_search.hpp
Normal file
61
firmware/application/apps/ui_tone_search.hpp
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2018 Furrtek
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "receiver_model.hpp"
|
||||
|
||||
#include "ui_receiver.hpp"
|
||||
#include "ui_font_fixed_8x16.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
class ToneSearchView : public View {
|
||||
public:
|
||||
ToneSearchView(NavigationView& nav);
|
||||
~ToneSearchView();
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Tone search"; };
|
||||
|
||||
private:
|
||||
NavigationView& nav_;
|
||||
|
||||
Labels labels {
|
||||
{ { 1 * 8, 0 }, "Min: Max: LNA VGA", Color::light_grey() }
|
||||
};
|
||||
|
||||
/*
|
||||
MessageHandlerRegistration message_handler_frame_sync {
|
||||
Message::ID::DisplayFrameSync,
|
||||
[this](const Message* const) {
|
||||
if( this->fifo ) {
|
||||
ChannelSpectrum channel_spectrum;
|
||||
while( fifo->out(channel_spectrum) ) {
|
||||
this->on_channel_spectrum(channel_spectrum);
|
||||
}
|
||||
}
|
||||
this->do_timers();
|
||||
}
|
||||
};*/
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
Reference in New Issue
Block a user