/** * MIL-STD 1553B Library - Carlo Gavazzi Space * * Filename : \file MilAPI.h * * Purposes : \brief MIL-STD 1553B Library - Carlo Gavazzi Space * * Logical Task : N/A * * Author : CGSpace * * Last Developer : $Author: lorenzo $ * * Revision : $Revision: 1.3 * * Checkout Tag : $Name: $ * * Last Modification : $Date: 2006/10/20 09:22:13 $ * * Location : $RCSfile: MilAPI.h,v $ * * \version : $Header: /home/local/cvsrep/OBS_FM/1553_Lib/MilAPI.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. */ // ---------------------------------------------------------------------------// /* include header */ #ifndef __MILAPI__ #define __MILAPI__ /* define struct */ #ifndef __MILSTRUCT__ #define __MILSTRUCT__ 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; #endif /* function prototype */ /* open and initializa ACE struct */ MilConf_p MilOpen(void); /* close ACE struct */ MilError_t MilClose(MilConf_p pw_MilConf); /* open Remote Terminal */ MilError_t MilRTOpen( MilConf_p pw_MilConf ); /* close remote terminal */ MilError_t MilRTClose( MilConf_p pw_MilConf ); /* converts sacw struct to word */ unsigned int Sacw2Word( MilConf_p pw_MilConf, SubAddrCtrlWrd *pw_Sacw ); /* converts word to sacw struct */ SubAddrCtrlWrd Word2Sacw ( MilConf_p pw_MilConf, unsigned int j_Word ); /* allows internal or external BIT word */ unsigned char MilReadParityBit( MilConf_p pw_MilConf ); /* reads RT address */ unsigned char MilRTAddress( MilConf_p pw_MilConf ); /* define the subaddress*/ MilError_t MilRTDefSA( MilConf_p pw_MilConf, unsigned int j_SubAddr, SubAddrCtrlWrd *pw_Sacw ); /* start remote terminal */ MilError_t MilRTRun( MilConf_p pw_MilConf ); /* define legal message */ MilError_t MilRTDefMsgLegal( MilConf_p pw_MilConf, unsigned int MessType, unsigned int j_Subaddr, unsigned int j_Wc ); /* define illegal message*/ MilError_t MilRTDefMsgIllegal( MilConf_p pw_MilConf, unsigned int j_MessType, unsigned int j_Subaddr, unsigned int j_Wc ); /* stop the remote terminal */ void MilRTStop(MilConf_p pw_MilConf); /* enable mode code interrupt */ MilError_t MilRTModeIrqEnable( MilConf_p pw_MilConf, unsigned int j_Broadcast, unsigned char d_t_r, unsigned char d_Data, unsigned int j_Map); /* disable mode code interrupt */ MilError_t MilRTModeIrqDisable( MilConf_p pw_MilConf, unsigned char d_Broadcast, unsigned char d_t_r, unsigned char d_Data, unsigned int j_Map); /* reset ACE chip */ MilError_t MilReset(MilConf_p pw_MilConf); /* read enhanced mode code */ unsigned int MilRTReadEnhMCData(MilConf_p pw_MilConf, unsigned int j_Addr); /* write enhanced mode code */ MilError_t MilRTWriteEnhMCData(MilConf_p pw_MilConf, unsigned int j_Addr, unsigned int j_Data); /* read messages */ unsigned int MilRTReadMsg( MilConf_p pw_MilConf, unsigned int j_MessageNum, MsgType *pw_Message ); /* enable CIRCULAR BUFFER or End of message interrupt */ MilError_t MilRTIrqMsgSaEnable( MilConf_p pw_MilConf, unsigned int j_SubAddr, unsigned char d_t_r, unsigned char d_Selection ); /* disable CIRCULAR BUFFER or End of message interrupt */ MilError_t MilRTIrqMsgSaDisable( MilConf_p pw_MilConf, unsigned int j_SubAddr, unsigned char d_t_r, unsigned char d_Selection ); /* Mil autotest */ MilError_t MilRTSelfTest(MilConf_p pw_MilConf); /* create frame: sequence of messages */ RTPtr MilRTCreateFrame( MilConf_p pw_MilConf ); /* adds message to a frame */ MilError_t MilRTAddMsgtoFrame( MilConf_p pw_MilConf, RTptr pw_FrameID, unsigned int j_Sa, unsigned char d_t_r, unsigned int j_WordCount ); /* reads all the messages in the frame */ MilError_t MilRTFrameRead( MilConf_p pw_MilConf, RTptr pw_FrameID, unsigned int *pj_Buffer, ); /* writes buffer in the frame messages*/ MilError_t MilRTFrameWrite( MilConf_p pw_MilConf, RTptr pw_FrameID, unsigned int *pj_Buffer, ); /* reads the single message */ MilError_t MilRTReadSingleMsg( MilConf_p pw_MilConf, unsigned int *pj_Buffer, unsigned int j_Sa, unsigned int j_WordCount ); /* write the single message */ MilError_t MilRTWriteSingleMsg( MilConf_p pw_MilConf, unsigned int *pj_Buffer, unsigned int j_Sa, unsigned int j_WordCount ); #endif /* __MILAPI__ */ // ---------------------------------------------------------------------------// /* * modification history * -------------------- * $Log: MilAPI.h,v $ * Revision 1.10 2006/10/20 09:22:13 lorenzo * 1553 library updated * * Revision 1.7 2006/10/16 14:19:52 scige * Some More Comments * * Revision 1.6 2006/06/07 11:44:55 scige * Some More Comment * by Scige John Liu IFSI * * Revision 1.5 2006/04/27 10:21:44 scige * Some more Comment alignement before STRONG COMMENTING * * Revision 1.4 2006/02/15 14:56:56 scige * Abstract comment reformatted * History log replaced or moved at end of file * * Revision 1.3 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 * */