GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTDB / V5-5-5 > vsbc_bc_pmc1553 / mv2304
#include <string.h>
#include <CTDB/VSBC_bc.h>
#include <CTDB/CO1553_util.h>
#include <CTDB/CO1553_bc.h>
#include <CCSDS/CCSDS_pkt.h>
#include <PBS/WUT.h>
#include <MSG/MSG_pubdefs.h>
#include <VSBC_bc_private.h>
#include <SUMT_private.h>
#include <VSBC_bc_board.h>
Functions | |
static unsigned int | VSBC_bcHandleSyncCmd (VSBC_BC *bc, VSBC_BC_Subaddr subAddr) |
static void | VSBC_bcSwitchHandle (VSBC_BC *bc) |
void | VSBC_bcIntr (VSBC_BC *bc) |
Interrupt handler for driver. | |
WUT_cb_status | VSBC_bcFrame (VSBC_BC *bc, WUT_tmr *timer) |
Start a new bus frame. | |
void | VSBC_bcMsg (VSBC_BC *bc) |
Processes a 1553 data message event. | |
void | VSBC_bcSwitchPost (VSBC_BC *bc, const VSBC_BC_Event event) |
Post primary bus switch operation. |
WUT_cb_status VSBC_bcFrame | ( | VSBC_BC * | bc, | |
WUT_tmr * | timer | |||
) |
Start a new bus frame.
Starts the bus controller processing bus commands to send to the remote terminal. A one second frame timer is also started, so that once the current list of bus commands is processed, the BCRTM device is restarted the next second with the same command list.
bc | A device descriptor. | |
timer | The WUT handle for the frame timer. |
References _VSBC_BC::base_addr, _VSBC_BC::frame_cmd_blk, _VSBC_BC::frame_count, SUMT_addrLocalToChip(), SUMT_REG_CONTROL, SUMT_REG_SRT_DP, _VSBC_BC::sumt_regs, SUMT_STEX, SUMT_WORD_READ, SUMT_WORD_WRITE, VSBC_BC_FRAME_PERIOD, and VSBC_BC_NUM_BUS_FRAME.
Referenced by VSBC_bcStart().
static unsigned int VSBC_bcHandleSyncCmd | ( | VSBC_BC * | bc, | |
VSBC_BC_Subaddr | subAddr | |||
) | [static] |
Responds to a Summit device interrupt indicating that a 1553 frame of commands has completed. Any work to prepare commands for the next frame is completed, and then the data messages from the current frame are serviced.
bc | A device descriptor. | |
subAddr | The key indicating which sync cmd type. |
References _VSBC_BC::bc_lock, _VSBC_BC::cmd_rx_data, CO1553_MSG_SIZE, CO1553_MSG_WORDS, SUMT_memCopyOut(), _VSBC_BC::sync_cmd_arg, _VSBC_BC::sync_cmd_buf, and _VSBC_BC::sync_cmd_handler.
Referenced by VSBC_bcMsg().
void VSBC_bcIntr | ( | VSBC_BC * | bc | ) |
Interrupt handler for driver.
Handles Summit bus controller device interrupts. A descriptor is allocated from the interrupt pool. The internal status register as well as the contents of the event log in shared memory are saved to the interrupt descriptor. The descriptor is placed on a queue to be handled by VSBC_bcTask() at a later time.
bc | A device descriptor. |
References SUMT_DMAF, SUMT_EOL, SUMT_ILLCMD, SUMT_ILLOP, SUMT_MERR, SUMT_REG_COMMAND, SUMT_REG_IRQ_MASK, SUMT_REG_IRQ_PEND, SUMT_REG_STATUS, _VSBC_BC::sumt_regs, SUMT_WORD_READ, SUMT_WRAPF, _VSBC_BC::task_queue, VSBC_BC_EVENT_FRAME, and VSBC_bcBoardIntrAck().
Referenced by VSBC_bcBoardIntrConnect(), and VSBC_bcBoardIntrDisconnect().
void VSBC_bcMsg | ( | VSBC_BC * | bc | ) |
Processes a 1553 data message event.
Responds to a Summit device interrupt indicating that a 1553 frame of commands has completed. Any work to prepare commands for the next frame is completed, and then the data messages from the current frame are serviced.
bc | A device descriptor. |
References _VSBC_BC::bus_switch, _VSBC_BC::cmd_rx_cmd_blk, _VSBC_BC::cmd_rx_data, _VSBC_BC::cmd_rx_inter, _VSBC_BC::cmd_tx_data, _VSBC_BC::cmd_tx_inter, CO1553_bcCmdRxMsg(), CO1553_bcCmdTxMsg(), CO1553_bcTelemMsg(), _VSBC_BC::frame_count, _VSBC_BC::frame_flags, SUMT_BC_EXE, SUMT_BC_OPCODE, SUMT_BC_SKIP, SUMT_CMD_CONTROL, SUMT_memCopyIn(), SUMT_memCopyOut(), SUMT_WORD_READ, SUMT_WORD_WRITE, _VSBC_BC::telem_data, _VSBC_BC::telem_inter, VSBC_BC_NUM_BUS_FRAME, VSBC_BC_SUBADDR_CMD_ANC, VSBC_BC_SUBADDR_CMD_ATT, VSBC_BC_SUBADDR_CMD_RX, VSBC_BC_SUBADDR_CMD_TT, VSBC_BC_SUBADDR_CMD_TX, VSBC_BC_SUBADDR_TELEM_END, VSBC_bcHandleSyncCmd(), and VSBC_bcSwitchHandle().
Referenced by VSBC_bcTask().
static void VSBC_bcSwitchHandle | ( | VSBC_BC * | bc | ) | [static] |
Re-programs the BC command blocks in device shared memory so that the requested bus side is set to primary for all subsequent bus traffic.
bc | A device descriptor. |
References _VSBC_BC::bus_side, _VSBC_BC::bus_switch, _VSBC_BC::cmd_rx_cmd_blk, _VSBC_BC::cmd_tx_cmd_blk, _VSBC_BC::frame_flags, SUMT_BC_CHA, SUMT_BC_CHB, SUMT_CMD_CONTROL, SUMT_WORD_READ, SUMT_WORD_WRITE, _VSBC_BC::telem_data_cmd_blk, _VSBC_BC::telem_end_cmd_blk, _VSBC_BC::telem_msg_count, VSBC_BC_NUM_BUS_FRAME, VSBC_BC_SUBADDR_CMD_ANC, VSBC_BC_SUBADDR_CMD_ATT, VSBC_BC_SUBADDR_CMD_RX, VSBC_BC_SUBADDR_CMD_TT, VSBC_BC_SUBADDR_CMD_TX, and VSBC_BC_SUBADDR_TELEM_END.
Referenced by VSBC_bcMsg().
void VSBC_bcSwitchPost | ( | VSBC_BC * | bc, | |
const VSBC_BC_Event | event | |||
) |
Post primary bus switch operation.
Marks that a bus switch operation has been requested. The actual changeover will occur on the next call to VSBC_bcMsg().
bc | A device descriptor. | |
event | VSBC_BC_EVENT_BUS_A or VSBC_BC_EVENT_BUS_B. |
References _VSBC_BC::bus_side, _VSBC_BC::bus_switch, VSBC_BC_BUS_SIDE_B, and VSBC_BC_EVENT_BUS_A.
Referenced by VSBC_bcTask().