GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LIM / V1-22-3 > lim / linux-gcc
#include <string.h>
#include <ITC/ITC_pubdefs.h>
#include <LIM/LIM_msgs.h>
#include <LIM/LIM_pubdefs.h>
#include <LIM_DB/LIM_DB_schema.h>
#include <LPA/LPA_cmddefs.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/MBA.h>
#include <LIM_action.h>
#include <LIM_bulk.h>
#include <LIM_gbm.h>
#include <LIM_lpa.h>
#include <LIM_pid.h>
#include <LIM_pkt_send.h>
#include <LIM_sc.h>
#include <LIM/LIM_cmddefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <TRD/TRD_pubdefs.h>
Classes | |
struct | _LIM_Gbm_Reset |
Structure to restore LIM-GBM operation after a turbo reset. More... | |
struct | _LIM_Gbm |
State information for a GBM interface object. More... | |
Defines | |
#define | LIM_GBM_VALID_KEY (('L'<<24)+('G'<<16)+('B'<<8)+'M') |
Value that indicates the GBM interface object state is valid. | |
#define | LIM_K_GBM_RESET_FORMAT_0 (0) |
Format of the LIM-GBM entry in the turbo reset database. | |
#define | LIM_K_APID_CONFIG_GBM (1635) |
APID of the Configure GBM command. | |
#define | LIM_K_CONFIGGBM_FCODE (13) |
Function code of the Configure GBM command. | |
Functions | |
static unsigned int | lim_gbm_check (LIM_Gbm *object_p) |
Validate a GBM interface object pointer. | |
static unsigned int | lim_gbm_id_check (LIM_Gbm *object_p, unsigned int trig_id_hi, unsigned int trig_id_lo, unsigned int seq_num) |
Validate the ID within a command from the GBM. | |
static void | LIM_gbm_int_pri_isr (void *parm) |
Service primary GBM interrupts. | |
static void | LIM_gbm_int_red_isr (void *parm) |
Service redundant GBM interrupts. | |
unsigned int | LIM_gbm_new (LIM_Gbm **object_pp, LIM_Action *action_p, LIM_Lpa *lpa_p, LIM_Sc *sc_p, LIM_Bulk *bulk_p, LIM_Pkt_Send *calcinfo_p, LIM_Pkt_Send *closeout_p, LIM_Pkt_Send *repoint_p, const LIM_DB_Schema *db_p) |
Create and initialize a new GBM interface object. | |
unsigned int | LIM_gbm_delete (LIM_Gbm *object_p) |
Shutdown and delete a GBM interface object. | |
unsigned int | LIM_gbm_change_pri_int_allowed (LIM_Gbm *object_p, int new_value, LIM_Task *task_p) |
Change the value of the pri_int_allowed flag. | |
unsigned int | LIM_gbm_change_red_int_allowed (LIM_Gbm *object_p, int new_value, LIM_Task *task_p) |
Change the value of the red_int_allowed flag. | |
unsigned int | LIM_gbm_change_rep_allowed (LIM_Gbm *object_p, int new_value, LIM_Task *task_p) |
Change the value of the GBM-Repoint-Allowed flag. | |
unsigned int | LIM_gbm_get_info (LIM_Gbm *object_p, LIM_Info *info_p) |
Return GBM interface information. | |
unsigned int | LIM_gbm_configure_interrupts (LIM_Gbm *object_p) |
Enable and disable the GBM interrupts. | |
unsigned int | LIM_gbm_enable_interrupts (LIM_Gbm *object_p) |
Enable the GBM interrupts. | |
unsigned int | LIM_gbm_handle_bulk (LIM_Gbm *object_p, LIM_Grb_State grb_state, int *int_occur_p) |
Handle a message on the BULK queue. | |
unsigned int | LIM_gbm_handle_grb_idle (LIM_Gbm *object_p) |
Handle a transition to the GRB-Idle state. | |
int | LIM_gbm_calcinfo_fcode (void) |
Return the function code of the GBM-Calcinfo command. | |
unsigned int | LIM_gbm_sizeof_calcinfo (void) |
Return the size of a GBM-Calcinfo command. | |
unsigned int | LIM_gbm_handle_calcinfo (LIM_Gbm *object_p, const ITC_QueueItem *qitem_p, int forward_ok, int *is_valid_p) |
Handle a GBM-Calcinfo command. | |
int | LIM_gbm_closeout_fcode (void) |
Return the function code of the GBM-Closeout command. | |
unsigned int | LIM_gbm_sizeof_closeout (void) |
Return the size of a GBM-Closeout command. | |
unsigned int | LIM_gbm_handle_closeout (LIM_Gbm *object_p, const ITC_QueueItem *qitem_p, int forward_ok, int *is_valid_p) |
Handle a GBM-Closeout command. | |
int | LIM_gbm_repoint_fcode (void) |
Return the function code of the GBM-Repoint command. | |
unsigned int | LIM_gbm_sizeof_repoint (void) |
Return the size of a GBM-Repoint command. | |
unsigned int | LIM_gbm_handle_repoint (LIM_Gbm *object_p, const ITC_QueueItem *qitem_p, int forward_ok, int slew_req_ok, int *is_valid_p) |
Handle a GBM-Repoint command. | |
void | LIM_cb_gbm_reset (unsigned short fmt, unsigned short len, const void *dat) |
Restore LIM-GBM operations after a turbo reset. |
** CVS $Id: LIM_gbm.c,v 1.21 2011/03/29 21:20:28 apw Exp $ **
void LIM_cb_gbm_reset | ( | unsigned short | fmt, | |
unsigned short | len, | |||
const void * | dat | |||
) |
Restore LIM-GBM operations after a turbo reset.
fmt | (in) Format of global context data | |
len | (in) Length of global context data | |
dat | (in) Global context data |
References _LIM_Config_GBM_Prm::allowed, _LIM_CALLOWGBMBF::bf, LIM_K_APID_CONFIG_GBM, LIM_K_CONFIGGBM_FCODE, LIM_K_GBM_RESET_FORMAT_0, _LIM_Config_GBM_Pkt::pay, _LIM_Gbm_Reset::pri_int_allowed, _LIM_Gbm_Reset::red_int_allowed, and _LIM_Gbm_Reset::rep_req_allowed.
int LIM_gbm_calcinfo_fcode | ( | void | ) |
Return the function code of the GBM-Calcinfo command.
Referenced by LIM_capture_physics_with_db().
unsigned int LIM_gbm_change_pri_int_allowed | ( | LIM_Gbm * | object_p, | |
int | new_value, | |||
LIM_Task * | task_p | |||
) |
Change the value of the pri_int_allowed flag.
object_p | Pointer to GBM interface object. | |
new_value | New flag value. | |
task_p | Pointer to task control object. |
References _LIM_Gbm::action_p, _LIM_Gbm::gbm_reset, LIM_ACTION_GBM_STATE_CHANGE, LIM_action_report(), lim_gbm_check(), LIM_gbm_int_pri_isr(), LIM_K_GBM_RESET_FORMAT_0, LIM_task_lock_access(), LIM_task_unlock_access(), _LIM_Gbm_Reset::pri_int_allowed, _LIM_Gbm::pri_int_allowed, _LIM_Gbm::pri_int_enabled, and _LIM_Gbm::trd.
Referenced by lim_mode_config_gbm().
unsigned int LIM_gbm_change_red_int_allowed | ( | LIM_Gbm * | object_p, | |
int | new_value, | |||
LIM_Task * | task_p | |||
) |
Change the value of the red_int_allowed flag.
object_p | Pointer to GBM interface object. | |
new_value | New flag value. | |
task_p | Pointer to task control object. |
References _LIM_Gbm::action_p, _LIM_Gbm::gbm_reset, LIM_ACTION_GBM_STATE_CHANGE, LIM_action_report(), lim_gbm_check(), LIM_gbm_int_red_isr(), LIM_K_GBM_RESET_FORMAT_0, LIM_task_lock_access(), LIM_task_unlock_access(), _LIM_Gbm_Reset::red_int_allowed, _LIM_Gbm::red_int_allowed, _LIM_Gbm::red_int_enabled, and _LIM_Gbm::trd.
Referenced by lim_mode_config_gbm().
Change the value of the GBM-Repoint-Allowed flag.
object_p | Pointer to GBM interface object. | |
new_value | New flag value. | |
task_p | Pointer to task control object. |
References _LIM_Gbm::action_p, _LIM_Gbm::gbm_reset, LIM_ACTION_GBM_STATE_CHANGE, LIM_action_report(), lim_gbm_check(), LIM_K_GBM_RESET_FORMAT_0, LIM_task_lock_access(), LIM_task_unlock_access(), _LIM_Gbm::rep_allowed, _LIM_Gbm_Reset::rep_req_allowed, and _LIM_Gbm::trd.
Referenced by lim_mode_config_gbm().
unsigned int lim_gbm_check | ( | LIM_Gbm * | object_p | ) | [static] |
Validate a GBM interface object pointer.
object_p | Pointer to GBM interface object. |
References _LIM_Gbm::key, and LIM_GBM_VALID_KEY.
Referenced by LIM_gbm_change_pri_int_allowed(), LIM_gbm_change_red_int_allowed(), LIM_gbm_change_rep_allowed(), LIM_gbm_configure_interrupts(), LIM_gbm_delete(), LIM_gbm_enable_interrupts(), LIM_gbm_get_info(), LIM_gbm_handle_bulk(), LIM_gbm_handle_calcinfo(), LIM_gbm_handle_closeout(), LIM_gbm_handle_grb_idle(), LIM_gbm_handle_repoint(), LIM_gbm_int_pri_isr(), and LIM_gbm_int_red_isr().
int LIM_gbm_closeout_fcode | ( | void | ) |
Return the function code of the GBM-Closeout command.
Referenced by LIM_capture_physics_with_db().
unsigned int LIM_gbm_configure_interrupts | ( | LIM_Gbm * | object_p | ) |
Enable and disable the GBM interrupts.
object_p | Pointer to GBM interface object. |
References _LIM_Gbm::action_p, _LIM_Gbm::gbm_int_configured, lim_gbm_check(), LIM_pid_int_disable_gbm(), LIM_pid_int_enable_gbm(), _LIM_Gbm::pri_int_allowed, _LIM_Gbm::pri_int_enabled, _LIM_Gbm::red_int_allowed, and _LIM_Gbm::red_int_enabled.
Referenced by lim_mode_config_gbm(), and lim_mode_main_feed_on().
unsigned int LIM_gbm_delete | ( | LIM_Gbm * | object_p | ) |
Shutdown and delete a GBM interface object.
object_p | Pointer to object. |
References _LIM_Gbm::key, and lim_gbm_check().
Referenced by LIM_gbm_new(), and LIM_mode_delete().
unsigned int LIM_gbm_enable_interrupts | ( | LIM_Gbm * | object_p | ) |
Enable the GBM interrupts.
object_p | Pointer to GBM interface object. |
References _LIM_Gbm::action_p, _LIM_Gbm::gbm_int_configured, lim_gbm_check(), LIM_pid_int_enable_gbm(), _LIM_Gbm::pri_int_allowed, _LIM_Gbm::pri_int_enabled, _LIM_Gbm::red_int_allowed, and _LIM_Gbm::red_int_enabled.
Referenced by LIM_gbm_handle_grb_idle().
Return GBM interface information.
object_p | Pointer to GBM interface object. | |
info_p | Location to return GBM interface information (must not be NULL). |
References _LIM_Info::gbm_pri_int_allowed, _LIM_Info::gbm_red_int_allowed, _LIM_Info::gbm_rep_allowed, lim_gbm_check(), _LIM_Gbm::pri_int_allowed, _LIM_Gbm::red_int_allowed, and _LIM_Gbm::rep_allowed.
Referenced by LIM_mode_get_info().
unsigned int LIM_gbm_handle_bulk | ( | LIM_Gbm * | object_p, | |
LIM_Grb_State | grb_state, | |||
int * | int_occur_p | |||
) |
Handle a message on the BULK queue.
object_p | Pointer to GBM interface object. | |
grb_state | Current GRB state. | |
int_occur_p | Location to return interrupt status. |
References _LIM_Gbm::action_p, LIM_ACTION_GBM_INT_PRI, LIM_ACTION_GBM_INT_RED, LIM_action_report(), lim_gbm_check(), LIM_GRB_STATE_IDLE, _LIM_Gbm::pri_int, and _LIM_Gbm::red_int.
Referenced by LIM_arr_handle_bulk().
unsigned int LIM_gbm_handle_calcinfo | ( | LIM_Gbm * | object_p, | |
const ITC_QueueItem * | qitem_p, | |||
int | forward_ok, | |||
int * | is_valid_p | |||
) |
Handle a GBM-Calcinfo command.
object_p | Pointer to GBM interface object. | |
qitem_p | Pointer to queue item containing the command. | |
forward_ok | Flag indicating that command can be forwarded to LPA. | |
is_valid_p | Location to return validity indication. |
References _LIM_Gbm::action_p, _LIM_Gbm::calcinfo_p, LIM_ACTION_RCV_GBM_CALCINFO, LIM_action_report(), lim_gbm_check(), lim_gbm_id_check(), LIM_lpa_fwd_gbm_cmd(), and _LIM_Gbm::lpa_p.
Referenced by LIM_arr_handle_calcinfo().
unsigned int LIM_gbm_handle_closeout | ( | LIM_Gbm * | object_p, | |
const ITC_QueueItem * | qitem_p, | |||
int | forward_ok, | |||
int * | is_valid_p | |||
) |
Handle a GBM-Closeout command.
object_p | Pointer to GBM interface object. | |
qitem_p | Pointer to queue item containing the command. | |
forward_ok | Flag indicating that command can be forwarded to LPA. | |
is_valid_p | Location to return validity indication. |
References _LIM_Gbm::action_p, _LIM_Gbm::closeout_p, LIM_ACTION_RCV_GBM_CLOSEOUT, LIM_action_report(), lim_gbm_check(), LIM_lpa_fwd_gbm_cmd(), and _LIM_Gbm::lpa_p.
Referenced by LIM_arr_handle_closeout().
unsigned int LIM_gbm_handle_grb_idle | ( | LIM_Gbm * | object_p | ) |
Handle a transition to the GRB-Idle state.
object_p | Pointer to GBM interface object. |
References _LIM_Gbm::id_valid, lim_gbm_check(), and LIM_gbm_enable_interrupts().
Referenced by lim_arr_set_grb_idle().
unsigned int LIM_gbm_handle_repoint | ( | LIM_Gbm * | object_p, | |
const ITC_QueueItem * | qitem_p, | |||
int | forward_ok, | |||
int | slew_req_ok, | |||
int * | is_valid_p | |||
) |
Handle a GBM-Repoint command.
object_p | Pointer to GBM interface object. | |
qitem_p | Pointer to queue item containing the command. | |
forward_ok | Flag indicating that cmd can be forwarded to LPA. | |
slew_req_ok | Flag indicating that slew-req can be sent to S/C. | |
is_valid_p | Location to return validity indication. |
References _LIM_Gbm::action_p, LIM_ACTION_RCV_GBM_REP_NOREC, LIM_ACTION_RCV_GBM_REP_REC, LIM_action_report(), LIM_ACTION_SEND_SLEW_REQ, lim_gbm_check(), lim_gbm_id_check(), LIM_lpa_fwd_gbm_cmd(), LIM_sc_send_slew_request(), _LIM_Gbm::lpa_p, _LIM_Gbm::rep_allowed, _LIM_Gbm::repoint_dwell, _LIM_Gbm::repoint_p, and _LIM_Gbm::sc_p.
Referenced by LIM_arr_handle_repoint().
unsigned int lim_gbm_id_check | ( | LIM_Gbm * | object_p, | |
unsigned int | trig_id_hi, | |||
unsigned int | trig_id_lo, | |||
unsigned int | seq_num | |||
) | [static] |
Validate the ID within a command from the GBM.
object_p | Pointer to GBM object. | |
trig_id_hi | Trig_id_hi value from the GBM command. | |
trig_id_lo | Trig_id_lo value from the GBM command. | |
seq_num | Seq_num value from the GBM command. |
References _LIM_Gbm::id_valid, _LIM_Gbm::next_seq_num, _LIM_Gbm::trig_id_hi, and _LIM_Gbm::trig_id_lo.
Referenced by LIM_gbm_handle_calcinfo(), and LIM_gbm_handle_repoint().
void LIM_gbm_int_pri_isr | ( | void * | parm | ) | [static] |
Service primary GBM interrupts.
parm | Pointer to GBM interface object. |
References _LIM_Gbm::bulk_p, LIM_bulk_send(), lim_gbm_check(), LIM_pid_int_disable_gbm(), _LIM_Gbm::pri_int, _LIM_Gbm::pri_int_enabled, and _LIM_Gbm::red_int_enabled.
Referenced by LIM_gbm_change_pri_int_allowed(), and LIM_gbm_new().
void LIM_gbm_int_red_isr | ( | void * | parm | ) | [static] |
Service redundant GBM interrupts.
parm | Pointer to GBM interface object. |
References _LIM_Gbm::bulk_p, LIM_bulk_send(), lim_gbm_check(), LIM_pid_int_disable_gbm(), _LIM_Gbm::pri_int_enabled, _LIM_Gbm::red_int, and _LIM_Gbm::red_int_enabled.
Referenced by LIM_gbm_change_red_int_allowed(), and LIM_gbm_new().
unsigned int LIM_gbm_new | ( | LIM_Gbm ** | object_pp, | |
LIM_Action * | action_p, | |||
LIM_Lpa * | lpa_p, | |||
LIM_Sc * | sc_p, | |||
LIM_Bulk * | bulk_p, | |||
LIM_Pkt_Send * | calcinfo_p, | |||
LIM_Pkt_Send * | closeout_p, | |||
LIM_Pkt_Send * | repoint_p, | |||
const LIM_DB_Schema * | db_p | |||
) |
Create and initialize a new GBM interface object.
object_pp | Location to return pointer to new object. | |
action_p | Pointer to an action reporting object. | |
lpa_p | Pointer to an LPA interface object. | |
sc_p | Pointer to a spacecraft interface object. | |
bulk_p | Pointer to a BULK queue object. | |
calcinfo_p | Pointer to pkt sending object for GBM-Calcinfo cmd. | |
closeout_p | Pointer to pkt sending object for GBM-Closeout cmd. | |
repoint_p | Pointer to pkt sending object for GBM-Repoint cmd. | |
db_p | Pointer to configuration information. |
References _LIM_Gbm::action_p, _LIM_Gbm::bulk_p, _LIM_Gbm::calcinfo_p, _LIM_Gbm::closeout_p, _LIM_Gbm::gbm_reset, _LIM_Gbm::id_valid, _LIM_Gbm::key, LIM_gbm_delete(), LIM_gbm_int_pri_isr(), LIM_gbm_int_red_isr(), LIM_GBM_VALID_KEY, LIM_K_GBM_RESET_FORMAT_0, LIM_pid_int_connect_gbm(), _LIM_Gbm::lpa_p, _LIM_Gbm::pri_int, _LIM_Gbm_Reset::pri_int_allowed, _LIM_Gbm::pri_int_allowed, _LIM_Gbm::red_int, _LIM_Gbm_Reset::red_int_allowed, _LIM_Gbm::red_int_allowed, _LIM_Gbm::rep_allowed, _LIM_Gbm_Reset::rep_req_allowed, _LIM_Gbm::repoint_dwell, _LIM_Gbm::repoint_p, _LIM_Gbm::sc_p, and _LIM_Gbm::trd.
Referenced by LIM_mode_new().
int LIM_gbm_repoint_fcode | ( | void | ) |
Return the function code of the GBM-Repoint command.
Referenced by LIM_capture_physics_with_db().
unsigned int LIM_gbm_sizeof_calcinfo | ( | void | ) |
Return the size of a GBM-Calcinfo command.
Referenced by LIM_mode_handle_gbm_calcinfo().
unsigned int LIM_gbm_sizeof_closeout | ( | void | ) |
Return the size of a GBM-Closeout command.
Referenced by LIM_mode_handle_gbm_closeout().
unsigned int LIM_gbm_sizeof_repoint | ( | void | ) |
Return the size of a GBM-Repoint command.
Referenced by LIM_mode_handle_gbm_repoint().