wf_handler.h
88 lines
| 2.8 KiB
| text/x-c
|
CLexer
/ header / wf_handler.h
|
r5 | #ifndef WF_HANDLER_H_INCLUDED | ||
#define WF_HANDLER_H_INCLUDED | ||||
|
r45 | #include <rtems.h> | ||
#include <grspw.h> | ||||
#include <stdio.h> | ||||
#include <math.h> | ||||
|
r33 | |||
|
r45 | #include "fsw_params.h" | ||
|
r56 | #include "fsw_spacewire.h" | ||
#include "fsw_misc.h" | ||||
|
r131 | #include "fsw_params_wf_handler.h" | ||
|
r18 | |||
#define pi 3.1415 | ||||
|
r5 | |||
extern int fdSPW; | ||||
|
r87 | |||
//***************** | ||||
// waveform buffers | ||||
|
r172 | extern volatile int wf_buffer_f0[ ]; | ||
extern volatile int wf_buffer_f1[ ]; | ||||
extern volatile int wf_buffer_f2[ ]; | ||||
extern volatile int wf_buffer_f3[ ]; | ||||
|
r38 | extern char wf_cont_f3_light[ ]; | ||
|
r87 | |||
|
r170 | extern waveform_picker_regs_0_1_18_t *waveform_picker_regs; | ||
|
r45 | 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; | ||||
|
r56 | extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; | ||
extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; | ||||
|
r45 | extern rtems_id Task_id[20]; /* array of task ids */ | ||
|
r46 | |||
|
r45 | extern unsigned char lfrCurrentMode; | ||
|
r5 | |||
|
r105 | //********** | ||
// RTEMS_ISR | ||||
|
r106 | void reset_extractSWF( void ); | ||
|
r5 | rtems_isr waveforms_isr( rtems_vector_number vector ); | ||
|
r105 | |||
//*********** | ||||
// RTEMS_TASK | ||||
|
r38 | 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 ); | ||||
|
r105 | rtems_task swbd_task( rtems_task_argument argument ); | ||
|
r5 | |||
|
r17 | //****************** | ||
// general functions | ||||
|
r139 | void WFP_init_rings( void ); | ||
|
r172 | void init_ring( ring_node ring[], unsigned char nbNodes, volatile int buffer[] , unsigned int bufferSize ); | ||
|
r139 | void WFP_reset_current_ring_nodes( void ); | ||
|
r33 | // | ||
|
r92 | int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); | ||
|
r33 | // | ||
|
r172 | int send_waveform_CWF3_light(ring_node *ring_node_to_send, ring_node *ring_node_cwf3_light, rtems_id queue_id ); | ||
|
r45 | // | ||
|
r98 | void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime, | ||
unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime ); | ||||
|
r106 | void build_snapshot_from_ring(ring_node *ring_node_to_send , unsigned char frequencyChannel ); | ||
|
r168 | void snapshot_resynchronization( unsigned char *timePtr ); | ||
|
r93 | // | ||
|
r45 | rtems_id get_pkts_queue_id( void ); | ||
|
r23 | |||
//************** | ||||
// wfp registers | ||||
|
r97 | // RESET | ||
void reset_wfp_burst_enable( void ); | ||||
|
r171 | void reset_wfp_status( void ); | ||
void reset_wfp_buffer_addresses( void ); | ||||
|
r97 | void reset_waveform_picker_regs( void ); | ||
// SET | ||||
void set_wfp_data_shaping(void); | ||||
|
r90 | void set_wfp_burst_enable_register( unsigned char mode ); | ||
|
r97 | 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 ); | ||||
|
r32 | |||
//***************** | ||||
// local parameters | ||||
|
r56 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ); | ||
|
r5 | #endif // WF_HANDLER_H_INCLUDED | ||