##// END OF EJS Templates
3.0.0.21...
3.0.0.21 modification in snapshot synchro (some intervals were incorrect) but this was not detectable with the configurations used for the tests values < 22 are forbidden for the snapshot period

File last commit:

r257:132f1c3627d7 R3a
r275:7563e13131aa R3a
Show More
wf_handler.h
89 lines | 2.9 KiB | text/x-c | CLexer
#ifndef WF_HANDLER_H_INCLUDED
#define WF_HANDLER_H_INCLUDED
#include <rtems.h>
#include <grspw.h>
#include <stdio.h>
#include <math.h>
#include <fsw_params.h>
#include "fsw_init.h"
#include "fsw_params_wf_handler.h"
#define pi 3.14159265359
extern int fdSPW;
//*****************
// waveform buffers
extern volatile int wf_buffer_f0[ ];
extern volatile int wf_buffer_f1[ ];
extern volatile int wf_buffer_f2[ ];
extern volatile int wf_buffer_f3[ ];
extern waveform_picker_regs_0_1_18_t *waveform_picker_regs;
extern time_management_regs_t *time_management_regs;
extern Packet_TM_LFR_HK_t housekeeping_packet;
extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
extern struct param_local_str param_local;
extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
extern rtems_id Task_id[20]; /* array of task ids */
extern unsigned char lfrCurrentMode;
//**********
// RTEMS_ISR
void reset_extractSWF( void );
rtems_isr waveforms_isr( rtems_vector_number vector );
//***********
// RTEMS_TASK
rtems_task wfrm_task( rtems_task_argument argument );
rtems_task cwf3_task( rtems_task_argument argument );
rtems_task cwf2_task( rtems_task_argument argument );
rtems_task cwf1_task( rtems_task_argument argument );
rtems_task swbd_task( rtems_task_argument argument );
//******************
// general functions
void WFP_init_rings( void );
void init_ring( ring_node ring[], unsigned char nbNodes, volatile int buffer[] , unsigned int bufferSize );
void WFP_reset_current_ring_nodes( void );
//
int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
//
int send_waveform_CWF3_light(ring_node *ring_node_to_send, ring_node *ring_node_cwf3_light, rtems_id queue_id );
//
void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime,
unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime );
void build_snapshot_from_ring(ring_node *ring_node_to_send, unsigned char frequencyChannel ,
unsigned long long acquisitionTimeF0_asLong, ring_node *ring_node_swf_extracted, int *swf_extracted);
double computeCorrection( unsigned char *timePtr );
void applyCorrection( double correction );
void snapshot_resynchronization( unsigned char *timePtr );
//
rtems_id get_pkts_queue_id( void );
//**************
// wfp registers
// RESET
void reset_wfp_burst_enable( void );
void reset_wfp_status( void );
void reset_wfp_buffer_addresses( void );
void reset_waveform_picker_regs( void );
// SET
void set_wfp_data_shaping(void);
void set_wfp_burst_enable_register( unsigned char mode );
void set_wfp_delta_snapshot( void );
void set_wfp_delta_f0_f0_2( void );
void set_wfp_delta_f1( void );
void set_wfp_delta_f2( void );
//*****************
// local parameters
void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
#endif // WF_HANDLER_H_INCLUDED