Commit 5ddf572fd3d2d513103c948c3757371ba20eb9e8
1 parent
e41d5220b5
Exists in
master
ad9915.c & ad9915.h : suppression des fonctions softwares
Showing 2 changed files with 0 additions and 136 deletions Side-by-side Diff
include/ad9915.h
... | ... | @@ -81,15 +81,4 @@ |
81 | 81 | |
82 | 82 | //fin fonctions rampes hardwares |
83 | 83 | |
84 | -// fonctions rampes softwares | |
85 | - | |
86 | -int rampAmpFromSoft(int fd, int f_dds,double DeltaTimeUp,double AIni, double AFin); | |
87 | - | |
88 | -int rampPhaseFromSoft(int fd, int f_dds,double DeltaTimeUp,double PhiIni, double PhiFin); | |
89 | - | |
90 | -// fin fonctoins rampes softwares | |
91 | - | |
92 | - | |
93 | - | |
94 | - |
src/ad9915.c
... | ... | @@ -1007,131 +1007,6 @@ |
1007 | 1007 | |
1008 | 1008 | //-------------------------FIN FONCTIONS RAMPES HARDWARES |
1009 | 1009 | |
1010 | -//--------------------------FONCTIONS RAMPES SOFTWARES | |
1011 | - | |
1012 | -int rampAmpFromSoft(int fd, int f_dds,double DeltaTimeUp,double AIni, double AFin) | |
1013 | -{ | |
1014 | - | |
1015 | - //On va plutôt fixé dA sinon trop de contrainte : => Besoin d'allocation dynamique | |
1016 | - double dA=0.024;//en % | |
1017 | - double DeltaAmp = AIni-AFin; | |
1018 | - double AbsDeltaAmp = 0; | |
1019 | - if(DeltaAmp>=0) | |
1020 | - { | |
1021 | - AbsDeltaAmp = DeltaAmp; | |
1022 | - } | |
1023 | - else | |
1024 | - { | |
1025 | - AbsDeltaAmp = -1*DeltaAmp; | |
1026 | - } | |
1027 | - | |
1028 | - int NumberPoints = AbsDeltaAmp/dA; | |
1029 | - | |
1030 | - double dt=DeltaTimeUp/NumberPoints; | |
1031 | - | |
1032 | - printf("Taille du tableau = %d\n", NumberPoints); | |
1033 | - printf("dt = %f s\n",dt); | |
1034 | - | |
1035 | - | |
1036 | - uint16_t* ArrayWordAmp= NULL; | |
1037 | - ArrayWordAmp = malloc(NumberPoints*sizeof(uint16_t)); | |
1038 | - | |
1039 | - //extraction de la phase initiale et de l'amplitude | |
1040 | - | |
1041 | - uint32_t ReadPhaseAmpWord = 0x00000000; | |
1042 | - readRegister(fd, 0x0c,&ReadPhaseAmpWord); | |
1043 | - printf("ReadPhaseAmpWord = %.8x \n", ReadPhaseAmpWord); | |
1044 | - | |
1045 | - uint16_t WordPhaseInitiale = ReadPhaseAmpWord&0xFFFF; | |
1046 | - printf("Phase = %.4x \n", WordPhaseInitiale); | |
1047 | - | |
1048 | - | |
1049 | - // | |
1050 | - for(int i=0;i<NumberPoints;i++) | |
1051 | - { | |
1052 | - ArrayWordAmp[i]=rint((AIni+i*dA)*4096/100); | |
1053 | - // printf("ArrayWordAmp[%d] = %.16x\n", i, ArrayWordAmp[i]); | |
1054 | - } | |
1055 | - free(ArrayWordAmp); | |
1056 | - | |
1057 | - printf("Array calculated\n"); | |
1058 | - | |
1059 | - printf("Start of the ramp\n"); | |
1060 | - for(int i=0;i<NumberPoints;i++) | |
1061 | - { | |
1062 | - writeRegister(fd,0x0c,ArrayWordAmp[i]>>8&0xFF,ArrayWordAmp[i]&0xFF,WordPhaseInitiale>>8&0xFF,WordPhaseInitiale&0xFF); | |
1063 | - sendIOUpdate(f_dds); | |
1064 | - usleep(1000000*dt); | |
1065 | - } | |
1066 | - | |
1067 | - | |
1068 | - | |
1069 | - | |
1070 | - return EXIT_SUCCESS; | |
1071 | -} | |
1072 | - | |
1073 | -int rampPhaseFromSoft(int fd, int f_dds,double DeltaTimeUp,double PhiIni, double PhiFin) | |
1074 | -{ | |
1075 | - | |
1076 | - //On va plutôt fixé dphi : => Besoin d'allocation dynamique | |
1077 | - double dphi=0.06;//en ° | |
1078 | - double DeltaPhi = PhiIni-PhiFin; | |
1079 | - double AbsDeltaPhi = 0; | |
1080 | - if(DeltaPhi>=0) | |
1081 | - { | |
1082 | - AbsDeltaPhi = DeltaPhi; | |
1083 | - } | |
1084 | - else | |
1085 | - { | |
1086 | - AbsDeltaPhi = -1*DeltaPhi; | |
1087 | - } | |
1088 | - | |
1089 | - int NumberPoints = AbsDeltaPhi/dphi; | |
1090 | - | |
1091 | - double dt=DeltaTimeUp/NumberPoints; | |
1092 | - | |
1093 | - printf("Taille du tableau = %d\n", NumberPoints); | |
1094 | - printf("dt = %f s\n",dt); | |
1095 | - | |
1096 | - | |
1097 | - uint16_t* ArrayWordPhi= NULL; | |
1098 | - ArrayWordPhi = malloc(NumberPoints*sizeof(uint16_t)); | |
1099 | - | |
1100 | - //extraction de l'amplitude | |
1101 | - | |
1102 | - uint32_t ReadPhaseAmpWord = 0x00000000; | |
1103 | - readRegister(fd, 0x0c,&ReadPhaseAmpWord); | |
1104 | - printf("ReadPhaseAmpWord = %.8x \n", ReadPhaseAmpWord); | |
1105 | - | |
1106 | - uint16_t WordAmpInitiale = ReadPhaseAmpWord>>16&0xFFFF; | |
1107 | - printf("Amp = %.4x \n", WordAmpInitiale); | |
1108 | - | |
1109 | - | |
1110 | - for(int i=0;i<NumberPoints;i++) | |
1111 | - { | |
1112 | - ArrayWordPhi[i]=rint((PhiIni+i*dphi)*65536/360); | |
1113 | - } | |
1114 | - free(ArrayWordPhi); | |
1115 | - | |
1116 | - printf("Array calculated\n"); | |
1117 | - | |
1118 | - printf("Start of the ramp\n"); | |
1119 | - for(int i=0;i<NumberPoints;i++) | |
1120 | - { | |
1121 | - writeRegister(fd,0x0c,WordAmpInitiale>>8&0xFF,WordAmpInitiale&0xFF,ArrayWordPhi[i]>>8&0xFF,ArrayWordPhi[i]&0xFF); | |
1122 | - sendIOUpdate(f_dds); | |
1123 | - usleep(1000000*dt); | |
1124 | - } | |
1125 | - | |
1126 | - | |
1127 | - return EXIT_SUCCESS; | |
1128 | -} | |
1129 | - | |
1130 | - | |
1131 | - | |
1132 | -//-------------------------FIN FONCTIONS RAMPES SOFTWARES | |
1133 | - | |
1134 | - | |
1135 | 1010 | |
1136 | 1011 | |
1137 | 1012 | int receiveParameterFromPythonServer(char * device, double f_clk, double f_out){ |