GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTDB / V5-5-6 > sumt_rt_poll_sib_boot / rad750


Interface   Data Structures   File List   Data Fields   Globals  

SUMT_rt_poll.c File Reference

Summit polled mode device interface functions. More...

#include <vxWorks.h>
#include <pci.h>
#include <sysLib.h>
#include <string.h>
#include <CTDB/SUMT_rt_poll.h>
#include <CTDB/CO1553_util.h>
#include <CTDB/CTDB_msg.h>
#include <PBS/SPIN.h>
#include <MSG/MSG_pubdefs.h>
#include <mv2600.h>
#include <drv/pci/pciConfigLib.h>
#include <SUMT_private.h>
#include <SUMT_rt_private.h>

Functions

unsigned int SUMT_rtPollBoardInit (SUMT_RT_Poll *rt, unsigned int busAddr)
 Initialize Summit board hardware.
static unsigned int SUMT_rtPollConfigure (SUMT_RT_Poll *rt, const SUMT_RT_Bus_Config *config)
SUMT_RT_PollSUMT_rtPollGet (void)
 Get a pointer to the polled mode remote terminal descriptor.
unsigned int SUMT_rtPollInit (SUMT_RT_Poll *rt, const SUMT_RT_Bus_Config *busConfig, unsigned int busAddr)
 Intialize a polled mode remote terminal driver and 1553 device hardware.
unsigned int SUMT_rtPollStart (SUMT_RT_Poll *rt)
 Start the remote terminal listening for 1553 bus commands.
unsigned int SUMT_rtPollQuery (SUMT_RT_Poll *rt, unsigned short *subAddr, void *buf)
 Query the polled mode remote terminal for any new 1553 bus events.
unsigned int SUMT_rtPollTelem (SUMT_RT_Poll *rt, void *buf, const void *pkt, int size)
 Set the polled mode remote terminal telemetry output values.

Variables

static SUMT_RT_Poll rtPoll
static unsigned int telemPtr [SUMT_RT_POLL_MAX_TELEM_MSG]


Detailed Description

Summit polled mode device interface functions.

Author:
D.L. Wood
Functions to handle initialization and control of the Summit remote terminal within boot code.

Function Documentation

unsigned int SUMT_rtPollBoardInit ( SUMT_RT_Poll rt,
unsigned int  busAddr 
)

Initialize Summit board hardware.

Initializes the board specific functionallity of a Summit hardware board. The board is mapped into the appropriate bus address and the interrupt configuration is setup.

Parameters:
rt A device descriptor.
busAddr The bus base address the board is mapped to.
Returns:
A CTDB MSG code.

References _SUMT_RT_Poll::base_addr, _SUMT_RT_Poll::mem_addr, _SUMT_RT_Poll::mem_size, SUMT_DELAY_RESET_HW, SUMT_MSG, and _SUMT_RT_Poll::sumt_regs.

Referenced by SUMT_rtPollInit().

static unsigned int SUMT_rtPollConfigure ( SUMT_RT_Poll rt,
const SUMT_RT_Bus_Config config 
) [static]

Performs the work necessary to configure the Summit remote terminal device. A RT descriptor structure table is layed out, with all of the subaddresses initially disabled. Each subaddress is given a data buffer large enough to hold one 1553 message. Information about the subaddresses in use is cached in the rt structure.

Parameters:
rt A device descriptor.
config A 1553 bus configuration structure.
Returns:
A CTDB MSG code.

References _SUMT_RT_Poll::base_addr, _SUMT_RT_Poll::cmd_rx_data, _SUMT_RT_Poll::cmd_rx_desc, _SUMT_RT_Bus_Config::cmd_rx_subaddr, _SUMT_RT_Bus_Config::cmd_tx_subaddr, CO1553_MSG_SIZE, _SUMT_RT_Poll::data_buf, _SUMT_RT_Poll::desc_blk, _SUMT_RT_Bus_Config::mode_flags, _SUMT_RT_Poll::rt_addr, _SUMT_RT_Bus_Config::rt_addr, SUMT_addrChipToLocal(), SUMT_addrLocalToChip(), SUMT_DESC_CONTROL, SUMT_DESC_DATA_A_PTR, SUMT_DESC_SIZE, SUMT_MSG, SUMT_REG_I_RCV_0, SUMT_REG_I_RCV_1, SUMT_REG_I_XMT_0, SUMT_REG_I_XMT_1, SUMT_REG_IBRD_RCV_0, SUMT_REG_IBRD_RCV_1, SUMT_REG_IBRD_XMT_0, SUMT_REG_IBRD_XMT_1, SUMT_REG_IMOD_BRD_RCV_0, SUMT_REG_IMOD_BRD_RCV_1, SUMT_REG_IMOD_BRD_XMT_0, SUMT_REG_IMOD_BRD_XMT_1, SUMT_REG_IMOD_RCV_0, SUMT_REG_IMOD_RCV_1, SUMT_REG_IMOD_XMT_0, SUMT_REG_IMOD_XMT_1, SUMT_REG_WRITE, _SUMT_RT_Poll::sumt_regs, SUMT_RT_CTRL_IWA, SUMT_RT_MODE_FLAG_VALID, SUMT_rtLegalize(), SUMT_WMASK_ILL, SUMT_WORD_READ, SUMT_WORD_WRITE, _SUMT_RT_Poll::telem_data, _SUMT_RT_Poll::telem_desc, _SUMT_RT_Poll::telem_msg_count, _SUMT_RT_Bus_Config::telem_msg_count, _SUMT_RT_Bus_Config::telem_subaddr, _SUMT_RT_Poll::wrap_data, and _SUMT_RT_Bus_Config::wrap_subaddr.

Referenced by SUMT_rtPollInit().

SUMT_RT_Poll * SUMT_rtPollGet ( void   ) 

Get a pointer to the polled mode remote terminal descriptor.

Returns a pointer to the global Summit polled mode remote terminal driver descriptor. The user is responsible for calling SUMT_rtPollInit() to initialize this descriptor.

Returns:
A pointer to the device descriptor.

unsigned int SUMT_rtPollInit ( SUMT_RT_Poll rt,
const SUMT_RT_Bus_Config busConfig,
unsigned int  busAddr 
)

Intialize a polled mode remote terminal driver and 1553 device hardware.

Intializes the Summit remote terminal device descriptor and device hardware. The device and associated software structures are configured according to the contents of the busConfig structure.

Parameters:
rt An uninitialized device descriptor.
busConfig The configuration values for the 1553 bus schedule.
busAddr The bus address of the Summit controller board (not needed for PCI Summit boards).
Returns:
A CTDB MSG code.

References _SUMT_RT_Poll::check, _SUMT_RT_Poll::data_buf, _SUMT_RT_Poll::desc_blk, _SUMT_RT_Poll::mem_addr, _SUMT_RT_Poll::mem_size, _SUMT_RT_Bus_Config::rt_addr, SUMT_CHAEN, SUMT_CHBEN, SUMT_DMAF, SUMT_ILCMD, SUMT_memSet(), SUMT_MERR, SUMT_MSEL_RT, SUMT_MSG, SUMT_READY, SUMT_REG_BIT_WORD, SUMT_REG_COMMAND, SUMT_REG_CONTROL, SUMT_REG_I_RCV_0, SUMT_REG_I_RCV_1, SUMT_REG_I_XMT_0, SUMT_REG_I_XMT_1, SUMT_REG_IBRD_RCV_0, SUMT_REG_IBRD_RCV_1, SUMT_REG_IBRD_XMT_0, SUMT_REG_IBRD_XMT_1, SUMT_REG_IMOD_BRD_RCV_0, SUMT_REG_IMOD_BRD_RCV_1, SUMT_REG_IMOD_BRD_XMT_0, SUMT_REG_IMOD_BRD_XMT_1, SUMT_REG_IMOD_RCV_0, SUMT_REG_IMOD_RCV_1, SUMT_REG_IMOD_XMT_0, SUMT_REG_IMOD_XMT_1, SUMT_REG_IRQ_LLP, SUMT_REG_IRQ_MASK, SUMT_REG_IRQ_PEND, SUMT_REG_SRT_DP, SUMT_REG_STATUS, SUMT_REG_STATUS_WORD, SUMT_REG_WRITE, _SUMT_RT_Poll::sumt_regs, SUMT_reset(), SUMT_RT_DESC_SIZE, SUMT_RT_POLL_MAX_TELEM_MSG, SUMT_RTA, SUMT_rtPollBoardInit(), SUMT_rtPollConfigure(), SUMT_RTPTY, SUMT_SSYSF, SUMT_SUBAD, SUMT_test(), SUMT_TPARF, SUMT_WMASK_CONTROL, SUMT_WMASK_IRQ_MASK, SUMT_WMASK_STATUS, SUMT_WORD_READ, SUMT_WRAPF, _SUMT_RT_Poll::telem_counter, _SUMT_RT_Poll::telem_data, _SUMT_RT_Bus_Config::telem_msg_count, and telemPtr.

unsigned int SUMT_rtPollQuery ( SUMT_RT_Poll rt,
unsigned short *  subAddr,
void *  buf 
)

Query the polled mode remote terminal for any new 1553 bus events.

Checks the Summit RT descriptor table to see if any new 1553 bus activity has occurred since the last call. If a new telecommand receive packet is ready, the contents are copied to buf and subAddr is set to SUMT_RT_SUBADDR_CMD_RX. If a the last telemetry packet block has been sent, subAddr is set to SUMT_RT_SUBADDR_TELEM_END. If no new 1553 messages are ready, then the function returns CTDB_TIMEOUT.

Parameters:
rt A device descriptor.
subAddr Holds subaddress key if new 1553 activity.
buf Holds telecommand receive message (should be CO1553_MSG_SIZE bytes in size = 64 bytes).
Returns:
A CTDB MSG code.

References _SUMT_RT_Poll::check, _SUMT_RT_Poll::cmd_rx_data, _SUMT_RT_Poll::cmd_rx_desc, CO1553_MSG_WORDS, SUMT_DESC_CONTROL, SUMT_DMAF, SUMT_ILLCMD, SUMT_memCopyIn(), SUMT_MERR, SUMT_MSG, SUMT_REG_COMMAND, SUMT_REG_IRQ_MASK, SUMT_REG_IRQ_PEND, SUMT_REG_STATUS, _SUMT_RT_Poll::sumt_regs, SUMT_RT_CTRL_BAC, SUMT_RT_SUBADDR_CMD_RX, SUMT_RT_SUBADDR_TELEM_END, SUMT_WORD_READ, SUMT_WORD_WRITE, SUMT_WRAPF, and _SUMT_RT_Poll::telem_desc.

unsigned int SUMT_rtPollStart ( SUMT_RT_Poll rt  ) 

Start the remote terminal listening for 1553 bus commands.

Starts the remote terminal listening on the 1553 bus for commands from the bus controller.

Parameters:
rt A device descriptor.
Returns:
A CTDB MSG code.

References _SUMT_RT_Poll::base_addr, _SUMT_RT_Poll::check, _SUMT_RT_Poll::desc_blk, SUMT_addrLocalToChip(), SUMT_MSG, SUMT_REG_CONTROL, SUMT_REG_SRT_DP, SUMT_REG_WRITE, _SUMT_RT_Poll::sumt_regs, SUMT_STEX, SUMT_WMASK_CONTROL, SUMT_WMASK_SRT_DP, and SUMT_WORD_READ.

unsigned int SUMT_rtPollTelem ( SUMT_RT_Poll rt,
void *  buf,
const void *  pkt,
int  size 
)

Set the polled mode remote terminal telemetry output values.

Prepares a new telemetry packet block for transmission. The buf paramter should point to a buffer for formatting the GLAST telemetry block (GT_PDU). The driver constructs a telemetry block out of the one or more packets in a chain pointed to by pkt. The packet chain is size bytes in total length. The data telemetry data is copied to the Summit controller and will be sent on the next telemetry block read.

Parameters:
rt A device descriptor.
buf Holds telemetry packet block messages (should be CO1553_MSG_SIZE bytes # of telemetry messages).
pkt A point to the telemetry packet to send.
size The size in bytes of pkt.
Returns:
A CTDB MSG code.

References _SUMT_RT_Poll::check, CO1553_MSG_SIZE, CO1553_MSG_WORDS, SUMT_memCopyOut(), SUMT_MSG, _SUMT_RT_Poll::telem_counter, _SUMT_RT_Poll::telem_data, and _SUMT_RT_Poll::telem_msg_count.


Variable Documentation

rtPoll [static]

The static device descriptor for the polled mode remote terminal.

telemPtr [static]

An array of pointers to shared memory telemetry buffers.

Referenced by SUMT_rtPollInit().


Generated on Wed Nov 21 20:05:02 2012 by  doxygen 1.5.8