RMM API 2.0.0
Loading...
Searching...
No Matches
Si570Calc.h
1#pragma once
2
3#include <cmath>
4#include <iomanip>
5#include <iostream>
6#include <map>
7#include <sstream>
8#include <vector>
9
10class Si570Calculator {
11 public:
12 Si570Calculator();
13 std::vector<int> calcSi570Regs(double old_freq, double new_freq, std::vector<int>& rd_regs);
14
15 private:
16 struct DividerOption {
17 int total_div;
18 int hsdiv;
19 int n1;
20 float min_output_freq;
21 float max_output_freq;
22 };
23
24 struct OptimalDivider {
25 int hsdiv;
26 int n1;
27 };
28
29 std::vector<DividerOption> getPossibleDividers(float new_freq);
30 OptimalDivider getOptimalDivider(float new_freq);
31
32 std::string intToHex(long value);
33 std::string doubleToHex(double value);
34 long hexToLong(const std::string& hex);
35};