versadac  1
versadac - Scalable Recorder Firmware
mrp_monitoring.h
1 /***************************************************************************************
2  *********** Copyright 2005 Zurich University of Applied Sciences / InES **************
3  ***************************************************************************************
4  **
5  ** File : mrp_monitoring.h
6  **
7  ** Description : This file implements the mointoring facility
8  **
9  ***************************************************************************************
10  ** Department : Institute of Embedded Systems
11  ** Project : MRP
12  ** Modul : MRP Monitoring
13  ** Author : Christian Schaer
14  ** Contact : scc@zhwin.ch
15  ** Date : 10.04.2006
16  ****************************** Modifications ******************************************
17  **
18  ** Date : Who : Comment :
19  ** 10.05.06 scc initial release
20  **************************************************************************************/
21 /* $Workfile:: mrp_monitoring.h $*/
22 /* $Revision:: 3 $*/
23 /* $Date:: 16/12/10 14:44 $*/
24 
25 #ifndef MRP_MONITORING_H
26 #define MRP_MONITORING_H
27 
28 
29 /***********************************************************************/
30 /*** Header Files Includes ***/
31 /***********************************************************************/
32 
33 #include "mrp_datatypes.h"
34 #include "mrp_logitf.h"
35 
36 
37 /* **********************************************************************************/
38 /* The logging level is 3 Bit. All values which are >= the mask ( monitoring level) */
39 /* are printed. Errors are always printed independent from the category. */
40 /* The category defines the moduls which should be printed. To print a message the */
41 /* level and the modul must be equal to the mask. */
42 /* |-----|-----|-----|-----| */
43 /* | D/E | category | */
44 /* |-----|-----|-----|-----| */
45 /* **********************************************************************************/
46 
47 #define MRP_LEVEL_NONE 0 << 29
48 #define MRP_LEVEL_ERROR 7 << 29
49 #define MRP_LEVEL_WARNING 4 << 29
50 #define MRP_LEVEL_INFO 2 << 29
51 
52 #define MRP_CAT_PROTOCOLMACHINE 0x0001
53 #define MRP_CAT_FRAMEANALYSER 0x0002
54 #define MRP_CAT_TIMER 0x0004
55 #define MRP_CAT_TX 0x0008
56 #define MRP_CAT_RX 0x0010
57 #define MRP_CAT_PORTITF 0x0020
58 #define MRP_CAT_LINKCHANGE 0x0040
59 
60 
61 
62 
63 
64 /********************************************/
65 /*** Constructors and destructors ***/
66 /********************************************/
67 
68 void MRP_Monitoring_T_Init( Unsigned32 default_mask );
69 
70 void MRP_Monitoring_T_Cleanup( void );
71 
72 
73 /********************************************/
74 /*** public Methods ***/
75 /********************************************/
76 
80 void MRP_Monitoring_T_setPrintMask( Unsigned32 mask );
81 
83 MRPBoolean MRP_Monitoring_T_checkMask( Unsigned32 LOG_MASK );
84 
86 #define MRP_MONITORING( LOG_MASK, DATA1) if( MRP_Monitoring_T_checkMask( LOG_MASK ) ) { MRP_LogIft_T_setLogMask( LOG_MASK ); MRP_LogItf_T_formatString DATA1; }
87 #define MRP_PRINTF(data)
88 #endif
89