-
Notifications
You must be signed in to change notification settings - Fork 5
/
ADF4350.h
79 lines (54 loc) · 1.73 KB
/
ADF4350.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
ADF4350.h - ADF4350 PLL Communication Library
Based on Neal Pisenti code
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 3 of the License, 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
aunsigned long with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ADF4350_h
#define ADF4350_h
#include "Arduino.h"
class ADF4350
{
public:
// Constructor function.
// Creates PLL object, with given SS pin
ADF4350(byte);
// Initialize with initial frequency, refClk (defaults to 10Mhz);
void initialize(long, int);
// powers down the PLL/VCO
void powerDown(bool);
void setRfPower(int);
void setAuxPower(int);
void auxEnable(bool);
void rfEnable(bool);
void setInt(int);
void setFeedbackType(bool);
long getFreq();
void setFreq(long);
//write all register values to device
void update();
private:
byte _ssPin;
bool _powerdown, _auxEnabled, _rfEnabled, _feedbackType;
unsigned long _phase, _int, _divider, _auxPower, _rfPower;
float _refClk, _freq;
double OutputChannelSpacing = 0.01;
unsigned int long INTA, MOD, FRAC;
// function to write data to register.
void setR0();
void setR1();
void setR2();
void setR3();
void setR4();
void setR5();
void WriteRegister32(const uint32_t value);
};
#endif