##// END OF EJS Templates
Sync
Sync

File last commit:

r95:2543157c542c VHDLib206
r95:2543157c542c VHDLib206
Show More
wf_handler.c
1519 lines | 63.6 KiB | text/x-c | CLexer
paul
Header files inclusion reworked...
r40 /** Functions and tasks related to waveform packet generation.
*
* @file
* @author P. LEROY
*
* A group of functions to handle waveforms, in snapshot or continuous format.\n
*
*/
#include "wf_handler.h"
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5
paul
First version of the rings for the waveform picker.
r87 //*****************
// waveform headers
paul
Commit before working on the ERR 4 due to message queue...
r34 // SWF
Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0[7];
Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7];
Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7];
// CWF
paul
packet emission task added...
r33 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[7];
Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[7];
paul
Commit before working on the ERR 4 due to message queue...
r34 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[7];
paul
packet emission task added...
r33 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[7];
paul
CWF_F3 packets are now compliant with the ICD...
r38 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[7];
paul
packet emission task added...
r33
paul
First version of the rings for the waveform picker.
r87 //**************
// waveform ring
paul
ICD 2.0...
r92 ring_node waveform_ring_f0[NB_RING_NODES_F0];
paul
First version of the rings for the waveform picker.
r87 ring_node waveform_ring_f1[NB_RING_NODES_F1];
ring_node waveform_ring_f2[NB_RING_NODES_F2];
paul
ICD 2.0...
r92 ring_node *current_ring_node_f0;
ring_node *ring_node_to_send_swf_f0;
paul
First version of the rings for the waveform picker.
r87 ring_node *current_ring_node_f1;
ring_node *ring_node_to_send_swf_f1;
ring_node *ring_node_to_send_cwf_f1;
ring_node *current_ring_node_f2;
ring_node *ring_node_to_send_swf_f2;
ring_node *ring_node_to_send_cwf_f2;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 rtems_isr waveforms_isr( rtems_vector_number vector )
{
paul
Minor changes in .h inclusion
r45 /** This is the interrupt sub routine called by the waveform picker core.
*
* This ISR launch different actions depending mainly on two pieces of information:
* 1. the values read in the registers of the waveform picker.
* 2. the current LFR mode.
*
*/
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
paul
Sync
r95 static unsigned char nb_swf = 0;
paul
packet emission task added...
r33 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
|| (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
paul
sy_lfr_n_swf_p implemented...
r32 { // in modes other than STANDBY and BURST, send the CWF_F3 data
paul
packet emission task added...
r33 if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
paul
sy_lfr_n_swf_p implemented...
r32 // (1) change the receiving buffer for the waveform picker
paul
Integration of the VHDL_DEV option...
r90 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b);
paul
sy_lfr_n_swf_p implemented...
r32 }
else {
paul
Integration of the VHDL_DEV option...
r90 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a);
paul
sy_lfr_n_swf_p implemented...
r32 }
// (2) send an event for the waveforms transmission
paul
packet emission task added...
r33 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
paul
sy_lfr_n_swf_p implemented...
r32 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
paul
packet emission task added...
r33 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
paul
sy_lfr_n_swf_p implemented...
r32 }
}
paul
packet emission task added...
r33 switch(lfrCurrentMode)
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 {
//********
// STANDBY
case(LFR_MODE_STANDBY):
paul
packet emission task added...
r33 break;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
//******
// NORMAL
case(LFR_MODE_NORMAL):
paul
Minor changes
r94 if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits
{
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
if ( (waveform_picker_regs->status & 0x07) == 0x07) // [0111] check the f2, f1, f0 full bits
{
paul
ICD 2.0...
r92 // change F0 ring node
ring_node_to_send_swf_f0 = current_ring_node_f0;
current_ring_node_f0 = current_ring_node_f0->next;
waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address;
paul
Integration of the VHDL_DEV option...
r90 // change F1 ring node
ring_node_to_send_swf_f1 = current_ring_node_f1;
current_ring_node_f1 = current_ring_node_f1->next;
waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
// change F2 ring node
ring_node_to_send_swf_f2 = current_ring_node_f2;
current_ring_node_f2 = current_ring_node_f2->next;
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
paul
Minor changes
r94 //
paul
Sync
r95 if (nb_swf < 2)
// if (true)
{
if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; // [1000 1000 1000]
nb_swf = nb_swf + 1;
}
else
{
reset_wfp_burst_enable();
nb_swf = 0;
}
}
break;
//******
// BURST
case(LFR_MODE_BURST):
if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
// (1) change the receiving buffer for the waveform picker
ring_node_to_send_cwf_f2 = current_ring_node_f2;
current_ring_node_f2 = current_ring_node_f2->next;
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
// (2) send an event for the waveforms transmission
if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
}
break;
//*****
// SBM1
case(LFR_MODE_SBM1):
if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
// (1) change the receiving buffer for the waveform picker
ring_node_to_send_cwf_f1 = current_ring_node_f1;
current_ring_node_f1 = current_ring_node_f1->next;
waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
// (2) send an event for the waveforms transmission
if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0
}
if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
ring_node_to_send_swf_f1 = current_ring_node_f1->previous;
}
if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit
if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0
}
break;
//*****
// SBM2
case(LFR_MODE_SBM2):
if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
// (1) change the receiving buffer for the waveform picker
ring_node_to_send_cwf_f2 = current_ring_node_f2;
current_ring_node_f2 = current_ring_node_f2->next;
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
// (2) send an event for the waveforms transmission
if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
}
if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
ring_node_to_send_swf_f2 = current_ring_node_f2->previous;
}
if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
paul
Integration of the VHDL_DEV option...
r90 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
paul
Sync
r95 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
}
break;
//********
// DEFAULT
default:
break;
}
}
rtems_isr waveforms_isr_alt( rtems_vector_number vector )
{
/** This is the interrupt sub routine called by the waveform picker core.
*
* This ISR launch different actions depending mainly on two pieces of information:
* 1. the values read in the registers of the waveform picker.
* 2. the current LFR mode.
*
*/
if ( (lfrCurrentMode == LFR_MODE_NORMAL)
|| (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
{ // in modes other than STANDBY and BURST, send the CWF_F3 data
if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
// (1) change the receiving buffer for the waveform picker
if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b);
}
else {
waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a);
}
// (2) send an event for the waveforms transmission
if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
paul
Last commit before release 0-13...
r35 }
paul
Sync
r95 }
paul
Minor changes
r94
paul
Sync
r95 switch(lfrCurrentMode)
{
//********
// STANDBY
case(LFR_MODE_STANDBY):
break;
//******
// NORMAL
case(LFR_MODE_NORMAL):
if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits
{
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
if ( (waveform_picker_regs->status & 0x01) == 0x01) // [0001] check the f0 full bit
{
// change F0 ring node
ring_node_to_send_swf_f0 = current_ring_node_f0;
current_ring_node_f0 = current_ring_node_f0->next;
waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1110 1110 1110]
if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F0 ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
}
if ( (waveform_picker_regs->status & 0x02) == 0x02) // [0010] check the f1 full bit
{
// change F1 ring node
ring_node_to_send_swf_f1 = current_ring_node_f1;
current_ring_node_f1 = current_ring_node_f1->next;
waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1101 1101 1101]
if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F1 ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
}
if ( (waveform_picker_regs->status & 0x04) == 0x04) // [0100] check the f2 full bit
{
// change F2 ring node
ring_node_to_send_swf_f2 = current_ring_node_f2;
current_ring_node_f2 = current_ring_node_f2->next;
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1011 1011 1011]
if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F2 ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
}
paul
packet emission task added...
r33 break;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
//******
// BURST
case(LFR_MODE_BURST):
paul
First version of the rings for the waveform picker.
r87 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
paul
packet emission task added...
r33 // (1) change the receiving buffer for the waveform picker
paul
First version of the rings for the waveform picker.
r87 ring_node_to_send_cwf_f2 = current_ring_node_f2;
current_ring_node_f2 = current_ring_node_f2->next;
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
paul
packet emission task added...
r33 // (2) send an event for the waveforms transmission
paul
VHDL_DEV implemented. The code is compatible with:...
r91 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
paul
packet emission task added...
r33 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
paul
First version of the rings for the waveform picker.
r87 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
paul
packet emission task added...
r33 }
break;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 //*****
// SBM1
case(LFR_MODE_SBM1):
paul
First version of the rings for the waveform picker.
r87 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
paul
packet emission task added...
r33 // (1) change the receiving buffer for the waveform picker
paul
First version of the rings for the waveform picker.
r87 ring_node_to_send_cwf_f1 = current_ring_node_f1;
current_ring_node_f1 = current_ring_node_f1->next;
waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
paul
packet emission task added...
r33 // (2) send an event for the waveforms transmission
if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul
packet emission task added...
r33 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0
}
paul
First version of the rings for the waveform picker.
r87 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
ring_node_to_send_swf_f1 = current_ring_node_f1->previous;
}
if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit
paul
packet emission task added...
r33 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0
}
break;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
//*****
// SBM2
case(LFR_MODE_SBM2):
paul
First version of the rings for the waveform picker.
r87 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
paul
packet emission task added...
r33 // (1) change the receiving buffer for the waveform picker
paul
First version of the rings for the waveform picker.
r87 ring_node_to_send_cwf_f2 = current_ring_node_f2;
current_ring_node_f2 = current_ring_node_f2->next;
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
paul
packet emission task added...
r33 // (2) send an event for the waveforms transmission
if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul
packet emission task added...
r33 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
}
paul
Integration of the VHDL_DEV option...
r90 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
ring_node_to_send_swf_f2 = current_ring_node_f2->previous;
}
if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
}
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
}
paul
packet emission task added...
r33 break;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 //********
// DEFAULT
default:
paul
packet emission task added...
r33 break;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 }
}
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
{
paul
Minor changes in .h inclusion
r45 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
*
* @param unused is the starting argument of the RTEMS task
*
* The following data packets are sent by this task:
* - TM_LFR_SCIENCE_NORMAL_SWF_F0
* - TM_LFR_SCIENCE_NORMAL_SWF_F1
* - TM_LFR_SCIENCE_NORMAL_SWF_F2
*
*/
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5 rtems_event_set event_out;
paul
Last commit before release 0-13...
r35 rtems_id queue_id;
paul
fsw-1-0...
r82 rtems_status_code status;
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5
paul
Commit before working on the ERR 4 due to message queue...
r34 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 );
paul@pc-solar1.lab-lpp.local
Several TC actions added...
r11
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 init_waveforms();
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_id );
if (status != RTEMS_SUCCESSFUL)
{
PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status)
}
paul
Last commit before release 0-13...
r35
BOOT_PRINTF("in WFRM ***\n")
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18
while(1){
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 // wait for an RTEMS_EVENT
paul
Commit before working on the ERR 4 due to message queue...
r34 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
paul
Minor changes
r94 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM
| RTEMS_EVENT_MODE_NORMAL_SWF_F0
| RTEMS_EVENT_MODE_NORMAL_SWF_F1
| RTEMS_EVENT_MODE_NORMAL_SWF_F2,
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
paul
Last commit before release 0-13...
r35 if (event_out == RTEMS_EVENT_MODE_NORMAL)
{
paul
ICD 2.0...
r92 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
paul
First version of the rings for the waveform picker.
r87 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
paul
Minor changes
r94 }
if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F0) == RTEMS_EVENT_MODE_NORMAL_SWF_F0)
{
send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
paul
Last commit before release 0-13...
r35 }
paul
Minor changes
r94 if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F1) == RTEMS_EVENT_MODE_NORMAL_SWF_F1)
paul
Last commit before release 0-13...
r35 {
paul
Minor changes
r94 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
}
if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F2) == RTEMS_EVENT_MODE_NORMAL_SWF_F2)
{
send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
paul
Last commit before release 0-13...
r35 }
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5 }
}
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17
paul
sy_lfr_n_swf_p implemented...
r32 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
{
paul
Minor changes in .h inclusion
r45 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
*
* @param unused is the starting argument of the RTEMS task
*
* The following data packet is sent by this task:
* - TM_LFR_SCIENCE_NORMAL_CWF_F3
*
*/
paul
sy_lfr_n_swf_p implemented...
r32 rtems_event_set event_out;
paul
Last commit before release 0-13...
r35 rtems_id queue_id;
paul
fsw-1-0...
r82 rtems_status_code status;
paul
sy_lfr_n_swf_p implemented...
r32
paul
ICD 2.0...
r92 init_header_continuous_wf_table( SID_NORM_CWF_LONG_F3, headerCWF_F3 );
init_header_continuous_cwf3_light_table( headerCWF_F3_light );
paul
sy_lfr_n_swf_p implemented...
r32
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_id );
if (status != RTEMS_SUCCESSFUL)
{
PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status)
}
paul
Last commit before release 0-13...
r35
BOOT_PRINTF("in CWF3 ***\n")
paul
sy_lfr_n_swf_p implemented...
r32
while(1){
// wait for an RTEMS_EVENT
paul
packet emission task added...
r33 rtems_event_receive( RTEMS_EVENT_0,
paul
sy_lfr_n_swf_p implemented...
r32 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
PRINTF("send CWF F3 \n")
paul
Integration of the VHDL_DEV option...
r90 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
paul
ICD 2.0...
r92 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
{
send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
}
else
{
send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id );
}
paul
packet emission task added...
r33 }
paul
ICD 2.0...
r92 else
{
if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x00)
{
send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
}
else
{
send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id );
}
paul
packet emission task added...
r33 }
}
}
rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
{
paul
Minor changes in .h inclusion
r45 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
*
* @param unused is the starting argument of the RTEMS task
*
* The following data packet is sent by this function:
* - TM_LFR_SCIENCE_BURST_CWF_F2
* - TM_LFR_SCIENCE_SBM2_CWF_F2
*
*/
paul
packet emission task added...
r33 rtems_event_set event_out;
paul
Last commit before release 0-13...
r35 rtems_id queue_id;
paul
fsw-1-0...
r82 rtems_status_code status;
paul
packet emission task added...
r33
init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
paul
Commit before working on the ERR 4 due to message queue...
r34 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
paul
packet emission task added...
r33
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_id );
if (status != RTEMS_SUCCESSFUL)
{
PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status)
}
paul
Last commit before release 0-13...
r35
BOOT_PRINTF("in CWF2 ***\n")
paul
packet emission task added...
r33
while(1){
// wait for an RTEMS_EVENT
rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
if (event_out == RTEMS_EVENT_MODE_BURST)
{
paul
VHDL_DEV implemented. The code is compatible with:...
r91 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
paul
packet emission task added...
r33 }
paul
First version of the rings for the waveform picker.
r87 if (event_out == RTEMS_EVENT_MODE_SBM2)
paul
packet emission task added...
r33 {
paul
VHDL_DEV implemented. The code is compatible with:...
r91 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
paul
packet emission task added...
r33 }
}
}
rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
{
paul
Minor changes in .h inclusion
r45 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
*
* @param unused is the starting argument of the RTEMS task
*
* The following data packet is sent by this function:
* - TM_LFR_SCIENCE_SBM1_CWF_F1
*
*/
paul
packet emission task added...
r33 rtems_event_set event_out;
paul
Last commit before release 0-13...
r35 rtems_id queue_id;
paul
fsw-1-0...
r82 rtems_status_code status;
paul
packet emission task added...
r33
init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_id );
if (status != RTEMS_SUCCESSFUL)
{
PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status)
}
paul
Last commit before release 0-13...
r35
BOOT_PRINTF("in CWF1 ***\n")
paul
packet emission task added...
r33
while(1){
// wait for an RTEMS_EVENT
rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
paul
VHDL_DEV implemented. The code is compatible with:...
r91 send_waveform_CWF( (volatile int*) ring_node_to_send_cwf_f1->buffer_address, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
paul
sy_lfr_n_swf_p implemented...
r32 }
}
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 //******************
// general functions
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 void init_waveforms( void )
{
int i = 0;
for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
{
//***
// F0
paul
ICD 2.0...
r92 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
// wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
// wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18
//***
// F1
paul
First version of the rings for the waveform picker.
r87 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
// wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
// wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18
//***
// F2
paul
First version of the rings for the waveform picker.
r87 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
// wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
// wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18
//***
// F3
paul
First version of the rings for the waveform picker.
r87 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1;
// wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2;
// wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000;
}
}
void init_waveform_rings( void )
{
unsigned char i;
paul
ICD 2.0...
r92 // F0 RING
waveform_ring_f0[0].next = (ring_node*) &waveform_ring_f0[1];
waveform_ring_f0[0].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-1];
waveform_ring_f0[0].buffer_address = (int) &wf_snap_f0[0][0];
waveform_ring_f0[NB_RING_NODES_F0-1].next = (ring_node*) &waveform_ring_f0[0];
waveform_ring_f0[NB_RING_NODES_F0-1].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-2];
waveform_ring_f0[NB_RING_NODES_F0-1].buffer_address = (int) &wf_snap_f0[NB_RING_NODES_F0-1][0];
for(i=1; i<NB_RING_NODES_F0-1; i++)
{
waveform_ring_f0[i].next = (ring_node*) &waveform_ring_f0[i+1];
waveform_ring_f0[i].previous = (ring_node*) &waveform_ring_f0[i-1];
waveform_ring_f0[i].buffer_address = (int) &wf_snap_f0[i][0];
}
paul
First version of the rings for the waveform picker.
r87 // F1 RING
waveform_ring_f1[0].next = (ring_node*) &waveform_ring_f1[1];
waveform_ring_f1[0].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-1];
waveform_ring_f1[0].buffer_address = (int) &wf_snap_f1[0][0];
waveform_ring_f1[NB_RING_NODES_F1-1].next = (ring_node*) &waveform_ring_f1[0];
waveform_ring_f1[NB_RING_NODES_F1-1].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-2];
waveform_ring_f1[NB_RING_NODES_F1-1].buffer_address = (int) &wf_snap_f1[NB_RING_NODES_F1-1][0];
for(i=1; i<NB_RING_NODES_F1-1; i++)
{
waveform_ring_f1[i].next = (ring_node*) &waveform_ring_f1[i+1];
waveform_ring_f1[i].previous = (ring_node*) &waveform_ring_f1[i-1];
waveform_ring_f1[i].buffer_address = (int) &wf_snap_f1[i][0];
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 }
paul
First version of the rings for the waveform picker.
r87
// F2 RING
waveform_ring_f2[0].next = (ring_node*) &waveform_ring_f2[1];
waveform_ring_f2[0].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-1];
waveform_ring_f2[0].buffer_address = (int) &wf_snap_f2[0][0];
waveform_ring_f2[NB_RING_NODES_F2-1].next = (ring_node*) &waveform_ring_f2[0];
waveform_ring_f2[NB_RING_NODES_F2-1].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-2];
waveform_ring_f2[NB_RING_NODES_F2-1].buffer_address = (int) &wf_snap_f2[NB_RING_NODES_F2-1][0];
for(i=1; i<NB_RING_NODES_F2-1; i++)
{
waveform_ring_f2[i].next = (ring_node*) &waveform_ring_f2[i+1];
waveform_ring_f2[i].previous = (ring_node*) &waveform_ring_f2[i-1];
waveform_ring_f2[i].buffer_address = (int) &wf_snap_f2[i][0];
}
paul
ICD 2.0...
r92 DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0)
paul
First version of the rings for the waveform picker.
r87 DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1)
DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2)
}
void reset_current_ring_nodes( void )
{
paul
ICD 2.0...
r92 current_ring_node_f0 = waveform_ring_f0;
ring_node_to_send_swf_f0 = waveform_ring_f0;
paul
First version of the rings for the waveform picker.
r87 current_ring_node_f1 = waveform_ring_f1;
ring_node_to_send_cwf_f1 = waveform_ring_f1;
ring_node_to_send_swf_f1 = waveform_ring_f1;
current_ring_node_f2 = waveform_ring_f2;
ring_node_to_send_cwf_f2 = waveform_ring_f2;
ring_node_to_send_swf_f2 = waveform_ring_f2;
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 }
paul
Commit before working on the ERR 4 due to message queue...
r34 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF)
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 {
paul
packet emission task added...
r33 unsigned char i;
for (i=0; i<7; i++)
{
paul
Commit before working on the ERR 4 due to message queue...
r34 headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
headerSWF[ i ].reserved = DEFAULT_RESERVED;
headerSWF[ i ].userApplication = CCSDS_USER_APP;
headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
paul
ICD 2.0...
r92 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
if (i == 6)
paul
packet emission task added...
r33 {
paul
ICD 2.0...
r92 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_224 >> 8);
headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_224 );
headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_224 >> 8);
headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_224 );
paul
packet emission task added...
r33 }
else
{
paul
ICD 2.0...
r92 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_304 >> 8);
headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_304 );
headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_304 >> 8);
headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_304 );
paul
packet emission task added...
r33 }
paul
Commit before working on the ERR 4 due to message queue...
r34 headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT
headerSWF[ i ].pktNr = i+1; // PKT_NR
paul
packet emission task added...
r33 // DATA FIELD HEADER
paul
Commit before working on the ERR 4 due to message queue...
r34 headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
paul
packet emission task added...
r33 // AUXILIARY DATA HEADER
paul
Commit before working on the ERR 4 due to message queue...
r34 headerSWF[ i ].time[0] = 0x00;
headerSWF[ i ].time[0] = 0x00;
headerSWF[ i ].time[0] = 0x00;
headerSWF[ i ].time[0] = 0x00;
headerSWF[ i ].time[0] = 0x00;
headerSWF[ i ].time[0] = 0x00;
paul
sequence counters management added
r56 headerSWF[ i ].sid = sid;
headerSWF[ i ].hkBIA = DEFAULT_HKBIA;
paul
packet emission task added...
r33 }
return LFR_SUCCESSFUL;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18
paul
packet emission task added...
r33 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 {
paul
packet emission task added...
r33 unsigned int i;
for (i=0; i<7; i++)
{
headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
headerCWF[ i ].reserved = DEFAULT_RESERVED;
headerCWF[ i ].userApplication = CCSDS_USER_APP;
paul
TM_LFR_TC_EXE packet sending reworked...
r37 if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) )
paul
Commit before working on the ERR 4 due to message queue...
r34 {
headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8);
headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2);
}
else
{
headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
}
paul
Minor changes
r93 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_336 >> 8);
headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_336 );
headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF >> 8);
headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF );
paul
packet emission task added...
r33 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
// DATA FIELD HEADER
headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
// AUXILIARY DATA HEADER
headerCWF[ i ].sid = sid;
headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
}
return LFR_SUCCESSFUL;
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 }
paul
ICD 2.0...
r92 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
paul
CWF_F3 packets are now compliant with the ICD...
r38 {
unsigned int i;
for (i=0; i<7; i++)
{
headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
headerCWF[ i ].reserved = DEFAULT_RESERVED;
headerCWF[ i ].userApplication = CCSDS_USER_APP;
headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
paul
Minor changes
r93
headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_672 >> 8);
headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_672 );
headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8);
headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 );
paul
CWF_F3 packets are now compliant with the ICD...
r38 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
// DATA FIELD HEADER
headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
// AUXILIARY DATA HEADER
headerCWF[ i ].sid = SID_NORM_CWF_F3;
headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
headerCWF[ i ].time[0] = 0x00;
}
return LFR_SUCCESSFUL;
}
paul
Last commit before release 0-13...
r35 int send_waveform_SWF( volatile int *waveform, unsigned int sid,
Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id )
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 {
paul
Header files inclusion reworked...
r40 /** This function sends SWF CCSDS packets (F2, F1 or F0).
*
* @param waveform points to the buffer containing the data that will be send.
* @param sid is the source identifier of the data that will be sent.
* @param headerSWF points to a table of headers that have been prepared for the data transmission.
* @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
* contain information to setup the transmission of the data packets.
*
* One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
*
*/
paul
packet emission task added...
r33 unsigned int i;
int ret;
paul
Minor changes
r93 unsigned int coarseTime;
unsigned int fineTime;
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 rtems_status_code status;
paul
packet emission task added...
r33 spw_ioctl_pkt_send spw_ioctl_send_SWF;
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18
paul
packet emission task added...
r33 spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header
spw_ioctl_send_SWF.options = 0;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
paul
packet emission task added...
r33 ret = LFR_DEFAULT;
paul
Minor changes
r93 PRINTF1("sid = %d, ", sid)
PRINTF2("coarse = %x, fine = %x\n", waveform[0], waveform[1])
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 for (i=0; i<7; i++) // send waveform
{
paul
Integration of the VHDL_DEV option...
r90 #ifdef VHDL_DEV
paul
Minor changes
r93 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) + TIME_OFFSET];
paul
Integration of the VHDL_DEV option...
r90 #else
paul
Minor changes
r93 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) ];
paul
Integration of the VHDL_DEV option...
r90 #endif
paul
Commit before working on the ERR 4 due to message queue...
r34 spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 // BUILD THE DATA
if (i==6) {
paul
Minor changes
r93 spw_ioctl_send_SWF.dlen = BLK_NR_224 * NB_BYTES_SWF_BLK;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
else {
paul
Minor changes
r93 spw_ioctl_send_SWF.dlen = BLK_NR_304 * NB_BYTES_SWF_BLK;
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 }
paul
sequence counters management added
r56 // SET PACKET SEQUENCE COUNTER
increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid );
paul
packet emission task added...
r33 // SET PACKET TIME
paul
Minor changes
r93 #ifdef VHDL_DEV
coarseTime = waveform[0];
fineTime = waveform[1];
compute_acquisition_time( &coarseTime, &fineTime, sid, i);
headerSWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime >> 24 );
headerSWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime >> 16 );
headerSWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime >> 8 );
headerSWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime );
headerSWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime >> 8 );
headerSWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime );
#else
paul
Ignore doc files...
r46 headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
paul
Minor changes
r93 #endif
paul
Commit before working on the ERR 4 due to message queue...
r34 headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
paul
packet emission task added...
r33 // SEND PACKET
paul
TM_LFR_TC_EXE packet sending reworked...
r37 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
paul
packet emission task added...
r33 if (status != RTEMS_SUCCESSFUL) {
paul
Commit before working on the ERR 4 due to message queue...
r34 printf("%d-%d, ERR %d\n", sid, i, (int) status);
paul
packet emission task added...
r33 ret = LFR_DEFAULT;
}
paul
Sync
r95 // rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul
sy_lfr_n_swf_p implemented...
r32
paul
packet emission task added...
r33 return ret;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul
Last commit before release 0-13...
r35 int send_waveform_CWF(volatile int *waveform, unsigned int sid,
Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 {
paul
Header files inclusion reworked...
r40 /** This function sends CWF CCSDS packets (F2, F1 or F0).
*
* @param waveform points to the buffer containing the data that will be send.
* @param sid is the source identifier of the data that will be sent.
* @param headerCWF points to a table of headers that have been prepared for the data transmission.
* @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
* contain information to setup the transmission of the data packets.
*
* One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
*
*/
paul
packet emission task added...
r33 unsigned int i;
int ret;
paul
Minor changes
r93 unsigned char *coarseTimePtr;
unsigned char *fineTimePtr;
paul
packet emission task added...
r33 rtems_status_code status;
spw_ioctl_pkt_send spw_ioctl_send_CWF;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
paul
packet emission task added...
r33 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
spw_ioctl_send_CWF.options = 0;
ret = LFR_DEFAULT;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
paul
packet emission task added...
r33 for (i=0; i<7; i++) // send waveform
{
int coarseTime = 0x00;
int fineTime = 0x00;
paul
Integration of the VHDL_DEV option...
r90 #ifdef VHDL_DEV
paul
Minor changes
r93 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) + TIME_OFFSET];
paul
Integration of the VHDL_DEV option...
r90 #else
paul
Minor changes
r93 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) ];
paul
Integration of the VHDL_DEV option...
r90 #endif
paul
packet emission task added...
r33 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
// BUILD THE DATA
paul
Minor changes
r93 spw_ioctl_send_CWF.dlen = BLK_NR_CWF * NB_BYTES_SWF_BLK;
paul
sequence counters management added
r56 // SET PACKET SEQUENCE COUNTER
increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid );
paul
packet emission task added...
r33 // SET PACKET TIME
paul
Minor changes
r93 #ifdef VHDL_DEV
coarseTimePtr = (unsigned char *) &waveform;
fineTimePtr = (unsigned char *) &waveform[1];
headerCWF[ i ].acquisitionTime[0] = coarseTimePtr[2];
headerCWF[ i ].acquisitionTime[1] = coarseTimePtr[3];
headerCWF[ i ].acquisitionTime[2] = coarseTimePtr[0];
headerCWF[ i ].acquisitionTime[3] = coarseTimePtr[1];
headerCWF[ i ].acquisitionTime[4] = fineTimePtr[0];
headerCWF[ i ].acquisitionTime[5] = fineTimePtr[1];
#else
paul
packet emission task added...
r33 coarseTime = time_management_regs->coarse_time;
fineTime = time_management_regs->fine_time;
paul
Ignore doc files...
r46 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
paul
Minor changes
r93 #endif
paul
packet emission task added...
r33 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
headerCWF[ i ].time[5] = (unsigned char) (fineTime);
// SEND PACKET
paul
ICD 2.0...
r92 if (sid == SID_NORM_CWF_LONG_F3)
paul
Commit before working on the ERR 4 due to message queue...
r34 {
paul
Last commit before release 0-13...
r35 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
paul
Commit before working on the ERR 4 due to message queue...
r34 if (status != RTEMS_SUCCESSFUL) {
printf("%d-%d, ERR %d\n", sid, i, (int) status);
ret = LFR_DEFAULT;
}
rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
paul
packet emission task added...
r33 }
else
{
paul
rtems_message_queue_urgent is replaced by rtems_message_queue_send...
r36 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
paul
Commit before working on the ERR 4 due to message queue...
r34 if (status != RTEMS_SUCCESSFUL) {
printf("%d-%d, ERR %d\n", sid, i, (int) status);
ret = LFR_DEFAULT;
}
paul
packet emission task added...
r33 }
}
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
paul
packet emission task added...
r33 return ret;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul
CWF_F3 packets are now compliant with the ICD...
r38 int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
{
paul
Header files inclusion reworked...
r40 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
*
* @param waveform points to the buffer containing the data that will be send.
* @param headerCWF points to a table of headers that have been prepared for the data transmission.
* @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
* contain information to setup the transmission of the data packets.
*
* By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
* from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
*
*/
paul
CWF_F3 packets are now compliant with the ICD...
r38 unsigned int i;
int ret;
paul
Minor changes
r93 unsigned char *coarseTimePtr;
unsigned char *fineTimePtr;
paul
CWF_F3 packets are now compliant with the ICD...
r38 rtems_status_code status;
spw_ioctl_pkt_send spw_ioctl_send_CWF;
char *sample;
spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
spw_ioctl_send_CWF.options = 0;
ret = LFR_DEFAULT;
//**********************
// BUILD CWF3_light DATA
paul
Minor changes
r93 for ( i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
paul
CWF_F3 packets are now compliant with the ICD...
r38 {
paul
ICD 2.0...
r92 #ifdef VHDL_DEV
sample = (char*) &waveform[ (i * NB_WORDS_SWF_BLK) + TIME_OFFSET ];
paul
Minor changes
r93 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES ] = sample[ 0 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 + TIME_OFFSET_IN_BYTES ] = sample[ 1 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 + TIME_OFFSET_IN_BYTES ] = sample[ 2 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 + TIME_OFFSET_IN_BYTES ] = sample[ 3 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 + TIME_OFFSET_IN_BYTES ] = sample[ 4 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 + TIME_OFFSET_IN_BYTES ] = sample[ 5 ];
paul
ICD 2.0...
r92 #else
paul
CWF_F3 packets are now compliant with the ICD...
r38 sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ];
wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ];
paul
Minor changes
r93 #endif
paul
CWF_F3 packets are now compliant with the ICD...
r38 }
//*********************
// SEND CWF3_light DATA
for (i=0; i<7; i++) // send waveform
{
int coarseTime = 0x00;
int fineTime = 0x00;
paul
ICD 2.0...
r92
paul
Minor changes
r93 #ifdef VHDL_DEV
spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES];
#else
spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) ];
#endif
paul
CWF_F3 packets are now compliant with the ICD...
r38 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
// BUILD THE DATA
paul
Minor changes
r93 spw_ioctl_send_CWF.dlen = BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK;
paul
sequence counters management added
r56 // SET PACKET SEQUENCE COUNTER
increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 );
paul
CWF_F3 packets are now compliant with the ICD...
r38 // SET PACKET TIME
paul
Minor changes
r93 #ifdef VHDL_DEV
coarseTimePtr = (unsigned char *) &waveform;
fineTimePtr = (unsigned char *) &waveform[1];
headerCWF[ i ].acquisitionTime[0] = coarseTimePtr[2];
headerCWF[ i ].acquisitionTime[1] = coarseTimePtr[3];
headerCWF[ i ].acquisitionTime[2] = coarseTimePtr[0];
headerCWF[ i ].acquisitionTime[3] = coarseTimePtr[1];
headerCWF[ i ].acquisitionTime[4] = fineTimePtr[0];
headerCWF[ i ].acquisitionTime[5] = fineTimePtr[1];
#else
paul
CWF_F3 packets are now compliant with the ICD...
r38 coarseTime = time_management_regs->coarse_time;
fineTime = time_management_regs->fine_time;
paul
Ignore doc files...
r46 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
paul
Minor changes
r93 #endif
paul
CWF_F3 packets are now compliant with the ICD...
r38 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
headerCWF[ i ].time[5] = (unsigned char) (fineTime);
// SEND PACKET
status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
if (status != RTEMS_SUCCESSFUL) {
printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status);
ret = LFR_DEFAULT;
}
rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
}
return ret;
}
paul
Minor changes
r93 void compute_acquisition_time( unsigned int *coarseTime, unsigned int *fineTime, unsigned int sid, unsigned char pa_lfr_pkt_nr )
{
unsigned long long int acquisitionTimeAsLong;
unsigned char acquisitionTime[6];
float deltaT = 0.;
acquisitionTime[0] = (unsigned char) ( *coarseTime >> 8 );
acquisitionTime[1] = (unsigned char) ( *coarseTime );
acquisitionTime[2] = (unsigned char) ( *coarseTime >> 24 );
acquisitionTime[3] = (unsigned char) ( *coarseTime >> 16 );
acquisitionTime[4] = (unsigned char) ( *fineTime >> 24 );
acquisitionTime[5] = (unsigned char) ( *fineTime >> 16 );
acquisitionTimeAsLong = ( (unsigned long long int) acquisitionTime[0] << 40 )
+ ( (unsigned long long int) acquisitionTime[1] << 32 )
+ ( acquisitionTime[2] << 24 )
+ ( acquisitionTime[3] << 16 )
+ ( acquisitionTime[4] << 8 )
+ ( acquisitionTime[5] );
switch( sid )
{
case SID_NORM_SWF_F0:
deltaT = ( (float ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ;
break;
case SID_NORM_SWF_F1:
deltaT = ( (float ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ;
break;
case SID_NORM_SWF_F2:
deltaT = ( (float ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ;
break;
default:
deltaT = 0.;
break;
}
acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT;
*coarseTime = (unsigned int) (acquisitionTimeAsLong >> 16);
*fineTime = (unsigned int) (acquisitionTimeAsLong & 0xffff);
}
paul
CWF_F3 packets are now compliant with the ICD...
r38
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 //**************
// wfp registers
paul
sy_lfr_n_swf_p implemented...
r32 void set_wfp_data_shaping()
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 {
paul
Header files inclusion reworked...
r40 /** This function sets the data_shaping register of the waveform picker module.
*
* The value is read from one field of the parameter_dump_packet structure:\n
* bw_sp0_sp1_r0_r1
*
*/
paul
sy_lfr_n_swf_p implemented...
r32 unsigned char data_shaping;
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
// waveform picker : [R1 R0 SP1 SP0 BW]
paul
sy_lfr_n_swf_p implemented...
r32
data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1;
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 #ifdef GSA
#else
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 waveform_picker_regs->data_shaping =
( (data_shaping & 0x10) >> 4 ) // BW
+ ( (data_shaping & 0x08) >> 2 ) // SP0
+ ( (data_shaping & 0x04) ) // SP1
+ ( (data_shaping & 0x02) << 2 ) // R0
+ ( (data_shaping & 0x01) << 4 ); // R1
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 #endif
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul
sy_lfr_n_swf_p implemented...
r32 char set_wfp_delta_snapshot()
{
paul
Header files inclusion reworked...
r40 /** This function sets the delta_snapshot register of the waveform picker module.
*
paul
Minor changes in .h inclusion
r45 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
* - sy_lfr_n_swf_p[0]
* - sy_lfr_n_swf_p[1]
paul
Header files inclusion reworked...
r40 *
*/
paul
sy_lfr_n_swf_p implemented...
r32 char ret;
unsigned int delta_snapshot;
paul
CWF_F3 packets are now compliant with the ICD...
r38 unsigned int aux;
aux = 0;
paul
sy_lfr_n_swf_p implemented...
r32 ret = LFR_DEFAULT;
delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
+ parameter_dump_packet.sy_lfr_n_swf_p[1];
#ifdef GSA
#else
if ( delta_snapshot < MIN_DELTA_SNAPSHOT )
{
aux = MIN_DELTA_SNAPSHOT;
ret = LFR_DEFAULT;
}
else
{
aux = delta_snapshot ;
ret = LFR_SUCCESSFUL;
}
paul
Minor changes in .h inclusion
r45 waveform_picker_regs->delta_snapshot = aux - 1; // max 2 bytes
paul
sy_lfr_n_swf_p implemented...
r32 #endif
return ret;
}
paul
Integration of the VHDL_DEV option...
r90 #ifdef VHDL_DEV
void set_wfp_burst_enable_register( unsigned char mode )
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 {
paul
Header files inclusion reworked...
r40 /** This function sets the waveform picker burst_enable register depending on the mode.
*
* @param mode is the LFR mode to launch.
*
* The burst bits shall be before the enable bits.
*
*/
paul
Integration of the VHDL_DEV option...
r90 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
// the burst bits shall be set first, before the enable bits
switch(mode) {
case(LFR_MODE_NORMAL):
waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
break;
case(LFR_MODE_BURST):
waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
break;
case(LFR_MODE_SBM1):
waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
break;
case(LFR_MODE_SBM2):
waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
break;
default:
waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
break;
}
}
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 #else
paul
Integration of the VHDL_DEV option...
r90 void set_wfp_burst_enable_register( unsigned char mode )
{
/** This function sets the waveform picker burst_enable register depending on the mode.
*
* @param mode is the LFR mode to launch.
*
* The burst bits shall be before the enable bits.
*
*/
paul
sy_lfr_n_swf_p implemented...
r32 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
// the burst bits shall be set first, before the enable bits
switch(mode) {
case(LFR_MODE_NORMAL):
paul
Last commit before release 0-13...
r35 waveform_picker_regs->burst_enable = 0x00; // [0000 0000] no burst enable
paul
sy_lfr_n_swf_p implemented...
r32 waveform_picker_regs->burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
break;
case(LFR_MODE_BURST):
waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled
waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x04; // [0100] enable f2
break;
case(LFR_MODE_SBM1):
waveform_picker_regs->burst_enable = 0x20; // [0010 0000] f1 burst enabled
waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
break;
case(LFR_MODE_SBM2):
waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled
waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
break;
default:
waveform_picker_regs->burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
break;
}
paul
Integration of the VHDL_DEV option...
r90 }
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 #endif
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
void reset_wfp_burst_enable()
{
paul
Header files inclusion reworked...
r40 /** This function resets the waveform picker burst_enable register.
*
* The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
*
*/
paul
Integration of the VHDL_DEV option...
r90 #ifdef VHDL_DEV
waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 #else
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 waveform_picker_regs->burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 #endif
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul
packet emission task added...
r33 void reset_wfp_status()
{
paul
Header files inclusion reworked...
r40 /** This function resets the waveform picker status register.
*
* All status bits are set to 0 [new_err full_err full].
*
*/
paul
packet emission task added...
r33 #ifdef GSA
#else
waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
#endif
}
paul
Sync
r95 void reset_waveform_picker_regs_vhdl_dev()
paul
Integration of the VHDL_DEV option...
r90 {
/** This function resets the waveform picker module registers.
*
* The registers affected by this function are located at the following offset addresses:
* - 0x00 data_shaping
* - 0x04 run_burst_enable
* - 0x08 addr_data_f0
* - 0x0C addr_data_f1
* - 0x10 addr_data_f2
* - 0x14 addr_data_f3
* - 0x18 status
* - 0x1C delta_snapshot
* - 0x20 delta_f0
* - 0x24 delta_f0_2
* - 0x28 delta_f1
* - 0x2c delta_f2
* - 0x30 nb_data_by_buffer
* - 0x34 nb_snapshot_param
* - 0x38 start_date
* - 0x3c nb_word_in_buffer
*
*/
waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
paul
ICD 2.0...
r92 //waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08
waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08
paul
Integration of the VHDL_DEV option...
r90 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10
waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); // 0x14
waveform_picker_regs->status = 0x00; // 0x18
paul
Minor changes
r93 //
paul
Minor changes
r94 waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c *** 4096 = 16 * 256
waveform_picker_regs->delta_f0 = 0xc0b; // 0x20 *** 3083 = 4096 - 1013
waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits]
waveform_picker_regs->delta_f1 = 0xc40; // 0x28 *** 3136 = 4096 - 960
waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 3072 = 12 * 256
paul
Minor changes
r93 //
paul
Minor changes
r94 // waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c *** 4096 = 16 * 256
// waveform_picker_regs->delta_f0 = 0x1; // 0x20 ***
// waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits]
// waveform_picker_regs->delta_f1 = 0x1; // 0x28 ***
// waveform_picker_regs->delta_f2 = 0x1; // 0x2c ***
//
// waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c *** 4096 = 16 * 256
// waveform_picker_regs->delta_f0 = 0x0fff; // 0x20 ***
// waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits]
// waveform_picker_regs->delta_f1 = 0x0fff; // 0x28 ***
// waveform_picker_regs->delta_f2 = 0x1; // 0x2c ***
paul
Minor changes
r93 // 2048
// waveform_picker_regs->nb_data_by_buffer = 0x7ff; // 0x30 *** 2048 -1 => nb samples -1
// waveform_picker_regs->snapshot_param = 0x800; // 0x34 *** 2048 => nb samples
// waveform_picker_regs->start_date = 0x00; // 0x38
// waveform_picker_regs->nb_word_in_buffer = 0x1802; // 0x3c *** 2048 * 3 + 2 = 6146
// 2352 = 7 * 336
paul
Sync
r95 // waveform_picker_regs->nb_data_by_buffer = 0x92f; // 0x30 *** 2352 - 1 => nb samples -1
// waveform_picker_regs->snapshot_param = 0x930; // 0x34 *** 2352 => nb samples
// waveform_picker_regs->start_date = 0x00; // 0x38
// waveform_picker_regs->nb_word_in_buffer = 0x1b92; // 0x3c *** 2352 * 3 + 2 = 7058
// 128
waveform_picker_regs->nb_data_by_buffer = 0x7f; // 0x30 *** 128 - 1 => nb samples -1
waveform_picker_regs->snapshot_param = 0x80; // 0x34 *** 128 => nb samples
paul
Minor changes
r93 waveform_picker_regs->start_date = 0x00; // 0x38
paul
Sync
r95 waveform_picker_regs->nb_word_in_buffer = 0x182; // 0x3c *** 128 * 3 + 2 = 386
}
void reset_waveform_picker_regs_vhdl_dev_debug()
{
/** This function resets the waveform picker module registers.
*
* The registers affected by this function are located at the following offset addresses:
* - 0x00 data_shaping
* - 0x04 run_burst_enable
* - 0x08 addr_data_f0
* - 0x0C addr_data_f1
* - 0x10 addr_data_f2
* - 0x14 addr_data_f3
* - 0x18 status
* - 0x1C delta_snapshot
* - 0x20 delta_f0
* - 0x24 delta_f0_2
* - 0x28 delta_f1
* - 0x2c delta_f2
* - 0x30 nb_data_by_buffer
* - 0x34 nb_snapshot_param
* - 0x38 start_date
* - 0x3c nb_word_in_buffer
*
*/
waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
//waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08
waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08
waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10
waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); // 0x14
waveform_picker_regs->status = 0x00; // 0x18
//
waveform_picker_regs->delta_snapshot = 0x100; // 0x1c *** 256
waveform_picker_regs->delta_f0 = 0xc1; // 0x20 *** 256 - 63
waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits]
waveform_picker_regs->delta_f1 = 0xc4; // 0x28 *** 256 - 60
waveform_picker_regs->delta_f2 = 0xc0; // 0x2c *** 192
// 128
waveform_picker_regs->nb_data_by_buffer = 0x7f; // 0x30 *** 128 - 1 => nb samples -1
waveform_picker_regs->snapshot_param = 0x80; // 0x34 *** 128 => nb samples
waveform_picker_regs->start_date = 0x00; // 0x38
waveform_picker_regs->nb_word_in_buffer = 0x182; // 0x3c *** 128 * 3 + 2 = 386
paul
Integration of the VHDL_DEV option...
r90 }
paul
Sync
r95
void reset_waveform_picker_regs_vhdl_dev_debug_64()
{
/** This function resets the waveform picker module registers.
*
* The registers affected by this function are located at the following offset addresses:
* - 0x00 data_shaping
* - 0x04 run_burst_enable
* - 0x08 addr_data_f0
* - 0x0C addr_data_f1
* - 0x10 addr_data_f2
* - 0x14 addr_data_f3
* - 0x18 status
* - 0x1C delta_snapshot
* - 0x20 delta_f0
* - 0x24 delta_f0_2
* - 0x28 delta_f1
* - 0x2c delta_f2
* - 0x30 nb_data_by_buffer
* - 0x34 nb_snapshot_param
* - 0x38 start_date
* - 0x3c nb_word_in_buffer
*
*/
waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
//waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08
waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08
waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10
waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); // 0x14
waveform_picker_regs->status = 0x00; // 0x18
//
waveform_picker_regs->delta_snapshot = 0x80; // 0x1c *** 128
waveform_picker_regs->delta_f0 = 0x60; // 0x20 *** 128 - 32 = 96
waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits]
waveform_picker_regs->delta_f1 = 0x62; // 0x28 *** 128 - 30 = 90
waveform_picker_regs->delta_f2 = 0x60; // 0x2c *** 192
// 128
waveform_picker_regs->nb_data_by_buffer = 0x3f; // 0x30 *** 64 - 1 => nb samples -1
waveform_picker_regs->snapshot_param = 0x40; // 0x34 *** 64 => nb samples
waveform_picker_regs->start_date = 0x00; // 0x38
waveform_picker_regs->nb_word_in_buffer = 0xc2; // 0x3c *** 64 * 3 + 2 = 194
}
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 void reset_waveform_picker_regs()
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 {
paul
Header files inclusion reworked...
r40 /** This function resets the waveform picker module registers.
*
* The registers affected by this function are located at the following offset addresses:
* - 0x00 data_shaping
* - 0x04 burst_enable
* - 0x08 addr_data_f0
* - 0x0C addr_data_f1
* - 0x10 addr_data_f2
* - 0x14 addr_data_f3
* - 0x18 status
* - 0x1C delta_snapshot
* - 0x20 delta_f2_f1
* - 0x24 delta_f2_f0
* - 0x28 nb_burst
* - 0x2C nb_snapshot
*
*/
paul
Sync
r95 #ifdef VHDL_DEV
#else
paul
fsw-0-16...
r47 reset_wfp_burst_enable();
paul
fsw-0-20...
r51 reset_wfp_status();
// set buffer addresses
paul
First version of the rings for the waveform picker.
r87 waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0);
waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
paul
Integration of the VHDL_DEV option...
r90 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a);
paul
fsw-0-20...
r51 // set other parameters
set_wfp_data_shaping();
paul
sy_lfr_n_swf_p implemented...
r32 set_wfp_delta_snapshot(); // time in seconds between two snapshots
paul
packet emission task added...
r33 waveform_picker_regs->delta_f2_f1 = 0xffff; // 0x16800 => 92160 (max 4 bytes)
waveform_picker_regs->delta_f2_f0 = 0x17c00; // 97 280 (max 5 bytes)
paul
N = 2352 instead of 2048
r88 // waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets)
// // 3 * 2048 / 16 = 384
// waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1
waveform_picker_regs->nb_burst_available = 0x1b9; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets)
// 3 * 2352 / 16 = 441
waveform_picker_regs->nb_snapshot_param = 0x944; // max 3 octets, 2372 - 1
paul
Sync
r95 #endif
paul
Integration of the VHDL_DEV option...
r90 }
paul
sy_lfr_n_swf_p implemented...
r32
//*****************
// local parameters
paul
Minor modifications to meet Logiscope requirements
r77 void set_local_nb_interrupt_f0_MAX( void )
paul
sy_lfr_n_swf_p implemented...
r32 {
paul
Header files inclusion reworked...
r40 /** This function sets the value of the nb_interrupt_f0_MAX local parameter.
*
* This parameter is used for the SM validation only.\n
* The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices
* module before launching a basic processing.
*
*/
paul
sy_lfr_n_swf_p implemented...
r32 param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256
+ parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100;
}
paul
sequence counters management added
r56 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid )
{
unsigned short *sequence_cnt;
unsigned short segmentation_grouping_flag;
unsigned short new_packet_sequence_control;
paul
fsw-0-20
r58 if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2)
paul
ICD 2.0...
r92 || (sid ==SID_NORM_CWF_F3) || (sid==SID_NORM_CWF_LONG_F3) || (sid ==SID_BURST_CWF_F2) )
paul
sequence counters management added
r56 {
sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST;
}
else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) )
{
sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2;
}
else
{
paul
Bug #861...
r84 sequence_cnt = NULL;
paul
sequence counters management added
r56 PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid)
}
paul
Bug #861...
r84 if (sequence_cnt != NULL)
{
segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8;
*sequence_cnt = (*sequence_cnt) & 0x3fff;
paul
sequence counters management added
r56
paul
Bug #861...
r84 new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ;
paul
sequence counters management added
r56
paul
Bug #861...
r84 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
paul
sequence counters management added
r56
paul
Bug #861...
r84 // increment the sequence counter for the next packet
if ( *sequence_cnt < SEQ_CNT_MAX)
{
*sequence_cnt = *sequence_cnt + 1;
}
else
{
*sequence_cnt = 0;
}
paul
sequence counters management added
r56 }
}