|
|
/*------------------------------------------------------------------------------
|
|
|
-- This file is a part of the LFR Offset analysis firmware
|
|
|
-- Copyright (C) 2016, Plasma Physics Laboratory - CNRS
|
|
|
--
|
|
|
-- This program is free software; you can redistribute it and/or modify
|
|
|
-- it under the terms of the GNU General Public License as published by
|
|
|
-- the Free Software Foundation; either version 2 of the License, or
|
|
|
-- (at your option) any later version.
|
|
|
--
|
|
|
-- This program is distributed in the hope that it will be useful,
|
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
-- GNU General Public License for more details.
|
|
|
--
|
|
|
-- You should have received a copy of the GNU General Public License
|
|
|
-- along with this program; if not, write to the Free Software
|
|
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
-------------------------------------------------------------------------------*/
|
|
|
/*-- Author : Alexis Jeandet
|
|
|
-- Mail : alexis.jeandet@lpp.polytechnique.fr
|
|
|
----------------------------------------------------------------------------*/
|
|
|
#include <wfp.h>
|
|
|
|
|
|
|
|
|
void getSnapShotsF0(uint32_t buffer0, uint32_t buffer1,unsigned int NB_Samples, int freq)
|
|
|
{
|
|
|
LFR->WFP.Control.Value=0;
|
|
|
volatile int test = LFR->WFP.STATUS;
|
|
|
LFR->WFP.ADDRESS_F0.ADDR0 = buffer0;
|
|
|
LFR->WFP.ADDRESS_F0.ADDR1 = buffer1;
|
|
|
LFR->WFP.length.FIELDS.length=(NB_Samples*3)/16;
|
|
|
LFR->WFP.Nb_Data_per_buff= NB_Samples-1;
|
|
|
LFR->WFP.Nb_snapshot=NB_Samples;
|
|
|
LFR->WFP.StartDate=(uint32_t)LFR_MANAGMENT->COARSE_TIME + 1;
|
|
|
LFR->WFP.Control.Value = 0x11;
|
|
|
while ((LFR->WFP.STATUS&7)==0) ;
|
|
|
}
|
|
|
|
|
|
void getSnapShotsF1(uint32_t buffer0, uint32_t buffer1, unsigned int NB_Samples, int freq)
|
|
|
{
|
|
|
LFR->WFP.Control.Value=0;
|
|
|
volatile int test = LFR->WFP.STATUS;
|
|
|
LFR->WFP.ADDRESS_F1.ADDR0 = buffer0;
|
|
|
LFR->WFP.ADDRESS_F1.ADDR1 = buffer1;
|
|
|
LFR->WFP.length.FIELDS.length=(NB_Samples*3)/16;
|
|
|
LFR->WFP.Nb_Data_per_buff= NB_Samples-1;
|
|
|
LFR->WFP.Nb_snapshot=NB_Samples;
|
|
|
LFR->WFP.StartDate=(uint32_t)LFR_MANAGMENT->COARSE_TIME + 1;
|
|
|
LFR->WFP.Control.Value = 0x22;
|
|
|
while ((LFR->WFP.STATUS&7)==0) ;
|
|
|
}
|
|
|
|
|
|
void getSnapShotsF2(uint32_t buffer0, uint32_t buffer1, unsigned int NB_Samples, int freq)
|
|
|
{
|
|
|
LFR->WFP.Control.Value=0;
|
|
|
volatile int test = LFR->WFP.STATUS;
|
|
|
LFR->WFP.ADDRESS_F2.ADDR0 = buffer0;
|
|
|
LFR->WFP.ADDRESS_F2.ADDR1 = buffer1;
|
|
|
LFR->WFP.length.FIELDS.length=(NB_Samples*3)/16;
|
|
|
LFR->WFP.Nb_Data_per_buff= NB_Samples-1;
|
|
|
LFR->WFP.Nb_snapshot=NB_Samples;
|
|
|
LFR->WFP.StartDate=(uint32_t)LFR_MANAGMENT->COARSE_TIME + 1;
|
|
|
LFR->WFP.Control.Value = 0x44;
|
|
|
while ((LFR->WFP.STATUS&7)==0) ;
|
|
|
}
|
|
|
|