diff DDS4xAD9912.h @ 174:d96f0b04f7fe

Make DDS addres configurable in configuration file. Modernize AD9912 driver.
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 21 Feb 2014 18:37:32 +0100
parents fd085d61e4ca
children
line wrap: on
line diff
--- a/DDS4xAD9912.h	Mon Feb 17 18:39:36 2014 +0100
+++ b/DDS4xAD9912.h	Fri Feb 21 18:37:32 2014 +0100
@@ -1,70 +1,24 @@
-//==============================================================================
-//
-// Title:       DDS4xAD9912.h
-// Purpose:     
-//
-// Created on:  by Volodimer Laurent, modified by YLC
-// Copyright:   syrte. All Rights Reserved.
-//
-//==============================================================================
-
 #ifndef __DDS4XAD9912_H__
 #define __DDS4XAD9912_H__
 
+typedef struct {
+	char *host;
+	int port[4];
+	double clock;
+	double frequency[4];
+} DDS4xAD9912_Data;
+
 #ifdef __cplusplus
     extern "C" {
 #endif
 
-//==============================================================================
-// Include files
-
-#include "cvidef.h"
-
-//==============================================================================
-// Defines
-		
-#define Adress	"145.238.205.55"
-#define Port1 	6665
-#define Port2	6666		
-#define Port3	6667
-#define Port4	6668		
-#define Clk		1000000000
-#define E48		281474976710656.0		
-#define E40		1099511627776.0
-#define E32		4294967296.0
-#define E24		16777216.0
-#define E16		65536.0
-#define E8		256.0
-
-//==============================================================================
-// Macros
-		
-#define WORD(Freq,Clk) pow(2,48)*(Freq/Clk)	
-		
-// DDS4xAD9912_Data : the data of crypto class DDS4xAD9912
-
-typedef struct {
-	double frequency[4]; 
-} DDS4xAD9912_Data ;
-		
-//==============================================================================		
-// Variables
-		
-char  Request[255];
-char Response[255];
-unsigned int hConv;	
-
-
-//==============================================================================		
-// Functions
-
 double DDS4xAD9912_GetFrequency(DDS4xAD9912_Data *dds, int channel);
+void DDS4xAD9912_Init(DDS4xAD9912_Data *d, const char *host, double clock);
 int DDS4xAD9912_SetFrequency(DDS4xAD9912_Data * Instance, int DDSNum, double Freq);
 int DDS4xAD9912_Reset(DDS4xAD9912_Data * Instance);
 int DDS4xAD9912_RampFrequency(DDS4xAD9912_Data *dds, int channel, double f2, double fstep);
 int DDS4xAD9912_RampFrequency2(DDS4xAD9912_Data *dds, int channel, double f1, double f2, double fstep);
 
-
 #ifdef __cplusplus
     }
 #endif