mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-04 08:55:21 -05:00
CPLD: Remove decimation feature.
This commit is contained in:
parent
52c089c4df
commit
b0a3f680e5
@ -315,7 +315,6 @@ AISAppView::AISAppView(NavigationView&) {
|
||||
receiver_model.rf_amp(),
|
||||
static_cast<int8_t>(receiver_model.lna()),
|
||||
static_cast<int8_t>(receiver_model.vga()),
|
||||
1,
|
||||
});
|
||||
|
||||
options_channel.on_change = [this](size_t, OptionsField::value_t v) {
|
||||
|
@ -27,23 +27,10 @@ using namespace hackrf::one;
|
||||
namespace baseband {
|
||||
|
||||
void CPLD::init() {
|
||||
set_decimation_by(1);
|
||||
gpios_baseband_decimation[0].output();
|
||||
gpios_baseband_decimation[1].output();
|
||||
gpios_baseband_decimation[2].output();
|
||||
|
||||
set_q_invert(false);
|
||||
gpio_baseband_q_invert.output();
|
||||
}
|
||||
|
||||
void CPLD::set_decimation_by(const uint8_t n) {
|
||||
const uint8_t skip_n = n - 1;
|
||||
const uint8_t value = skip_n ^ 7;
|
||||
gpios_baseband_decimation[0].write(value & 1);
|
||||
gpios_baseband_decimation[1].write(value & 2);
|
||||
gpios_baseband_decimation[2].write(value & 4);
|
||||
}
|
||||
|
||||
void CPLD::set_q_invert(const bool invert) {
|
||||
gpio_baseband_q_invert.write(invert);
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ class CPLD {
|
||||
public:
|
||||
void init();
|
||||
|
||||
void set_decimation_by(const uint8_t n);
|
||||
void set_q_invert(const bool invert);
|
||||
|
||||
private:
|
||||
|
@ -74,7 +74,6 @@ CaptureAppView::CaptureAppView(NavigationView& nav) {
|
||||
receiver_model.rf_amp(),
|
||||
static_cast<int8_t>(receiver_model.lna()),
|
||||
static_cast<int8_t>(receiver_model.vga()),
|
||||
1,
|
||||
});
|
||||
|
||||
record_view.set_sampling_rate(sampling_rate / 8);
|
||||
|
@ -142,7 +142,6 @@ ERTAppView::ERTAppView(NavigationView&) {
|
||||
receiver_model.rf_amp(),
|
||||
static_cast<int8_t>(receiver_model.lna()),
|
||||
static_cast<int8_t>(receiver_model.vga()),
|
||||
1,
|
||||
});
|
||||
|
||||
logger = std::make_unique<ERTLogger>();
|
||||
|
@ -158,10 +158,6 @@ void set_baseband_rate(const uint32_t rate) {
|
||||
portapack::clock_manager.set_sampling_frequency(rate);
|
||||
}
|
||||
|
||||
void set_baseband_decimation_by(const size_t n) {
|
||||
baseband_cpld.set_decimation_by(n);
|
||||
}
|
||||
|
||||
void set_antenna_bias(const bool on) {
|
||||
/* Pull MOSFET gate low to turn on antenna bias. */
|
||||
first_if.set_gpo1(on ? 0 : 1);
|
||||
@ -185,7 +181,6 @@ void configure(Configuration configuration) {
|
||||
set_lna_gain(configuration.lna_gain);
|
||||
set_vga_gain(configuration.vga_gain);
|
||||
set_baseband_rate(configuration.baseband_rate);
|
||||
set_baseband_decimation_by(configuration.baseband_decimation);
|
||||
set_baseband_filter_bandwidth(configuration.baseband_filter_bandwidth);
|
||||
set_direction(configuration.direction);
|
||||
}
|
||||
|
@ -37,7 +37,6 @@ struct Configuration {
|
||||
bool rf_amp;
|
||||
int8_t lna_gain;
|
||||
int8_t vga_gain;
|
||||
uint8_t baseband_decimation;
|
||||
};
|
||||
|
||||
void init();
|
||||
@ -50,7 +49,6 @@ void set_vga_gain(const int_fast8_t db);
|
||||
void set_tx_gain(const int_fast8_t db);
|
||||
void set_baseband_filter_bandwidth(const uint32_t bandwidth_minimum);
|
||||
void set_baseband_rate(const uint32_t rate);
|
||||
void set_baseband_decimation_by(const size_t n);
|
||||
void set_antenna_bias(const bool on);
|
||||
|
||||
void enable(Configuration configuration);
|
||||
|
@ -151,11 +151,6 @@ void ReceiverModel::set_headphone_volume(volume_t v) {
|
||||
update_headphone_volume();
|
||||
}
|
||||
|
||||
uint32_t ReceiverModel::baseband_oversampling() const {
|
||||
// TODO: Rename decimation_factor.
|
||||
return decimation_factor_;
|
||||
}
|
||||
|
||||
void ReceiverModel::enable() {
|
||||
enabled_ = true;
|
||||
radio::set_direction(rf::Direction::Receive);
|
||||
@ -243,9 +238,8 @@ void ReceiverModel::update_sampling_rate() {
|
||||
// protocols that need quick RX/TX turn-around.
|
||||
|
||||
// Disabling baseband while changing sampling rates seems like a good idea...
|
||||
radio::set_baseband_rate(sampling_rate() * baseband_oversampling());
|
||||
radio::set_baseband_rate(sampling_rate());
|
||||
update_tuning_frequency();
|
||||
radio::set_baseband_decimation_by(baseband_oversampling());
|
||||
}
|
||||
|
||||
void ReceiverModel::update_headphone_volume() {
|
||||
|
@ -72,8 +72,6 @@ public:
|
||||
volume_t headphone_volume() const;
|
||||
void set_headphone_volume(volume_t v);
|
||||
|
||||
uint32_t baseband_oversampling() const;
|
||||
|
||||
void enable();
|
||||
void disable();
|
||||
|
||||
@ -97,7 +95,6 @@ private:
|
||||
int32_t tx_gain_db_ { 47 };
|
||||
Mode mode_ { Mode::NarrowbandFMAudio };
|
||||
uint32_t sampling_rate_ { 3072000 };
|
||||
size_t decimation_factor_ { 1 };
|
||||
size_t am_config_index = 0;
|
||||
size_t nbfm_config_index = 0;
|
||||
size_t wfm_config_index = 0;
|
||||
|
@ -184,7 +184,6 @@ TPMSAppView::TPMSAppView(NavigationView&) {
|
||||
receiver_model.rf_amp(),
|
||||
static_cast<int8_t>(receiver_model.lna()),
|
||||
static_cast<int8_t>(receiver_model.vga()),
|
||||
1,
|
||||
});
|
||||
|
||||
options_band.on_change = [this](size_t, OptionsField::value_t v) {
|
||||
|
@ -71,11 +71,6 @@ constexpr GPIO gpio_max2837_txenable = gpio[GPIO2_4];
|
||||
|
||||
constexpr GPIO gpio_max5864_select = gpio[GPIO2_7];
|
||||
|
||||
constexpr std::array<GPIO, 3> gpios_baseband_decimation {
|
||||
gpio[GPIO5_12],
|
||||
gpio[GPIO5_13],
|
||||
gpio[GPIO5_14]
|
||||
};
|
||||
constexpr GPIO gpio_baseband_q_invert = gpio[GPIO0_13];
|
||||
|
||||
constexpr GPIO gpio_cpld_tdo = gpio[GPIO5_18];
|
||||
|
Loading…
x
Reference in New Issue
Block a user