From 2db9899d4d4b856f75ae7eadc580f05d35eb1c02 Mon Sep 17 00:00:00 2001 From: Reed Nightingale Date: Sat, 25 Apr 2020 14:31:59 -0700 Subject: [PATCH] Move SI5351 driver stuff into it's own header --- setup.cpp | 1 + ubitx_si5351.cpp => si5351.cpp | 0 si5351.h | 5 +++++ tuner.cpp | 1 + tuner.h | 6 ------ ubitxv6.ino | 1 + 6 files changed, 8 insertions(+), 6 deletions(-) rename ubitx_si5351.cpp => si5351.cpp (100%) create mode 100644 si5351.h diff --git a/setup.cpp b/setup.cpp index 6c7a0f4..938453a 100644 --- a/setup.cpp +++ b/setup.cpp @@ -8,6 +8,7 @@ #include "scratch_space.h" #include "setup.h" #include "settings.h" +#include "si5351.h" #include "tuner.h" #include "utils.h" diff --git a/ubitx_si5351.cpp b/si5351.cpp similarity index 100% rename from ubitx_si5351.cpp rename to si5351.cpp diff --git a/si5351.h b/si5351.h new file mode 100644 index 0000000..2a9d38e --- /dev/null +++ b/si5351.h @@ -0,0 +1,5 @@ +#pragma once + +void initOscillators(); +void si5351bx_setfreq(uint8_t clknum, uint32_t fout); +void si5351_set_calibration(int32_t cal); //calibration is a small value that is nudged to make up for the inaccuracies of the reference 25 MHz crystal frequency diff --git a/tuner.cpp b/tuner.cpp index c9e7a11..1eb3724 100644 --- a/tuner.cpp +++ b/tuner.cpp @@ -4,6 +4,7 @@ #include "nano_gui.h" #include "pin_definitions.h" +#include "si5351.h" static const uint32_t THRESHOLD_USB_LSB = 10000000L; diff --git a/tuner.h b/tuner.h index 2414aaf..cce5e97 100644 --- a/tuner.h +++ b/tuner.h @@ -2,7 +2,6 @@ #include "settings.h" -/* these are functions implemented in the main file named as ubitx_xxx.ino */ void saveVFOs(); void setFrequency(const unsigned long freq, const bool transmit = false); void startTx(TuningMode_e tx_mode); @@ -13,9 +12,4 @@ void checkCAT(); void cwKeyer(void); void switchVFO(Vfo_e vfoSelect); -/* these are functiosn implemented in ubitx_si5351.cpp */ -void si5351bx_setfreq(uint8_t clknum, uint32_t fout); -void initOscillators(); -void si5351_set_calibration(int32_t cal); //calibration is a small value that is nudged to make up for the inaccuracies of the reference 25 MHz crystal frequency - bool autoSelectSidebandChanged(const uint32_t old_frequency); //if the current frequency defaults to a different sideband mode, updates to that sideband mode and returns true. Else, returns false diff --git a/ubitxv6.ino b/ubitxv6.ino index f3d1594..38f4da4 100644 --- a/ubitxv6.ino +++ b/ubitxv6.ino @@ -39,6 +39,7 @@ #include "nano_gui.h" #include "settings.h" #include "setup.h" +#include "si5351.h" #include "touch.h" #include "tuner.h" #include "ui_touch.h"