/** * MIL-STD 1553B Library - Carlo Gavazzi Space * * Filename : \file MilConf.h * * Purposes : \brief MIL-STD 1553B Library - Carlo Gavazzi Space * * Logical Task : * * Author : CGSpace * * Last Developer : $Author: lorenzo $ * * Revision : $Revision: 1.3 * * Checkout Tag : $Name: $ * * Last Modification : $Date: 2006/10/20 09:22:13 $ * * Location : $RCSfile: MilConf.h,v $ * * \version : $Header: /home/local/cvsrep/OBS_FM/1553_Lib/MilConf.h,v 1.10 2006/10/20 09:22:13 lorenzo Exp $ */ /* * Commitments History : * As reported in Main cvs Documentation * ( https://www.cvshome.org/docs/manual/cvs-1.11.18/cvs_12.html#SEC102 ) * The Modification Log has been posted at End Of File. */ // ---------------------------------------------------------------------------// /* MilConf.h - This is the MIlconf.h file header */ /* Purpose: This is the master header file for the ACE Library. . Content: The module contains the following constant and structure SUBHEADINGS Project : HSO/FIRST BASIC S/W Component : HSO/FIRST DRIVERS S/W Filename : $RCSfile: MilConf.h,v $ CI Number : Revision : Revision: 1.3 Company : Carlo Gavazzi Space S.P.A. Author : Andrea Bertoli Creation Date : 2000/10/1 Last ChangeDate: $Date: 2006/10/20 09:22:13 $ SEE ALSO: ADD Ref: Inserted here reference with Architectural Design and Detail Document. Other Ref: Notes: */ #ifndef __MILCONF__ #define __MILCONF__ /* CONF CONSTANTS ---------------------------------------------------------*/ /* card options available with ACE software library */ #define MIL_OTHER 0 /* memory mapped */ #define MIL_MEMMAP 1 /* interrupt type options available with ACE software library */ #define MIL_PULSE 0 #define MIL_LEVEL 1 #define MIL_OPENED 1 #define MIL_CLOSED 0 /* register address offset */ #define INTRPT_MASK 0x00 /* interrupt mask reg (rd/wr) */ #define CONFIG_1 0x01 /* configuration reg #1 (rd/wr) */ #define CONFIG_2 0X02 /* configuration reg #2 (rd/wr) */ #define CONTROL 0X03 /* ace control (start/reset) (wr) */ #define CMD_STK 0X03 /* command stack pointer rd) */ #define CNTRL_WORD 0X04 /* bc ctrl word / rt sacword (rd/wr)*/ #define TIMETAG 0X05 /* timetag register (rd/wr) */ #define INTRPT_STATUS 0X06 /* interrupt status reg (rd/wr) */ #define CONFIG_3 0X07 /* configuration reg #3 (rd/wr) */ #define CONFIG_4 0X08 /* configuration reg #4 (rd/wr) */ #define CONFIG_5 0X09 /* configuration reg #5 (rd/wr) */ #define MT_DATA_STK 0X0A /* monitor data stack addr (rd/wr) */ #define BC_FT_REMAIN 0X0B /* bc frame time remaining (rd) */ #define BC_MSG_REMAIN 0X0C /* bc message time remaining (rd) */ #define BC_FRAME_TIME 0X0D /* bc frame time (rd/wr) */ #define RT_LAST_CMD 0X0D /* rt last command (rd/wr) */ #define MT_TRIGGER_WORD 0X0D /* mt trigger word (rd/wr) */ #define RT_STATUS_WORD 0X0E /* rt status word register (rd) */ #define RT_BIT_WORD 0X0F /* rt bit word register (rd) */ #define MEM_ENABLE 0X18 /* BUS-600000645 memory enable (wr) */ #define MIL_SA_MESSAGE 32 #define MIL_NOT_DEFINED 0 #define MIL_MSG_FREE 1 #define MIL_MSG_READY 2 #define MIL_MSG_FAILED 3 /* CONF TYPE DEFINITIONS AND STRUCTURES -----------------------------------*/ /* ACEMEM TYPE DEFINITIONS AND STRUCTURES --------------------------------*/ /* private data structure for remote terminal mode */ typedef struct RTStruct { unsigned int MilRTLastMsg; }RTType, *RTPtr; /* memory block handle structure */ typedef struct MemBlockStruct { unsigned long m_AbsAddr; unsigned char d_Status; unsigned int j_Size; unsigned int j_Gp; unsigned int j_Condition; struct MemBlockStruct *pw_Next,*pw_Prev; } *MemBlockHandle, MemBlockType; /* structure used to keep track of the context */ struct MilConfStruct { unsigned long m_MilBaseMemAbs;/* absolute base address */ unsigned long m_MilRegBaseAbs;/* 32 bit base register address added*/ unsigned long *pm_MilBaseMem; /* pointer to ace memory */ unsigned long *pm_MilBaseReg; /* pointer to ace registers(mem map) */ unsigned int j_MilIrq; /* level of irq */ unsigned int j_MilMemoryLength;/* size of ace memory(words) */ unsigned char d_MilIsrEnabled;/* isr enable option */ unsigned char d_MilIrqType; /* level/pulse interrupt option */ unsigned char d_MilRegType; unsigned char d_MilIrqInstalled;/* is isr installed? */ unsigned int j_IrqTestFlag; /* used in MilIrqTest */ unsigned char d_AlreadyInit; MemBlockHandle pw_AceMemory; /* ACE library mem managment var */ MemBlockHandle pw_AceListEnd;/* ACE library mem managment var */ MemBlockHandle pw_AceCurrent;/* ACE library mem managment var */ RTPtr pw_RT; /* RT module private data structure */ void (*MilUsrHandler)(int i_MilError); /* ptr to user defined isr */ }; typedef struct MilConfStruct MilConf_t; typedef struct MilConfStruct *MilConf_p; /* structure managing the messages in RAM */ struct RxMsgPointer { unsigned long pm_Msg; unsigned char d_MsgStatus; unsigned int j_Words; }; typedef struct RxMsgPointer RxMsgPointerType; /* structure for managing the buffer messages */ struct RxMsgPointerStruct { RxMsgPointerType *pm_CurrWriteMsg; RxMsgPointerType *pm_InitMsg; unsigned char d_Size; unsigned char d_TypeOfMng; }; typedef struct RxMsgPointerStruct RxMsgPointerStructType; /* CONF FUNCTION PROTOTYPES -----------------------------------------------*/ /* opens library and makes Conf active */ MilConf_p MilOpen(void); /* closes library at active Conf */ MilError_t MilClose(MilConf_p pw_MilConf); /* write register,(offset) words */ MilError_t MilWriteReg(MilConf_p pw_MilConf, unsigned int j_Offset, unsigned int j_Data); /* read register,(offset) words */ unsigned int MilReadReg(MilConf_p pw_MilConf, unsigned int j_Offset); /* read block from memory into word array Ptr[],(offset,length) words */ MilError_t MilBlockRead(MilConf_p pw_MilConf, unsigned int j_Addr, unsigned int *pj_Ptr, unsigned int j_Length); /* read block to memory from word array Ptr[],(offset,length) words */ MilError_t MilBlockWrite(MilConf_p pw_MilConf, unsigned int j_Offset, unsigned int *pj_Ptr, unsigned int j_Length); /* fill an area of memory with data,(offset,length) words */ MilError_t MilBlockFill(MilConf_p pw_MilConf, unsigned int j_Offset, unsigned int j_Data, unsigned int j_Length); /* read RAM cell, offset words */ unsigned int MilReadRam(MilConf_p pw_MilConf, unsigned int j_Offset); /* write RAM cell, offset word */ MilError_t MilWriteRam(MilConf_p pw_MilConf, unsigned int j_Offset, unsigned int j_Data); /* read the message stack*/ MilError_t MilRTReadStack( MilConf_p pw_MilConf, unsigned char d_EnhModeCodeFlag, unsigned char d_EnhModeFlag ); void MilRTInterrptHandler( int i_MilError ); #endif /* __MILCONF__ */ // ---------------------------------------------------------------------------// /* * modification history * -------------------- * $Log: MilConf.h,v $ * Revision 1.10 2006/10/20 09:22:13 lorenzo * 1553 library updated * * Revision 1.7 2006/06/07 11:44:55 scige * Some More Comment * by Scige John Liu IFSI * * Revision 1.6 2006/04/27 10:21:44 scige * Some more Comment alignement before STRONG COMMENTING * * Revision 1.5 2006/02/15 14:56:56 scige * Abstract comment reformatted * History log replaced or moved at end of file * * Revision 1.4 2006/02/15 14:34:03 scige * Some more comments restored * * Revision 1.3 2005/09/16 13:09:38 scige * *** empty log message *** * * Revision 1.1 2005/08/10 12:53:38 scige * Communication Library: 1553 * com1553 * Base Common Version of Spire/Pacs OBS * */