Give min/max frequency variable names

This commit is contained in:
Reed Nightingale 2020-04-26 23:46:32 -07:00
parent ab8ba66067
commit 55822dadf7
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include <Arduino.h>
#include <Wire.h>
#include "settings.h"
#include "si5351.h"
// ************* SI5315 routines - tks Jerry Gaffke, KE7ER ***********************
@ -84,7 +85,7 @@ void si5351bx_init() { // Call once at power-up, start PLLA
void si5351bx_setfreq(uint8_t clknum, uint32_t fout) { // Set a CLK to fout Hz
uint32_t msa, msb, msc, msxp1, msxp2, msxp3p2top;
if ((fout < 500000) || (fout > 109000000)) // If clock freq out of range
if ((fout < SI5351_MIN_FREQUENCY_HZ) || (fout > SI5351_MAX_FREQUENCY_HZ)) // If clock freq out of range
si5351bx_clken |= 1 << clknum; // shut down the clock
else {
msa = si5351bx_vcoa / fout; // Integer part of vco/fout

View File

@ -1,5 +1,10 @@
#pragma once
#include <stdint.h>
static const uint32_t SI5351_MIN_FREQUENCY_HZ = 500000;
static const uint32_t SI5351_MAX_FREQUENCY_HZ = 109000000;
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