mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-13 20:22:22 -04:00
Rough implementation of capture mode
This commit is contained in:
parent
9eefd56410
commit
743dc9f542
8 changed files with 220 additions and 1 deletions
62
firmware/application/capture_app.cpp
Normal file
62
firmware/application/capture_app.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (C) 2016 Jared Boone, ShareBrained Technology, Inc.
|
||||
*
|
||||
* 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 "capture_app.hpp"
|
||||
|
||||
#include "baseband_api.hpp"
|
||||
|
||||
#include "utility.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
CaptureAppView::CaptureAppView(NavigationView&) {
|
||||
capture_thread = std::make_unique<AudioThread>("baseband.c16");
|
||||
|
||||
radio::enable({
|
||||
tuning_frequency(),
|
||||
sampling_rate,
|
||||
baseband_bandwidth,
|
||||
rf::Direction::Receive,
|
||||
false, 16, 16,
|
||||
1,
|
||||
});
|
||||
|
||||
baseband::start({
|
||||
.mode = 7,
|
||||
.sampling_rate = sampling_rate,
|
||||
.decimation_factor = 1,
|
||||
});
|
||||
}
|
||||
|
||||
CaptureAppView::~CaptureAppView() {
|
||||
baseband::stop();
|
||||
radio::disable();
|
||||
}
|
||||
|
||||
uint32_t CaptureAppView::target_frequency() const {
|
||||
return initial_target_frequency;
|
||||
}
|
||||
|
||||
uint32_t CaptureAppView::tuning_frequency() const {
|
||||
return target_frequency() - (sampling_rate / 4);
|
||||
}
|
||||
|
||||
} /* namespace ui */
|
Loading…
Add table
Add a link
Reference in a new issue