annotate DDS4xAD9912.h @ 23:65e277fdf01f

Correct DDS3 frequency adjustement on N3 measurement We need to take into account the phase locked loop divisor factor that links DDS1 frequency change to repetition rate change.
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 20 Jul 2012 16:50:11 +0200
parents d9aae7d7f2c6
children 54e7b129ecc2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
1 //==============================================================================
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
2 //
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
3 // Title: DDS4xAD9912.h
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
4 // Purpose:
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
5 //
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
6 // Created on: by Volodimer Laurent, modified by YLC
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
7 // Copyright: syrte. All Rights Reserved.
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
8 //
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
9 //==============================================================================
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
10
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
11 #ifndef __DDS4XAD9912_H__
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
12 #define __DDS42XAD9912_H__
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
13
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
14 #ifdef __cplusplus
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
15 extern "C" {
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
16 #endif
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
17
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
18 //==============================================================================
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
19 // Include files
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
20
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
21 #include "cvidef.h"
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
22
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
23 //==============================================================================
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
24 // Defines
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
25
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
26 #define Adress "145.238.205.55"
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
27 #define Port1 6665
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
28 #define Port2 6666
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
29 #define Port3 6667
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
30 #define Port4 6668
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
31 #define Clk 1000000000
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
32 #define E48 281474976710656.0
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
33 #define E40 1099511627776.0
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
34 #define E32 4294967296.0
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
35 #define E24 16777216.0
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
36 #define E16 65536.0
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
37 #define E8 256.0
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
38
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
39 //==============================================================================
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
40 // Macros
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
41
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
42 #define WORD(Freq,Clk) pow(2,48)*(Freq/Clk)
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
43
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
44 // DDS4xAD9912_Data : the data of crypto class DDS4xAD9912
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
45
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
46 typedef struct {
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
47 double Frequency1 ;
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
48 double Frequency2 ;
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
49 double Frequency3 ;
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
50 double Frequency4 ;
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
51 } DDS4xAD9912_Data ;
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
52
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
53 //==============================================================================
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
54 // Variables
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
55
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
56 char Request[255];
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
57 char Response[255];
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
58 unsigned int hConv;
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
59
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
60
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
61 //==============================================================================
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
62 // Functions
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
63
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
64
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
65 static int DDS4xAD9912_SendCmd(int DDSNum,char *Buffer) ; // essentially a private function, hence the static scope...
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
66 int DDS4xAD9912_SetFrequency(DDS4xAD9912_Data * Instance, int DDSNum, double Freq) ;
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
67 int DDS4xAD9912_Reset(DDS4xAD9912_Data * Instance) ;
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
68 int DDS4xAD9912_FrequencyRampe ( DDS4xAD9912_Data * Instance,int DDSNum, double Frequin,double Frequout, double Step ) ;
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
69
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
70
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
71 #ifdef __cplusplus
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
72 }
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
73 #endif
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
74
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
75 #endif /* ndef __DDS2XAD9858_H__ */
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff changeset
76