When you are writing an Arduino AD9850 library, you need to create two files. The first is a header file, shown immediately below. The header file describes a class, which is then implemented in the C++ file, shown below. The header file is included in your main Arduino program.
// AD9850B.h
#ifndef _AD9850B_h
#define _AD9850B_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#define DDS_CLOCK 125000000
#define FREQ_FACTOR 4294967296
typedef enum SweepState { ssOff, ssRunning, ssFinished };
class AD9850B
{
private:
int lineCLOCK;
int lineLOAD;
int lineDATA;
int lineRESET;
unsigned long _frequency = 10000000;
double _calfactor = 0;
boolean _active = false;
void PowerDown();
void Reset();
public:
AD9850B(int gW_CLK, int gFQ_UD, int gDATA, int gRESET);
void Init();
boolean GetActive();
void SetActive(boolean param);
unsigned long GetFrequency();
void SetCalibration(long param);
void SetFrequency(unsigned long param);
};
extern AD9850B dds;
#endif