GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / V1-5-0 > lcbd / rad750
#include "LCBD/LCBD_evt.h"
#include "LCBD/LCBD_msgs.h"
#include "LCBD/LCBC.h"
#include "LCBD/LCB.h"
#include "LCBD/LCB_cr.h"
#include "LCBD_p.h"
#include "PBS/INT.ih"
Classes | |
struct | _LCBD_evt_err_maps |
Maps to take an event transfer/receive error/status value, into a standard message code. More... | |
Defines | |
#define | _DUMP_EVT(_title, _evt, _cnt) |
Debugging macro to dump the first _cnt words of the event message. | |
Typedefs | |
typedef struct _LCBD_evt_err_maps | LCBD_evt_err_maps |
Typedef for struct _LCBD_evt_err_maps. | |
Functions | |
static __inline void | lcbd_stats_evt_proto_xct_add (LCBD_stats_evt_proto_xct *xct, unsigned int nwrds) |
Increments the event protocol transaction record statistics. | |
unsigned int | LCBD_evt_cb_set (LCBD lcb, unsigned int proto, LCBD_evt_cb cb, void *prm) |
Sets the event data callback routine and parameter for the specified LATp protocol. | |
LCBD_evt_cbp | LCBD_evt_cbp_get (LCBD lcb, unsigned int proto) |
Retrieves the event data callback routine and parameter for the specified LATp protocol. | |
unsigned int | LCBD_evt_conds_set (LCBD lcb, unsigned int conditions) |
Sets the interrupt conditions for the EVENT FIFO and EVENT ring buffer. | |
unsigned int | LCBD_evt_err_cb_set (LCBD lcb, LCBD_evt_err_cb cb, void *prm) |
Establish callback for event transport errors. | |
LCBD_evt_err_cbp | LCBD_evt_err_cbp_get (LCBD lcb) |
Returns the callback routine for the event transport error handler plus its parameter. | |
unsigned int | LCBD_evt_enable (LCBD lcb, int enable) |
Enables/Disables the flow of events into the LCB. | |
unsigned int | LCBD_evt_handler_create (LCBD lcb, int priority) |
Creates the event que handler service task. | |
unsigned int | LCBD_evt_que_install (LCBD lcb, FORK_que *que) |
Installs queue from fcb as the ISR -> task message queue for event traffic. | |
FORK_que * | LCBD_evt_que_get (LCBD lcb, int que_id) |
Returns a pointer to the event FORK que. This allows outside code to schedule work that is serialized with the event taking. | |
LCBD_evt_que_state | LCBD_evt_tickle (LCBD lcb) |
Callable version of the LCBD ISR. | |
unsigned int | LCBD_evt_rcv_err_map (unsigned int err) |
Maps a receive error to a standard LCB message code. | |
unsigned int | LCBD_evt_xfr_err_map (unsigned int err) |
Maps a event transfer error code to a standard LCB message code. | |
unsigned int | LCBD_evt_free (LCBD lcb, LCBD_evt *evt) |
Frees the a LCBD_evt. | |
unsigned int | LCBD_evt_rng_free (LCBD lcb, LCBD_evt *from, LCBD_evt *to) |
Frees the LCBD_evts from to to exclusively, i.e. excludes the memory associated with to. | |
FORK_cb_status | lcbd_evt_handler (FORK_cb_prm parameter, FORK_msg_hdr *fork_msg) |
The main LCBD descriptor dispatching routine for event traffic. | |
Variables | |
static const LCBD_evt_err_maps | LCBD_Evt_Err_Maps |
Realization of LCB event error to message code mapping arrays. |
CVS $Id
#define _DUMP_EVT | ( | _title, | |||
_evt, | |||||
_cnt | ) |
Debugging macro to dump the first _cnt words of the event message.
This macro active iff the symbol LCBD_DEBUG is defined
unsigned int LCBD_evt_cb_set | ( | LCBD | lcb, | |
unsigned int | proto, | |||
LCBD_evt_cb | cb, | |||
void * | prm | |||
) |
Sets the event data callback routine and parameter for the specified LATp protocol.
LCBD_OK,on | success | |
LCBD_INVPROTO,invalid | protocol, if proto is greater than the maximum |
lcb | Pointer to private LCBD structure | |
proto | LATp protocol to associate queue with. | |
cb | Event data callback routine (event handler) | |
prm | Evevt data callback routine parameter protocol number. |
LCBD_evt_cbp LCBD_evt_cbp_get | ( | LCBD | lcb, | |
unsigned int | proto | |||
) |
Retrieves the event data callback routine and parameter for the specified LATp protocol.
lcb | Pointer to private LCBD structure | |
proto | LATp protocol to associate queue with. |
unsigned int LCBD_evt_conds_set | ( | LCBD | lcb, | |
unsigned int | conditions | |||
) |
Sets the interrupt conditions for the EVENT FIFO and EVENT ring buffer.
The | interrupt conditions before modification |
lcb | Pointer to private LCBD structure | |
conditions | A word reflecting the desired interrupt conditions |
new = LCBD_EVT_CONDS_COMPOSE (LCBD_M_EVT_COND_50_FULL, LCBD_M_EVT_COND_25_FULL); prv = LCBD_evt_cond_set (lcb, new); // Do somethings, then restore prv = LCBD_evt_cond_set (lcb, prv);
unsigned int LCBD_evt_enable | ( | LCBD | lcb, | |
int | enable | |||
) |
Enables/Disables the flow of events into the LCB.
0,Event | enable was not set before this call | |
1,Event | enable was set before this call | |
Anything | else, an LCBD error |
lcb | The LCB driver handle | |
enable | Enable (1) / Disable (0) flag |
unsigned int LCBD_evt_err_cb_set | ( | LCBD | lcb, | |
LCBD_evt_err_cb | cb, | |||
void * | prm | |||
) |
Establish callback for event transport errors.
LCBD_OK |
lcb | The LCB driver handle | |
cb | The LCB event error handler | |
prm | The LCB event error parameter |
LCBD_evt_err_cbp LCBD_evt_err_cbp_get | ( | LCBD | lcb | ) |
Returns the callback routine for the event transport error handler plus its parameter.
lcb | The LCB driver handle |
unsigned int LCBD_evt_free | ( | LCBD | lcb, | |
LCBD_evt * | evt | |||
) |
Frees the a LCBD_evt.
lcb | Pointer to private LCBD structure | |
evt | pointer to LCBD_evt to free |
FORK_cb_status lcbd_evt_handler | ( | FORK_cb_prm | parameter, | |
FORK_msg_hdr * | fork_msg | |||
) |
The main LCBD descriptor dispatching routine for event traffic.
parameter | Pointer to private LCBD structure | |
fork_msg | FORK system message |
unsigned int LCBD_evt_handler_create | ( | LCBD | lcb, | |
int | priority | |||
) |
Creates the event que handler service task.
lcb | The LCBD driver handle | |
priority | The priority of the task. If specified as 0, then a default value is assigned. |
FORK_que * LCBD_evt_que_get | ( | LCBD | lcb, | |
int | que_id | |||
) |
Returns a pointer to the event FORK que. This allows outside code to schedule work that is serialized with the event taking.
lcb | Pointer to private LCBD structure | |
que_id | The ID of the que to get. Currently LCBD is configured with only one que (que_id = 0), but a future enhancement will allow LCBD to be configured with a priority que. |
unsigned int LCBD_evt_que_install | ( | LCBD | lcb, | |
FORK_que * | que | |||
) |
Installs queue from fcb as the ISR -> task message queue for event traffic.
lcb | Pointer to private LCBD structure | |
que | The FORK que to use |
LCBD_OK,on | success; currently there is no failure mode |
TASK_attr attributes; int que_cnt = 3; static const FORK_que_cfg QueCfg[3] = {{ NULL, NULL, NULL, 0}, { NULL, NULL, NULL, 0}, { NULL, NULL, NULL, 0} }; // Fill out the task attribute information attributes.options = 0; attributes.stack_addr = 0; attributes.stack_size = 0; attributes.name = "tLCBDevent"; attributes.priority = 61; // Allocate enough memory to support the FORK task fcb = (FORK_fcb *)MBA_alloc(FORK_fcb_sizeof(que_cnt)); // Create FORK queue status = FORK_create(fcb, // fork control block &attributes, // use task attributes NULL, // default callback lcb, // callback parm NULL, // timeout callback parm TOC_FOREVER, // timeout 3, // define a priority list with 3 queues QueCfg, // Queue configuration 0, // No system messages NULL, // No system messages 0); // No system messages // Locate the que to use and install it que = FORK_que_get (1); status = LCBD_evt_que_install (lcb, que);
unsigned int LCBD_evt_rcv_err_map | ( | unsigned int | err | ) |
Maps a receive error to a standard LCB message code.
err | The receive error to map |
Frees the LCBD_evts from to to exclusively, i.e. excludes the memory associated with to.
lcb | Pointer to private LCBD structure | |
from | The pointer to where the freeing should begin | |
to | The pointer to the next free location |
LCBD_eventq_state LCBD_evt_tickle | ( | LCBD | lcb | ) |
Callable version of the LCBD ISR.
lcb | Pointer to private LCBD structure |
LCBD_EVT_QUE_STATE_BUSY | ||
LCBD_EVT_QUE_STATE_POSTED | ||
LCBD_EVT_QUE_STATE_EMPTY |
unsigned int LCBD_evt_xfr_err_map | ( | unsigned int | err | ) |
Maps a event transfer error code to a standard LCB message code.
err | The transfer error code to map |
static __inline void lcbd_stats_evt_proto_xct_add | ( | LCBD_stats_evt_proto_xct * | xct, | |
unsigned int | nwrds | |||
) | [static] |
Increments the event protocol transaction record statistics.
xct | The event protocol transaction record to update | |
nwrds | The number of words in this transaction |
unsigned int LCBD_Evt_Err_Maps [static] |
Initial value:
{ { 0, LCBD_EOPCIMA, LCBD_EOPCIPE, LCBD_EOPCITA, LCBD_EOUND4, LCBD_EOBUFEMP, LCBD_EOUND6, LCBD_ROQEMPTY, }, { 0, LCBD_EIUND1, LCBD_EIDPERR, LCBD_EITRUNC, } }