##// END OF EJS Templates
Many corrections, mainly related to 807 Don_Enumeration
paul -
r318:d3701d39af11 R3_plus draft
parent child
Show More
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 3e4216a0e6981bead8bcb201012ebadb53f60dff header/lfr_common_headers
2 6bab694410c69700e3455ffba21ce58dbb4da870 header/lfr_common_headers
@@ -1,109 +1,131
1 #ifndef FSW_MISC_H_INCLUDED
1 #ifndef FSW_MISC_H_INCLUDED
2 #define FSW_MISC_H_INCLUDED
2 #define FSW_MISC_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <stdio.h>
5 #include <stdio.h>
6 #include <grspw.h>
6 #include <grspw.h>
7 #include <grlib_regs.h>
7 #include <grlib_regs.h>
8
8
9 #include "fsw_params.h"
9 #include "fsw_params.h"
10 #include "fsw_spacewire.h"
10 #include "fsw_spacewire.h"
11 #include "lfr_cpu_usage_report.h"
11 #include "lfr_cpu_usage_report.h"
12
12
13 #define LFR_RESET_CAUSE_UNKNOWN_CAUSE 0
14 #define WATCHDOG_LOOP_PRINTF 10
15 #define WATCHDOG_LOOP_DEBUG 3
16
17 #define DUMB_MESSAGE_NB 15
18 #define NB_RTEMS_EVENTS 32
19 #define EVENT_12 12
20 #define EVENT_13 13
21 #define EVENT_14 14
22 #define DUMB_MESSAGE_0 "in DUMB *** default"
23 #define DUMB_MESSAGE_1 "in DUMB *** timecode_irq_handler"
24 #define DUMB_MESSAGE_2 "in DUMB *** f3 buffer changed"
25 #define DUMB_MESSAGE_3 "in DUMB *** in SMIQ *** Error sending event to AVF0"
26 #define DUMB_MESSAGE_4 "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ"
27 #define DUMB_MESSAGE_5 "in DUMB *** waveforms_simulator_isr"
28 #define DUMB_MESSAGE_6 "VHDL SM *** two buffers f0 ready"
29 #define DUMB_MESSAGE_7 "ready for dump"
30 #define DUMB_MESSAGE_8 "VHDL ERR *** spectral matrix"
31 #define DUMB_MESSAGE_9 "tick"
32 #define DUMB_MESSAGE_10 "VHDL ERR *** waveform picker"
33 #define DUMB_MESSAGE_11 "VHDL ERR *** unexpected ready matrix values"
34 #define DUMB_MESSAGE_12 "WATCHDOG timer"
35 #define DUMB_MESSAGE_13 "TIMECODE timer"
36 #define DUMB_MESSAGE_14 "TIMECODE ISR"
13
37
14 enum lfr_reset_cause_t{
38 enum lfr_reset_cause_t{
15 UNKNOWN_CAUSE,
39 UNKNOWN_CAUSE,
16 POWER_ON,
40 POWER_ON,
17 TC_RESET,
41 TC_RESET,
18 WATCHDOG,
42 WATCHDOG,
19 ERROR_RESET,
43 ERROR_RESET,
20 UNEXP_RESET
44 UNEXP_RESET
21 };
45 };
22
46
23 typedef struct{
47 typedef struct{
24 unsigned char dpu_spw_parity;
48 unsigned char dpu_spw_parity;
25 unsigned char dpu_spw_disconnect;
49 unsigned char dpu_spw_disconnect;
26 unsigned char dpu_spw_escape;
50 unsigned char dpu_spw_escape;
27 unsigned char dpu_spw_credit;
51 unsigned char dpu_spw_credit;
28 unsigned char dpu_spw_write_sync;
52 unsigned char dpu_spw_write_sync;
29 unsigned char timecode_erroneous;
53 unsigned char timecode_erroneous;
30 unsigned char timecode_missing;
54 unsigned char timecode_missing;
31 unsigned char timecode_invalid;
55 unsigned char timecode_invalid;
32 unsigned char time_timecode_it;
56 unsigned char time_timecode_it;
33 unsigned char time_not_synchro;
57 unsigned char time_not_synchro;
34 unsigned char time_timecode_ctr;
58 unsigned char time_timecode_ctr;
35 unsigned char ahb_correctable;
59 unsigned char ahb_correctable;
36 } hk_lfr_le_t;
60 } hk_lfr_le_t;
37
61
38 typedef struct{
62 typedef struct{
39 unsigned char dpu_spw_early_eop;
63 unsigned char dpu_spw_early_eop;
40 unsigned char dpu_spw_invalid_addr;
64 unsigned char dpu_spw_invalid_addr;
41 unsigned char dpu_spw_eep;
65 unsigned char dpu_spw_eep;
42 unsigned char dpu_spw_rx_too_big;
66 unsigned char dpu_spw_rx_too_big;
43 } hk_lfr_me_t;
67 } hk_lfr_me_t;
44
68
45 extern gptimer_regs_t *gptimer_regs;
69 extern gptimer_regs_t *gptimer_regs;
46 extern void ASR16_get_FPRF_IURF_ErrorCounters( unsigned int*, unsigned int* );
70 extern void ASR16_get_FPRF_IURF_ErrorCounters( unsigned int*, unsigned int* );
47 extern void CCR_getInstructionAndDataErrorCounters( unsigned int*, unsigned int* );
71 extern void CCR_getInstructionAndDataErrorCounters( unsigned int*, unsigned int* );
48
72
49 #define LFR_RESET_CAUSE_UNKNOWN_CAUSE 0
50
51 rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
73 rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
52 rtems_id HK_id; // id of the HK rate monotonic period
74 rtems_id HK_id; // id of the HK rate monotonic period
53 rtems_name name_avgv_rate_monotonic; // name of the AVGV rate monotonic
75 rtems_name name_avgv_rate_monotonic; // name of the AVGV rate monotonic
54 rtems_id AVGV_id; // id of the AVGV rate monotonic period
76 rtems_id AVGV_id; // id of the AVGV rate monotonic period
55
77
56 void timer_configure( unsigned char timer, unsigned int clock_divider,
78 void timer_configure( unsigned char timer, unsigned int clock_divider,
57 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
79 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
58 void timer_start( unsigned char timer );
80 void timer_start( unsigned char timer );
59 void timer_stop( unsigned char timer );
81 void timer_stop( unsigned char timer );
60 void timer_set_clock_divider(unsigned char timer, unsigned int clock_divider);
82 void timer_set_clock_divider(unsigned char timer, unsigned int clock_divider);
61
83
62 // WATCHDOG
84 // WATCHDOG
63 rtems_isr watchdog_isr( rtems_vector_number vector );
85 rtems_isr watchdog_isr( rtems_vector_number vector );
64 void watchdog_configure(void);
86 void watchdog_configure(void);
65 void watchdog_stop(void);
87 void watchdog_stop(void);
66 void watchdog_reload(void);
88 void watchdog_reload(void);
67 void watchdog_start(void);
89 void watchdog_start(void);
68
90
69 // SERIAL LINK
91 // SERIAL LINK
70 int send_console_outputs_on_apbuart_port( void );
92 int send_console_outputs_on_apbuart_port( void );
71 int enable_apbuart_transmitter( void );
93 int enable_apbuart_transmitter( void );
72 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
94 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
73
95
74 // RTEMS TASKS
96 // RTEMS TASKS
75 rtems_task load_task( rtems_task_argument argument );
97 rtems_task load_task( rtems_task_argument argument );
76 rtems_task hous_task( rtems_task_argument argument );
98 rtems_task hous_task( rtems_task_argument argument );
77 rtems_task avgv_task( rtems_task_argument argument );
99 rtems_task avgv_task( rtems_task_argument argument );
78 rtems_task dumb_task( rtems_task_argument unused );
100 rtems_task dumb_task( rtems_task_argument unused );
79
101
80 void init_housekeeping_parameters( void );
102 void init_housekeeping_parameters( void );
81 void increment_seq_counter(unsigned short *packetSequenceControl);
103 void increment_seq_counter(unsigned short *packetSequenceControl);
82 void getTime( unsigned char *time);
104 void getTime( unsigned char *time);
83 unsigned long long int getTimeAsUnsignedLongLongInt( );
105 unsigned long long int getTimeAsUnsignedLongLongInt( );
84 void send_dumb_hk( void );
106 void send_dumb_hk( void );
85 void get_temperatures( unsigned char *temperatures );
107 void get_temperatures( unsigned char *temperatures );
86 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
108 void get_v_e1_e2_f3( unsigned char *spacecraft_potential );
87 void get_cpu_load( unsigned char *resource_statistics );
109 void get_cpu_load( unsigned char *resource_statistics );
88 void set_hk_lfr_sc_potential_flag( bool state );
110 void set_hk_lfr_sc_potential_flag( bool state );
89 void set_sy_lfr_pas_filter_enabled( bool state );
111 void set_sy_lfr_pas_filter_enabled( bool state );
90 void set_sy_lfr_watchdog_enabled( bool state );
112 void set_sy_lfr_watchdog_enabled( bool state );
91 void set_hk_lfr_calib_enable( bool state );
113 void set_hk_lfr_calib_enable( bool state );
92 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
114 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause );
93 void hk_lfr_le_me_he_update();
115 void hk_lfr_le_me_he_update();
94 void set_hk_lfr_time_not_synchro();
116 void set_hk_lfr_time_not_synchro();
95
117
96 extern int sched_yield( void );
118 extern int sched_yield( void );
97 extern void rtems_cpu_usage_reset();
119 extern void rtems_cpu_usage_reset();
98 extern ring_node *current_ring_node_f3;
120 extern ring_node *current_ring_node_f3;
99 extern ring_node *ring_node_to_send_cwf_f3;
121 extern ring_node *ring_node_to_send_cwf_f3;
100 extern ring_node waveform_ring_f3[];
122 extern ring_node waveform_ring_f3[];
101 extern unsigned short sequenceCounterHK;
123 extern unsigned short sequenceCounterHK;
102
124
103 extern unsigned char hk_lfr_q_sd_fifo_size_max;
125 extern unsigned char hk_lfr_q_sd_fifo_size_max;
104 extern unsigned char hk_lfr_q_rv_fifo_size_max;
126 extern unsigned char hk_lfr_q_rv_fifo_size_max;
105 extern unsigned char hk_lfr_q_p0_fifo_size_max;
127 extern unsigned char hk_lfr_q_p0_fifo_size_max;
106 extern unsigned char hk_lfr_q_p1_fifo_size_max;
128 extern unsigned char hk_lfr_q_p1_fifo_size_max;
107 extern unsigned char hk_lfr_q_p2_fifo_size_max;
129 extern unsigned char hk_lfr_q_p2_fifo_size_max;
108
130
109 #endif // FSW_MISC_H_INCLUDED
131 #endif // FSW_MISC_H_INCLUDED
@@ -1,59 +1,68
1 #ifndef FSW_SPACEWIRE_H_INCLUDED
1 #ifndef FSW_SPACEWIRE_H_INCLUDED
2 #define FSW_SPACEWIRE_H_INCLUDED
2 #define FSW_SPACEWIRE_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <grspw.h>
5 #include <grspw.h>
6
6
7 #include <fcntl.h> // for O_RDWR
7 #include <fcntl.h> // for O_RDWR
8 #include <unistd.h> // for the read call
8 #include <unistd.h> // for the read call
9 #include <sys/ioctl.h> // for the ioctl call
9 #include <sys/ioctl.h> // for the ioctl call
10 #include <errno.h>
10 #include <errno.h>
11
11
12 #include "fsw_params.h"
12 #include "fsw_params.h"
13 #include "tc_handler.h"
13 #include "tc_handler.h"
14 #include "fsw_init.h"
14 #include "fsw_init.h"
15
15
16 #define SPW_LINK_OK 5
17 #define CONF_TCODE_CTRL 0x0909 // [Time Rx : Time Tx : Link error : Tick-out IRQ]
18 #define SPW_BIT_NP 0x00100000 // [NP] set the No port force bit
19 #define SPW_BIT_NP_MASK 0xffdfffff
20 #define SPW_BIT_RE 0x00010000 // [RE] set the RMAP Enable bit
21 #define SPW_BIT_RE_MASK 0xfffdffff
22 #define SPW_LINK_STAT_POS 21
23 #define SPW_TIMECODE_MAX 63
24
16 extern spw_stats grspw_stats;
25 extern spw_stats grspw_stats;
17 extern rtems_name timecode_timer_name;
26 extern rtems_name timecode_timer_name;
18 extern rtems_id timecode_timer_id;
27 extern rtems_id timecode_timer_id;
19 extern unsigned char oneTcLfrUpdateTimeReceived;
28 extern unsigned char oneTcLfrUpdateTimeReceived;
20
29
21 // RTEMS TASK
30 // RTEMS TASK
22 rtems_task spiq_task( rtems_task_argument argument );
31 rtems_task spiq_task( rtems_task_argument argument );
23 rtems_task recv_task( rtems_task_argument unused );
32 rtems_task recv_task( rtems_task_argument unused );
24 rtems_task send_task( rtems_task_argument argument );
33 rtems_task send_task( rtems_task_argument argument );
25 rtems_task link_task( rtems_task_argument argument );
34 rtems_task link_task( rtems_task_argument argument );
26
35
27 int spacewire_open_link( void );
36 int spacewire_open_link( void );
28 int spacewire_start_link( int fd );
37 int spacewire_start_link( int fd );
29 int spacewire_stop_and_start_link( int fd );
38 int spacewire_stop_and_start_link( int fd );
30 int spacewire_configure_link(int fd );
39 int spacewire_configure_link(int fd );
31 int spacewire_several_connect_attemps( void );
40 int spacewire_several_connect_attemps( void );
32 void spacewire_set_NP( unsigned char val, unsigned int regAddr ); // No Port force
41 void spacewire_set_NP( unsigned char val, unsigned int regAddr ); // No Port force
33 void spacewire_set_RE( unsigned char val, unsigned int regAddr ); // RMAP Enable
42 void spacewire_set_RE( unsigned char val, unsigned int regAddr ); // RMAP Enable
34 void spacewire_read_statistics( void );
43 void spacewire_read_statistics( void );
35 void spacewire_get_last_error( void );
44 void spacewire_get_last_error( void );
36 void update_hk_lfr_last_er_fields(unsigned int rid, unsigned char code);
45 void update_hk_lfr_last_er_fields(unsigned int rid, unsigned char code);
37 void update_hk_with_grspw_stats(void );
46 void update_hk_with_grspw_stats(void );
38 void spacewire_update_hk_lfr_link_state( unsigned char *hk_lfr_status_word_0 );
47 void spacewire_update_hk_lfr_link_state( unsigned char *hk_lfr_status_word_0 );
39 void increase_unsigned_char_counter( unsigned char *counter );
48 void increase_unsigned_char_counter( unsigned char *counter );
40
49
41 void init_header_cwf( Header_TM_LFR_SCIENCE_CWF_t *header );
50 void init_header_cwf( Header_TM_LFR_SCIENCE_CWF_t *header );
42 void init_header_swf( Header_TM_LFR_SCIENCE_SWF_t *header );
51 void init_header_swf( Header_TM_LFR_SCIENCE_SWF_t *header );
43 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header );
52 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header );
44 int spw_send_waveform_CWF( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_CWF_t *header );
53 int spw_send_waveform_CWF( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_CWF_t *header );
45 int spw_send_waveform_SWF( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_SWF_t *header );
54 int spw_send_waveform_SWF( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_SWF_t *header );
46 int spw_send_waveform_CWF3_light( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_CWF_t *header );
55 int spw_send_waveform_CWF3_light( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_CWF_t *header );
47 void spw_send_asm_f0( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_ASM_t *header );
56 void spw_send_asm_f0( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_ASM_t *header );
48 void spw_send_asm_f1( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_ASM_t *header );
57 void spw_send_asm_f1( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_ASM_t *header );
49 void spw_send_asm_f2( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_ASM_t *header );
58 void spw_send_asm_f2( ring_node *ring_node_to_send, Header_TM_LFR_SCIENCE_ASM_t *header );
50 void spw_send_k_dump( ring_node *ring_node_to_send );
59 void spw_send_k_dump( ring_node *ring_node_to_send );
51
60
52 unsigned int check_timecode_and_previous_timecode_coherency(unsigned char currentTimecodeCtr);
61 unsigned int check_timecode_and_previous_timecode_coherency(unsigned char currentTimecodeCtr);
53 unsigned int check_timecode_and_internal_time_coherency(unsigned char timecode, unsigned char internalTime);
62 unsigned int check_timecode_and_internal_time_coherency(unsigned char timecode, unsigned char internalTime);
54 void timecode_irq_handler( void *pDev, void *regs, int minor, unsigned int tc );
63 void timecode_irq_handler( void *pDev, void *regs, int minor, unsigned int tc );
55 rtems_timer_service_routine timecode_timer_routine( rtems_id timer_id, void *user_data );
64 rtems_timer_service_routine timecode_timer_routine( rtems_id timer_id, void *user_data );
56
65
57 void (*grspw_timecode_callback) ( void *pDev, void *regs, int minor, unsigned int tc );
66 void (*grspw_timecode_callback) ( void *pDev, void *regs, int minor, unsigned int tc );
58
67
59 #endif // FSW_SPACEWIRE_H_INCLUDED
68 #endif // FSW_SPACEWIRE_H_INCLUDED
@@ -1,138 +1,231
1 #ifndef GRLIB_REGS_H_INCLUDED
1 #ifndef GRLIB_REGS_H_INCLUDED
2 #define GRLIB_REGS_H_INCLUDED
2 #define GRLIB_REGS_H_INCLUDED
3
3
4 #define NB_GPTIMER 3
4 #define NB_GPTIMER 3
5
5
6 struct apbuart_regs_str{
6 struct apbuart_regs_str{
7 volatile unsigned int data;
7 volatile unsigned int data;
8 volatile unsigned int status;
8 volatile unsigned int status;
9 volatile unsigned int ctrl;
9 volatile unsigned int ctrl;
10 volatile unsigned int scaler;
10 volatile unsigned int scaler;
11 volatile unsigned int fifoDebug;
11 volatile unsigned int fifoDebug;
12 };
12 };
13
13
14 struct grgpio_regs_str{
14 struct grgpio_regs_str{
15 volatile int io_port_data_register;
15 volatile int io_port_data_register;
16 int io_port_output_register;
16 int io_port_output_register;
17 int io_port_direction_register;
17 int io_port_direction_register;
18 int interrupt_mak_register;
18 int interrupt_mak_register;
19 int interrupt_polarity_register;
19 int interrupt_polarity_register;
20 int interrupt_edge_register;
20 int interrupt_edge_register;
21 int bypass_register;
21 int bypass_register;
22 int reserved;
22 int reserved;
23 // 0x20-0x3c interrupt map register(s)
23 // 0x20-0x3c interrupt map register(s)
24 };
24 };
25
25
26 typedef struct {
26 typedef struct {
27 volatile unsigned int counter;
27 volatile unsigned int counter;
28 volatile unsigned int reload;
28 volatile unsigned int reload;
29 volatile unsigned int ctrl;
29 volatile unsigned int ctrl;
30 volatile unsigned int unused;
30 volatile unsigned int unused;
31 } timer_regs_t;
31 } timer_regs_t;
32
32
33 //*************
34 //*************
35 // GPTIMER_REGS
36
37 #define GPTIMER_CLEAR_IRQ 0x00000010 // clear pending IRQ if any
38 #define GPTIMER_LD 0x00000004 // LD load value from the reload register
39 #define GPTIMER_EN 0x00000001 // EN enable the timer
40 #define GPTIMER_EN_MASK 0xfffffffe // EN enable the timer
41 #define GPTIMER_RS 0x00000002 // RS restart
42 #define GPTIMER_IE 0x00000008 // IE interrupt enable
43 #define GPTIMER_IE_MASK 0xffffffef // IE interrupt enable
44
33 typedef struct {
45 typedef struct {
34 volatile unsigned int scaler_value;
46 volatile unsigned int scaler_value;
35 volatile unsigned int scaler_reload;
47 volatile unsigned int scaler_reload;
36 volatile unsigned int conf;
48 volatile unsigned int conf;
37 volatile unsigned int unused0;
49 volatile unsigned int unused0;
38 timer_regs_t timer[NB_GPTIMER];
50 timer_regs_t timer[NB_GPTIMER];
39 } gptimer_regs_t;
51 } gptimer_regs_t;
40
52
53 //*********************
54 //*********************
55 // TIME_MANAGEMENT_REGS
56
57 #define VAL_SOFTWARE_RESET 0x02 // [0010] software reset
58 #define VAL_LFR_SYNCHRONIZED 0x80000000
59 #define BIT_SYNCHRONIZATION 31
60 #define COARSE_TIME_MASK 0x7fffffff
61 #define SYNC_BIT_MASK 0x7f
62 #define SYNC_BIT 0x80
63 #define BIT_CAL_RELOAD 0x00000010
64 #define MASK_CAL_RELOAD 0xffffffef // [1110 1111]
65 #define BIT_CAL_ENABLE 0x00000040
66 #define MASK_CAL_ENABLE 0xffffffbf // [1011 1111]
67 #define BIT_SET_INTERLEAVED 0x00000020 // [0010 0000]
68 #define MASK_SET_INTERLEAVED 0xffffffdf // [1101 1111]
69 #define BIT_SOFT_RESET 0x00000004 // [0100]
70 #define MASK_SOFT_RESET 0xfffffffb // [1011]
71
41 typedef struct {
72 typedef struct {
42 volatile int ctrl; // bit 0 forces the load of the coarse_time_load value and resets the fine_time
73 volatile int ctrl; // bit 0 forces the load of the coarse_time_load value and resets the fine_time
43 // bit 1 is the soft reset for the time management module
74 // bit 1 is the soft reset for the time management module
44 // bit 2 is the soft reset for the waveform picker and the spectral matrix modules, set to 1 after HW reset
75 // bit 2 is the soft reset for the waveform picker and the spectral matrix modules, set to 1 after HW reset
45 volatile int coarse_time_load;
76 volatile int coarse_time_load;
46 volatile int coarse_time;
77 volatile int coarse_time;
47 volatile int fine_time;
78 volatile int fine_time;
48 // TEMPERATURES
79 // TEMPERATURES
49 volatile int temp_pcb; // SEL1 = 0 SEL0 = 0
80 volatile int temp_pcb; // SEL1 = 0 SEL0 = 0
50 volatile int temp_fpga; // SEL1 = 0 SEL0 = 1
81 volatile int temp_fpga; // SEL1 = 0 SEL0 = 1
51 volatile int temp_scm; // SEL1 = 1 SEL0 = 0
82 volatile int temp_scm; // SEL1 = 1 SEL0 = 0
52 // CALIBRATION
83 // CALIBRATION
53 volatile unsigned int calDACCtrl;
84 volatile unsigned int calDACCtrl;
54 volatile unsigned int calPrescaler;
85 volatile unsigned int calPrescaler;
55 volatile unsigned int calDivisor;
86 volatile unsigned int calDivisor;
56 volatile unsigned int calDataPtr;
87 volatile unsigned int calDataPtr;
57 volatile unsigned int calData;
88 volatile unsigned int calData;
58 } time_management_regs_t;
89 } time_management_regs_t;
59
90
91 //*********************
92 //*********************
93 // WAVEFORM_PICKER_REGS
94
95 #define BITS_WFP_STATUS_F3 0xc0 // [1100 0000] check the f3 full bits
96 #define BIT_WFP_BUF_F3_0 0x40 // [0100 0000] f3 buffer 0 is full
97 #define BIT_WFP_BUF_F3_1 0x80 // [1000 0000] f3 buffer 1 is full
98 #define RST_WFP_F3_0 0x00008840 // [1000 1000 0100 0000]
99 #define RST_WFP_F3_1 0x00008880 // [1000 1000 1000 0000]
100
101 #define BITS_WFP_STATUS_F2 0x30 // [0011 0000] get the status bits for f2
102 #define SHIFT_WFP_STATUS_F2 4
103 #define BIT_WFP_BUF_F2_0 0x10 // [0001 0000] f2 buffer 0 is full
104 #define BIT_WFP_BUF_F2_1 0x20 // [0010 0000] f2 buffer 1 is full
105 #define RST_WFP_F2_0 0x00004410 // [0100 0100 0001 0000]
106 #define RST_WFP_F2_1 0x00004420 // [0100 0100 0010 0000]
107
108 #define BITS_WFP_STATUS_F1 0x0c // [0000 1100] check the f1 full bits
109 #define BIT_WFP_BUF_F1_0 0x04 // [0000 0100] f1 buffer 0 is full
110 #define BIT_WFP_BUF_F1_1 0x08 // [0000 1000] f1 buffer 1 is full
111 #define RST_WFP_F1_0 0x00002204 // [0010 0010 0000 0100] f1 bits = 0
112 #define RST_WFP_F1_1 0x00002208 // [0010 0010 0000 1000] f1 bits = 0
113
114 #define BITS_WFP_STATUS_F0 0x03 // [0000 0011] check the f0 full bits
115 #define RST_WFP_F0_0 0x00001101 // [0001 0001 0000 0001]
116 #define RST_WFP_F0_1 0x00001102 // [0001 0001 0000 0010]
117
118 #define BIT_WFP_BUFFER_0 0x01
119 #define BIT_WFP_BUFFER_1 0x02
120
121 #define RST_BITS_RUN_BURST_EN 0x80 // [1000 0000] burst f2, f1, f0 enable f3, f2, f1, f0
122 #define RUN_BURST_ENABLE_SBM2 0x60 // [0110 0000] enable f2 and f1 burst
123 #define RUN_BURST_ENABLE_BURST 0x40 // [0100 0000] f2 burst enabled
124
125 #define DFLT_WFP_NB_DATA_BY_BUFFER 0xa7f // 0x30 *** 2688 - 1 => nb samples -1
126 #define DFLT_WFP_SNAPSHOT_PARAM 0xa80 // 0x34 *** 2688 => nb samples
127 #define DFLT_WFP_BUFFER_LENGTH 0x1f8 // buffer length in burst = 3 * 2688 / 16 = 504 = 0x1f8
128 #define DFLT_WFP_DELTA_F0_2 0x30 // 48 = 11 0000, max 7 bits
129
60 // PDB >= 0.1.28, 0x80000f54
130 // PDB >= 0.1.28, 0x80000f54
61 typedef struct{
131 typedef struct{
62 int data_shaping; // 0x00 00 *** R2 R1 R0 SP1 SP0 BW
132 int data_shaping; // 0x00 00 *** R2 R1 R0 SP1 SP0 BW
63 int run_burst_enable; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
133 int run_burst_enable; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
64 int addr_data_f0_0; // 0x08
134 int addr_data_f0_0; // 0x08
65 int addr_data_f0_1; // 0x0c
135 int addr_data_f0_1; // 0x0c
66 int addr_data_f1_0; // 0x10
136 int addr_data_f1_0; // 0x10
67 int addr_data_f1_1; // 0x14
137 int addr_data_f1_1; // 0x14
68 int addr_data_f2_0; // 0x18
138 int addr_data_f2_0; // 0x18
69 int addr_data_f2_1; // 0x1c
139 int addr_data_f2_1; // 0x1c
70 int addr_data_f3_0; // 0x20
140 int addr_data_f3_0; // 0x20
71 int addr_data_f3_1; // 0x24
141 int addr_data_f3_1; // 0x24
72 volatile int status; // 0x28
142 volatile int status; // 0x28
73 volatile int delta_snapshot; // 0x2c
143 volatile int delta_snapshot; // 0x2c
74 int delta_f0; // 0x30
144 int delta_f0; // 0x30
75 int delta_f0_2; // 0x34
145 int delta_f0_2; // 0x34
76 int delta_f1; // 0x38
146 int delta_f1; // 0x38
77 int delta_f2; // 0x3c
147 int delta_f2; // 0x3c
78 int nb_data_by_buffer; // 0x40 number of samples in a buffer = 2688
148 int nb_data_by_buffer; // 0x40 number of samples in a buffer = 2688
79 int snapshot_param; // 0x44
149 int snapshot_param; // 0x44
80 int start_date; // 0x48
150 int start_date; // 0x48
81 //
151 //
82 volatile unsigned int f0_0_coarse_time; // 0x4c
152 volatile unsigned int f0_0_coarse_time; // 0x4c
83 volatile unsigned int f0_0_fine_time; // 0x50
153 volatile unsigned int f0_0_fine_time; // 0x50
84 volatile unsigned int f0_1_coarse_time; // 0x54
154 volatile unsigned int f0_1_coarse_time; // 0x54
85 volatile unsigned int f0_1_fine_time; // 0x58
155 volatile unsigned int f0_1_fine_time; // 0x58
86 //
156 //
87 volatile unsigned int f1_0_coarse_time; // 0x5c
157 volatile unsigned int f1_0_coarse_time; // 0x5c
88 volatile unsigned int f1_0_fine_time; // 0x60
158 volatile unsigned int f1_0_fine_time; // 0x60
89 volatile unsigned int f1_1_coarse_time; // 0x64
159 volatile unsigned int f1_1_coarse_time; // 0x64
90 volatile unsigned int f1_1_fine_time; // 0x68
160 volatile unsigned int f1_1_fine_time; // 0x68
91 //
161 //
92 volatile unsigned int f2_0_coarse_time; // 0x6c
162 volatile unsigned int f2_0_coarse_time; // 0x6c
93 volatile unsigned int f2_0_fine_time; // 0x70
163 volatile unsigned int f2_0_fine_time; // 0x70
94 volatile unsigned int f2_1_coarse_time; // 0x74
164 volatile unsigned int f2_1_coarse_time; // 0x74
95 volatile unsigned int f2_1_fine_time; // 0x78
165 volatile unsigned int f2_1_fine_time; // 0x78
96 //
166 //
97 volatile unsigned int f3_0_coarse_time; // 0x7c => 0x7c + 0xf54 = 0xd0
167 volatile unsigned int f3_0_coarse_time; // 0x7c => 0x7c + 0xf54 = 0xd0
98 volatile unsigned int f3_0_fine_time; // 0x80
168 volatile unsigned int f3_0_fine_time; // 0x80
99 volatile unsigned int f3_1_coarse_time; // 0x84
169 volatile unsigned int f3_1_coarse_time; // 0x84
100 volatile unsigned int f3_1_fine_time; // 0x88
170 volatile unsigned int f3_1_fine_time; // 0x88
101 //
171 //
102 unsigned int buffer_length; // 0x8c = buffer length in burst 2688 / 16 = 168
172 unsigned int buffer_length; // 0x8c = buffer length in burst 2688 / 16 = 168
103 //
173 //
104 volatile unsigned int v; // 0x90
174 volatile unsigned int v; // 0x90
105 volatile unsigned int e1; // 0x94
175 volatile unsigned int e1; // 0x94
106 volatile unsigned int e2; // 0x98
176 volatile unsigned int e2; // 0x98
107 } waveform_picker_regs_0_1_18_t;
177 } waveform_picker_regs_0_1_18_t;
108
178
179 //*********************
180 //*********************
181 // SPECTRAL_MATRIX_REGS
182
183 #define BITS_STATUS_F0 0x03 // [0011]
184 #define BITS_STATUS_F1 0x0c // [1100]
185 #define BITS_STATUS_F2 0x30 // [0011 0000]
186 #define BITS_HK_AA_SM 0x780 // [0111 1000 0000]
187 #define BITS_SM_ERR 0x7c0 // [0111 1100 0000]
188 #define BITS_STATUS_REG 0x7ff // [0111 1111 1111]
189 #define BIT_READY_0 0x1 // [01]
190 #define BIT_READY_1 0x2 // [10]
191 #define BIT_READY_0_1 0x3 // [11]
192 #define BIT_STATUS_F1_0 0x04 // [0100]
193 #define BIT_STATUS_F1_1 0x08 // [1000]
194 #define BIT_STATUS_F2_0 0x10 // [0001 0000]
195 #define BIT_STATUS_F2_1 0x20 // [0010 0000]
196 #define DEFAULT_MATRIX_LENGTH 0xc8 // 25 * 128 / 16 = 200 = 0xc8
197 #define BIT_IRQ_ON_NEW_MATRIX 0x01
198 #define MASK_IRQ_ON_NEW_MATRIX 0xfffffffe
199 #define BIT_IRQ_ON_ERROR 0x02
200 #define MASK_IRQ_ON_ERROR 0xfffffffd
201
109 typedef struct {
202 typedef struct {
110 volatile int config; // 0x00
203 volatile int config; // 0x00
111 volatile int status; // 0x04
204 volatile int status; // 0x04
112 volatile int f0_0_address; // 0x08
205 volatile int f0_0_address; // 0x08
113 volatile int f0_1_address; // 0x0C
206 volatile int f0_1_address; // 0x0C
114 //
207 //
115 volatile int f1_0_address; // 0x10
208 volatile int f1_0_address; // 0x10
116 volatile int f1_1_address; // 0x14
209 volatile int f1_1_address; // 0x14
117 volatile int f2_0_address; // 0x18
210 volatile int f2_0_address; // 0x18
118 volatile int f2_1_address; // 0x1C
211 volatile int f2_1_address; // 0x1C
119 //
212 //
120 volatile unsigned int f0_0_coarse_time; // 0x20
213 volatile unsigned int f0_0_coarse_time; // 0x20
121 volatile unsigned int f0_0_fine_time; // 0x24
214 volatile unsigned int f0_0_fine_time; // 0x24
122 volatile unsigned int f0_1_coarse_time; // 0x28
215 volatile unsigned int f0_1_coarse_time; // 0x28
123 volatile unsigned int f0_1_fine_time; // 0x2C
216 volatile unsigned int f0_1_fine_time; // 0x2C
124 //
217 //
125 volatile unsigned int f1_0_coarse_time; // 0x30
218 volatile unsigned int f1_0_coarse_time; // 0x30
126 volatile unsigned int f1_0_fine_time; // 0x34
219 volatile unsigned int f1_0_fine_time; // 0x34
127 volatile unsigned int f1_1_coarse_time; // 0x38
220 volatile unsigned int f1_1_coarse_time; // 0x38
128 volatile unsigned int f1_1_fine_time; // 0x3C
221 volatile unsigned int f1_1_fine_time; // 0x3C
129 //
222 //
130 volatile unsigned int f2_0_coarse_time; // 0x40
223 volatile unsigned int f2_0_coarse_time; // 0x40
131 volatile unsigned int f2_0_fine_time; // 0x44
224 volatile unsigned int f2_0_fine_time; // 0x44
132 volatile unsigned int f2_1_coarse_time; // 0x48
225 volatile unsigned int f2_1_coarse_time; // 0x48
133 volatile unsigned int f2_1_fine_time; // 0x4C
226 volatile unsigned int f2_1_fine_time; // 0x4C
134 //
227 //
135 unsigned int matrix_length; // 0x50, length of a spectral matrix in burst 3200 / 16 = 200 = 0xc8
228 unsigned int matrix_length; // 0x50, length of a spectral matrix in burst 3200 / 16 = 200 = 0xc8
136 } spectral_matrix_regs_t;
229 } spectral_matrix_regs_t;
137
230
138 #endif // GRLIB_REGS_H_INCLUDED
231 #endif // GRLIB_REGS_H_INCLUDED
@@ -1,32 +1,36
1 #ifndef LFR_CPU_USAGE_REPORT_H
1 #ifndef LFR_CPU_USAGE_REPORT_H
2 #define LFR_CPU_USAGE_REPORT_H
2 #define LFR_CPU_USAGE_REPORT_H
3
3
4 #ifdef HAVE_CONFIG_H
4 #ifdef HAVE_CONFIG_H
5 #include "config.h"
5 #include "config.h"
6 #endif
6 #endif
7
7
8 #include <rtems.h>
8 #include <rtems.h>
9
9
10 #include <assert.h>
10 #include <assert.h>
11 #include <string.h>
11 #include <string.h>
12 #include <stdlib.h>
12 #include <stdlib.h>
13 #include <stdio.h>
13 #include <stdio.h>
14 #include <ctype.h>
14 #include <ctype.h>
15 #include <inttypes.h>
15 #include <inttypes.h>
16
16
17 #include <rtems/cpuuse.h>
17 #include <rtems/cpuuse.h>
18 #include <rtems/bspIo.h>
18 #include <rtems/bspIo.h>
19
19
20 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
20 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
21 #include <rtems/score/timestamp.h>
21 #include <rtems/score/timestamp.h>
22 #endif
22 #endif
23
23
24 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
24 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
25 extern Timestamp_Control CPU_usage_Uptime_at_last_reset;
25 extern Timestamp_Control CPU_usage_Uptime_at_last_reset;
26 #else
26 #else
27 extern uint32_t CPU_usage_Ticks_at_last_reset;
27 extern uint32_t CPU_usage_Ticks_at_last_reset;
28 #endif
28 #endif
29
29
30 unsigned char lfr_rtems_cpu_usage_report( void );
30 unsigned char lfr_rtems_cpu_usage_report( void );
31
31
32 #define CONST_100 100
33 #define CONST_1000 1000
34 #define CONST_100000 100000
35
32 #endif // LFR_CPU_USAGE_REPORT_H
36 #endif // LFR_CPU_USAGE_REPORT_H
@@ -1,361 +1,371
1 #ifndef FSW_PROCESSING_H_INCLUDED
1 #ifndef FSW_PROCESSING_H_INCLUDED
2 #define FSW_PROCESSING_H_INCLUDED
2 #define FSW_PROCESSING_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <grspw.h>
5 #include <grspw.h>
6 #include <math.h>
6 #include <math.h>
7 #include <stdlib.h> // abs() is in the stdlib
7 #include <stdlib.h> // abs() is in the stdlib
8 #include <stdio.h>
8 #include <stdio.h>
9 #include <math.h>
9 #include <math.h>
10 #include <grlib_regs.h>
10 #include <grlib_regs.h>
11
11
12 #include "fsw_params.h"
12 #include "fsw_params.h"
13
13
14 #define SBM_COEFF_PER_NORM_COEFF 2
15 #define MAX_SRC_DATA 780 // MAX size is 26 bins * 30 Bytes [TM_LFR_SCIENCE_BURST_BP2_F1]
16 #define MAX_SRC_DATA_WITH_SPARE 143 // 13 bins * 11 Bytes
17
14 typedef struct ring_node_asm
18 typedef struct ring_node_asm
15 {
19 {
16 struct ring_node_asm *next;
20 struct ring_node_asm *next;
17 float matrix[ TOTAL_SIZE_SM ];
21 float matrix[ TOTAL_SIZE_SM ];
18 unsigned int status;
22 unsigned int status;
19 } ring_node_asm;
23 } ring_node_asm;
20
24
21 typedef struct
25 typedef struct
22 {
26 {
23 unsigned char targetLogicalAddress;
27 unsigned char targetLogicalAddress;
24 unsigned char protocolIdentifier;
28 unsigned char protocolIdentifier;
25 unsigned char reserved;
29 unsigned char reserved;
26 unsigned char userApplication;
30 unsigned char userApplication;
27 unsigned char packetID[2];
31 unsigned char packetID[BYTES_PER_PACKETID];
28 unsigned char packetSequenceControl[2];
32 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
29 unsigned char packetLength[2];
33 unsigned char packetLength[BYTES_PER_PKT_LEN];
30 // DATA FIELD HEADER
34 // DATA FIELD HEADER
31 unsigned char spare1_pusVersion_spare2;
35 unsigned char spare1_pusVersion_spare2;
32 unsigned char serviceType;
36 unsigned char serviceType;
33 unsigned char serviceSubType;
37 unsigned char serviceSubType;
34 unsigned char destinationID;
38 unsigned char destinationID;
35 unsigned char time[6];
39 unsigned char time[BYTES_PER_TIME];
36 // AUXILIARY HEADER
40 // AUXILIARY HEADER
37 unsigned char sid;
41 unsigned char sid;
38 unsigned char pa_bia_status_info;
42 unsigned char pa_bia_status_info;
39 unsigned char sy_lfr_common_parameters_spare;
43 unsigned char sy_lfr_common_parameters_spare;
40 unsigned char sy_lfr_common_parameters;
44 unsigned char sy_lfr_common_parameters;
41 unsigned char acquisitionTime[6];
45 unsigned char acquisitionTime[BYTES_PER_TIME];
42 unsigned char pa_lfr_bp_blk_nr[2];
46 unsigned char pa_lfr_bp_blk_nr[BYTES_PER_BLKNR];
43 // SOURCE DATA
47 // SOURCE DATA
44 unsigned char data[ 780 ]; // MAX size is 26 bins * 30 Bytes [TM_LFR_SCIENCE_BURST_BP2_F1]
48 unsigned char data[ MAX_SRC_DATA ]; // MAX size is 26 bins * 30 Bytes [TM_LFR_SCIENCE_BURST_BP2_F1]
45 } bp_packet;
49 } bp_packet;
46
50
47 typedef struct
51 typedef struct
48 {
52 {
49 unsigned char targetLogicalAddress;
53 unsigned char targetLogicalAddress;
50 unsigned char protocolIdentifier;
54 unsigned char protocolIdentifier;
51 unsigned char reserved;
55 unsigned char reserved;
52 unsigned char userApplication;
56 unsigned char userApplication;
53 unsigned char packetID[2];
57 unsigned char packetID[BYTES_PER_PACKETID];
54 unsigned char packetSequenceControl[2];
58 unsigned char packetSequenceControl[BYTES_PER_SEQ_CTRL];
55 unsigned char packetLength[2];
59 unsigned char packetLength[BYTES_PER_PKT_LEN];
56 // DATA FIELD HEADER
60 // DATA FIELD HEADER
57 unsigned char spare1_pusVersion_spare2;
61 unsigned char spare1_pusVersion_spare2;
58 unsigned char serviceType;
62 unsigned char serviceType;
59 unsigned char serviceSubType;
63 unsigned char serviceSubType;
60 unsigned char destinationID;
64 unsigned char destinationID;
61 unsigned char time[6];
65 unsigned char time[BYTES_PER_TIME];
62 // AUXILIARY HEADER
66 // AUXILIARY HEADER
63 unsigned char sid;
67 unsigned char sid;
64 unsigned char pa_bia_status_info;
68 unsigned char pa_bia_status_info;
65 unsigned char sy_lfr_common_parameters_spare;
69 unsigned char sy_lfr_common_parameters_spare;
66 unsigned char sy_lfr_common_parameters;
70 unsigned char sy_lfr_common_parameters;
67 unsigned char acquisitionTime[6];
71 unsigned char acquisitionTime[BYTES_PER_TIME];
68 unsigned char source_data_spare;
72 unsigned char source_data_spare;
69 unsigned char pa_lfr_bp_blk_nr[2];
73 unsigned char pa_lfr_bp_blk_nr[BYTES_PER_BLKNR];
70 // SOURCE DATA
74 // SOURCE DATA
71 unsigned char data[ 143 ]; // 13 bins * 11 Bytes
75 unsigned char data[ MAX_SRC_DATA_WITH_SPARE ]; // 13 bins * 11 Bytes
72 } bp_packet_with_spare; // only for TM_LFR_SCIENCE_NORMAL_BP1_F0 and F1
76 } bp_packet_with_spare; // only for TM_LFR_SCIENCE_NORMAL_BP1_F0 and F1
73
77
74 typedef struct asm_msg
78 typedef struct asm_msg
75 {
79 {
76 ring_node_asm *norm;
80 ring_node_asm *norm;
77 ring_node_asm *burst_sbm;
81 ring_node_asm *burst_sbm;
78 rtems_event_set event;
82 rtems_event_set event;
79 unsigned int coarseTimeNORM;
83 unsigned int coarseTimeNORM;
80 unsigned int fineTimeNORM;
84 unsigned int fineTimeNORM;
81 unsigned int coarseTimeSBM;
85 unsigned int coarseTimeSBM;
82 unsigned int fineTimeSBM;
86 unsigned int fineTimeSBM;
83 unsigned int numberOfSMInASMNORM;
87 unsigned int numberOfSMInASMNORM;
84 unsigned int numberOfSMInASMSBM;
88 unsigned int numberOfSMInASMSBM;
85 } asm_msg;
89 } asm_msg;
86
90
87 extern unsigned char thisIsAnASMRestart;
91 extern unsigned char thisIsAnASMRestart;
88
92
89 extern volatile int sm_f0[ ];
93 extern volatile int sm_f0[ ];
90 extern volatile int sm_f1[ ];
94 extern volatile int sm_f1[ ];
91 extern volatile int sm_f2[ ];
95 extern volatile int sm_f2[ ];
92 extern unsigned int acquisitionDurations[];
96 extern unsigned int acquisitionDurations[];
93
97
94 // parameters
98 // parameters
95 extern struct param_local_str param_local;
99 extern struct param_local_str param_local;
96 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
100 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
97
101
98 // registers
102 // registers
99 extern time_management_regs_t *time_management_regs;
103 extern time_management_regs_t *time_management_regs;
100 extern volatile spectral_matrix_regs_t *spectral_matrix_regs;
104 extern volatile spectral_matrix_regs_t *spectral_matrix_regs;
101
105
102 extern rtems_name misc_name[5];
106 extern rtems_name misc_name[];
103 extern rtems_id Task_id[20]; /* array of task ids */
107 extern rtems_id Task_id[]; /* array of task ids */
104
108
105 ring_node * getRingNodeForAveraging( unsigned char frequencyChannel);
109 ring_node * getRingNodeForAveraging( unsigned char frequencyChannel);
106 // ISR
110 // ISR
107 rtems_isr spectral_matrices_isr( rtems_vector_number vector );
111 rtems_isr spectral_matrices_isr( rtems_vector_number vector );
108
112
109 //******************
113 //******************
110 // Spectral Matrices
114 // Spectral Matrices
111 void reset_nb_sm( void );
115 void reset_nb_sm( void );
112 // SM
116 // SM
113 void SM_init_rings( void );
117 void SM_init_rings( void );
114 void SM_reset_current_ring_nodes( void );
118 void SM_reset_current_ring_nodes( void );
115 // ASM
119 // ASM
116 void ASM_generic_init_ring(ring_node_asm *ring, unsigned char nbNodes );
120 void ASM_generic_init_ring(ring_node_asm *ring, unsigned char nbNodes );
117
121
118 //*****************
122 //*****************
119 // Basic Parameters
123 // Basic Parameters
120
124
121 void BP_reset_current_ring_nodes( void );
125 void BP_reset_current_ring_nodes( void );
122 void BP_init_header(bp_packet *packet,
126 void BP_init_header(bp_packet *packet,
123 unsigned int apid, unsigned char sid,
127 unsigned int apid, unsigned char sid,
124 unsigned int packetLength , unsigned char blkNr);
128 unsigned int packetLength , unsigned char blkNr);
125 void BP_init_header_with_spare(bp_packet_with_spare *packet,
129 void BP_init_header_with_spare(bp_packet_with_spare *packet,
126 unsigned int apid, unsigned char sid,
130 unsigned int apid, unsigned char sid,
127 unsigned int packetLength, unsigned char blkNr );
131 unsigned int packetLength, unsigned char blkNr );
128 void BP_send( char *data,
132 void BP_send( char *data,
129 rtems_id queue_id,
133 rtems_id queue_id,
130 unsigned int nbBytesToSend , unsigned int sid );
134 unsigned int nbBytesToSend , unsigned int sid );
131 void BP_send_s1_s2(char *data,
135 void BP_send_s1_s2(char *data,
132 rtems_id queue_id,
136 rtems_id queue_id,
133 unsigned int nbBytesToSend, unsigned int sid );
137 unsigned int nbBytesToSend, unsigned int sid );
134
138
135 //******************
139 //******************
136 // general functions
140 // general functions
137 void reset_sm_status( void );
141 void reset_sm_status( void );
138 void reset_spectral_matrix_regs( void );
142 void reset_spectral_matrix_regs( void );
139 void set_time(unsigned char *time, unsigned char *timeInBuffer );
143 void set_time(unsigned char *time, unsigned char *timeInBuffer );
140 unsigned long long int get_acquisition_time( unsigned char *timePtr );
144 unsigned long long int get_acquisition_time( unsigned char *timePtr );
141 unsigned char getSID( rtems_event_set event );
145 unsigned char getSID( rtems_event_set event );
142
146