chti23/soft/PjtKEIL_DFT_Signal_Reel/Src/principal.c
2023-05-22 11:18:06 +02:00

45 lines
No EOL
1 KiB
C

#include "DriverJeuLaser.h"
extern int DFT_ModuleAuCarre(short int* Signal64ech, char k);
extern int16_t LeSignal;
unsigned int test = 0;
short int dma_buf[64];
int coeff[64];
void mesure() {
Start_DMA1(64);
Wait_On_End_Of_DMA1();
Stop_DMA1;
for (int i = 0; i < 64; i++)
coeff[i] = DFT_ModuleAuCarre(&(dma_buf[0]), i);
}
int main(void)
{
// ===========================================================================
// ============= INIT PERIPH (faites qu'une seule fois) =====================
// ===========================================================================
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
CLOCK_Configure();
Init_TimingADC_ActiveADC_ff(ADC1, 72);
Single_Channel_ADC(ADC1, 2);
Init_Conversion_On_Trig_Timer_ff(ADC1, TIM2_CC2, 225);
Init_ADC1_DMA1(0, dma_buf);
Systick_Period_ff(72000000 * 5 / 1000);
Systick_Prio_IT(0, mesure);
SysTick_On;
SysTick_Enable_IT;
//============================================================================
while (1)
{
}
}