dp_cfg.h
上传用户:hualang
上传日期:2022-04-11
资源大小:104k
文件大小:21k
开发平台:

C/C++

  1. /************************  Filename: dp_cfg.h ********************************/
  2. /* ========================================================================= */
  3. /*                                                                           */
  4. /* 0000  000   000  00000 0  000  0   0 0 0000                               */
  5. /* 0   0 0  0 0   0 0     0 0   0 0   0 0 0   0                              */
  6. /* 0   0 0  0 0   0 0     0 0     0   0 0 0   0      Einsteinstra遝 6        */
  7. /* 0000  000  0   0 000   0 0     00000 0 0000       91074 Herzogenaurach    */
  8. /* 0     00   0   0 0     0 0     0   0 0 0                                  */
  9. /* 0     0 0  0   0 0     0 0   0 0   0 0 0          Tel: ++49-9132-744-200  */
  10. /* 0     0  0  000  0     0  000  0   0 0 0    GmbH  Fax: ++49-9132-744-204  */
  11. /*                                                                           */
  12. /* ========================================================================= */
  13. /*                                                                           */
  14. /* Function: Configuration file for VPC3+                                    */
  15. /*                                                                           */
  16. /* ------------------------------------------------------------------------- */
  17. /*                                                                           */
  18. /* Technical support:       P. Fredehorst                                    */
  19. /*                          Tel. : ++49-9132/744-214                         */
  20. /*                          Fax. :              -204                         */
  21. /*                          eMail: pfredehorst@profichip.com                 */
  22. /*                                                                           */
  23. /*****************************************************************************/
  24. /*****************************************************************************/
  25. /* contents:
  26.     - compiler switches
  27.     - user defines
  28.         -
  29.         - length of buffers
  30.         - defines for MSAC2
  31.         - defines for MSAC1
  32.         - defines for ALARM
  33.         - defines for ISOCHRON
  34.         - defines for DXB PUBLISHER
  35.         - defines for DXB SUBSCRIBER
  36.         - Hardwaremode
  37.         - Interruptevents
  38.     - calculating area (do not edit this part)
  39. */
  40. /*****************************************************************************/
  41. /* reinclude protection */
  42. #ifndef DP_CFG_H
  43. #define DP_CFG_H
  44. #define MAX_DEV_NUM      1
  45. #define NET_A      0
  46. #define NET_B      1
  47. /*--------------------------------------------------------------------------*/
  48. /* profibus services                                                        */
  49. /*--------------------------------------------------------------------------*/
  50. /* todo: setup required services */
  51. /*------------------------------------------*/
  52. /* NOTICE: Only VPC3+/B supports DPV1, DPV2 */
  53. /*------------------------------------------*/
  54. /* DPV1 MSAC1 */
  55. #define DP_MSAC_C1
  56. /* DPV1 MSAC2 */
  57. #define DP_MSAC_C2
  58. /* DPV1 Alarms */
  59. #define DP_ALARM
  60. /* I&M - Identification & Maintenence Functions */
  61. //#define DPV1_IM_SUPP
  62. /* DPV2  */
  63. //#define DP_SUBSCRIBER
  64. //#define DP_DEBUG_ENABLE
  65. #define DP_TIMESTAMP //wusenlin add 
  66. #ifdef DP_TIMESTAMP
  67. #  define SIZE_TIMESTAMP  32
  68. #else
  69. #  define SIZE_TIMESTAMP 0
  70. #endif
  71. /*---------------------------------------------------------------------------*/
  72. /* User defines                                                              */
  73. /*---------------------------------------------------------------------------*/
  74. #define BLACKFIN_SEG_MULDIV (SEG_MULDIV) //16位芯片,乘倍数
  75. #define BLACKFIN_MULTIPLER  1//memset按WORD为单位
  76. #define BFWORD2BYTE(wData) (wData&0xff)
  77. #define BFLONG2WORD(lData) (((lData>>8)&0xff00) | (lData&0xff))
  78. #define BFWORD2LONG(wData) (((wData<<8)&0xff0000)| (wData&0xff))
  79. /*-----------------------------------------------------------------------*/
  80. /* general slave parameter                                               */
  81. /*-----------------------------------------------------------------------*/   
  82. #define DP_ADDR                     ((UBYTE)GetSysCfgValue(ID_SYS_COMM1_ADDRESS)) // Slave address
  83. #define IDENT_NR                    ((UWORD)0x0A50) // PROFIBUS Ident Number
  84. #define USER_WD                     ((UWORD)0x01FF) // User Watchdog
  85.                                                     // set watchdog greater than 0x00FF, if serial printouts used
  86. // The UserWatchdog is only active in DataExchange. The UserWatchdog
  87. // isn't timebased, it's a counter of DataExchange-telegrams.
  88.  
  89. /*-----------------------------------------------------------------------*/
  90. /* define buffer length                                                  */
  91. /*-----------------------------------------------------------------------*/
  92. #define DIN_BUFSIZE                 ((UBYTE)0x80)   // Length of the DIn Buffer (Data Slave to Master)                0..244
  93. #define DOUT_BUFSIZE                ((UBYTE)0x20)   // Length of the DOut Buffer     (Data Master to Slave)           0..244
  94. #define PRM_BUFSIZE                 ((UBYTE)0x40)   // Length of the Parameter Buffer                                 7..244
  95. #define DIAG_BUFSIZE                ((UBYTE)0x40)   // Length of the Diagnosis Buffer                                 6..244
  96. #define CFG_BUFSIZE                 ((UBYTE)0x40)   // Length of the Configuration Buffer                             1..244
  97. #define SSA_BUFSIZE                 ((UBYTE)0x00)   // Length of the Input Data in the Set_Slave_Address-Buffer 0 and 4..244
  98.                                                     // 0: SetSlaveAddress will be deactivated!
  99. /*-----------------------------------------------------------------------*/
  100. /* settings for MSAC_C1                                                  */
  101. /*-----------------------------------------------------------------------*/
  102. #define C1_LEN                      ((UBYTE)0xF4)   // Length of the MSAC_C1 Data
  103.                                                     // The parameter specifies the maximum length of user data including
  104.                                                     // Function_Num, Slot_number, Index, Length, transferred on the
  105.                                                     // MSAC_1 communication channel.
  106.                                                     // Type: Unsigned8 (0 .. 244)
  107. /*-----------------------------------------------------------------------*/
  108. /* settings for MSAC_C1 Alarm                                            */
  109. /*-----------------------------------------------------------------------*/
  110. #define DP_ALARM_OVER_SAP50                         // Alarm Acknowledge over SAP50
  111. /*-----------------------------------------------------------------------*/
  112. /* settings for MSAC_C2                                                  */
  113. /*-----------------------------------------------------------------------*/
  114. #define DP_MSAC_C2_Time                             // enables time control for msac-c2
  115. #define C2_NUM_SAPS                 ((UBYTE)0x03)   // Number of MSAC_C2 connections
  116. #define C2_LEN                      ((UBYTE)0xF4)   // Length of MSAC_C2 Data
  117.                                                     // The parameter specifies the maximum length of an Initiate Request
  118.                                                     // PDU including the Function_Num to the Resource Manager.
  119.                                                     // The parameter specifies the maximum length of user data including
  120.                                                     // Function_Num, Slot_number, Index, Length, transferred on the
  121.                                                     // MSAC_2 communication channel.
  122.                                                     // Type: Unsigned8 (0,52.. 244)
  123. #define C2_FEATURES_SUPPORTED_1     ((UBYTE)0x01)   // default: 0x01, Read and Write supported
  124. #define C2_FEATURES_SUPPORTED_2     ((UBYTE)0x00)   // default: 0x00
  125. #define C2_PROFILE_FEATURES_1       ((UBYTE)0x00)   // default: 0x00, vendor or profile specific
  126. #define C2_PROFILE_FEATURES_2       ((UBYTE)0x00)   // default: 0x00, vendor or profile specific
  127. #define C2_PROFILE_NUMBER           ((UWORD)0x0000) // default: 0x0000, vendor or profile specific
  128. /*-----------------------------------------------------------------------*/
  129. /* settings for DPV2 - Isochron Mode                                     */
  130. /*-----------------------------------------------------------------------*/
  131. #define SYNCH_PULSEWIDTH            ((UBYTE)0xFF)   // Width of Synchpulse in 1/12祍
  132. /*-----------------------------------------------------------------------*/
  133. /* settings for DPV2 - DXB Subscriber                                    */
  134. /*-----------------------------------------------------------------------*/
  135. #define MAX_LINK_SUPPORTED          ((UBYTE)0x05)   // Number of Links
  136. #define MAX_DATA_PER_LINK           ((UBYTE)0x10)   // maximal Number of Data per Link
  137. /*---------------------------------------------------------------------------*/
  138. /* set hardware modes                                                        */
  139. /*---------------------------------------------------------------------------*/
  140. #define DP_VPC3_4KB_MODE // (only VPC3+B, VPC3+C)
  141. /*-----------------------------------------------------------------------*/
  142. /* ModeRegister0 (7..0) ( page 15 )                                      */
  143. /*-----------------------------------------------------------------------*/
  144. //
  145. //  bit  7       6      5        4         3       2       1          0
  146. //  --------------------------------------------------------------------------
  147. //  | Freeze | Sync | Early | Int_Pol | MinTSDR | Res | Dis_Stop | Dis_Start |
  148. //  |  supp. | supp.|  RDY  |         |         |     | Control  | Control   |
  149. //  --------------------------------------------------------------------------
  150. //       1       1      0        0         0       0       0          0        = 0xC0 // Default
  151. //
  152. //BIT 3 = CS_Supported
  153. //wusenlin CS功能测试
  154. #ifdef DP_TIMESTAMP
  155. #  define INIT_VPC3_MODE_REG_L        ((UBYTE)0xC8)
  156. #else
  157. #  define INIT_VPC3_MODE_REG_L        ((UBYTE)0xC0)
  158. #endif
  159. /*-----------------------------------------------------------------------*/
  160. /* ModeRegister0 (15..8) ( page 15 )                                     */
  161. /*-----------------------------------------------------------------------*/
  162. //
  163. //  bit15      14       13           12           11           10         9         8
  164. //  ------------------------------------------------------------------------------------
  165. //  | Res | PrmCmd | Spec_Clear | Spec_Prm |  SetExtPrm  | User_Time | EOI_Time |  DP  |
  166. //  |     |  Supp  |    Mode    | Buf_Mode |     Supp    |    Base   |   Base   | Mode |
  167. //  ------------------------------------------------------------------------------------
  168. //     0       0        1            0              0           1         1         1   = 0x27 // Default
  169. //
  170. #define INIT_VPC3_MODE_REG_H        ((UBYTE)0x27)//0x27
  171. //注: Spec_Clear Mode =1 表示从站可以接收DU=0的Dxchange报文
  172. //以进入故障安全状态
  173. /*-----------------------------------------------------------------------*/
  174. /* ModeRegister2 (7..0) ( page 19 )   (only VPC3+B, VPC3+C)              */
  175. /*-----------------------------------------------------------------------*/
  176. //
  177. //  bit  7          6          5        4       3          2          1            0
  178. //  --------------------------------------------------------------------------------------
  179. //  |  4KB  |   No_Check   | SYNC_  | SYNC_ | DX_Int_ | DX_Int_ |  No_Check_  | NEW_GC_  |
  180. //  |  Mode | Prm_Reserved |  Pol   |  ENA  |  Port   |  Mode   | GC_RESERVED | Int_Mode |
  181. //  --------------------------------------------------------------------------------------
  182. //       1          0          0        0       0          0          0            1        = 0x01 or 0x81
  183. //
  184. #ifdef DP_VPC3_4KB_MODE
  185.     #define INIT_VPC3_MODE_REG_2    ((UBYTE)0x81)
  186. #else
  187.     #define INIT_VPC3_MODE_REG_2    ((UBYTE)0x01)
  188. #endif
  189. /*---------------------------------------------------------------------------*/
  190. /* set interrupt indications                                                 */
  191. /*---------------------------------------------------------------------------*/
  192. /*-----------------------------------------------------------------------*/
  193. /* Interrupt Mask Register (7..0) ( page 23 )                            */
  194. /*-----------------------------------------------------------------------*/
  195. //  bit7       6          5           4             3             2          1         0
  196. //  ----------------------------------------------------------------------------------------
  197. //  | DXB | New_Ext  | DXB_LINK | User_Timer |    WD_DP     | Baud_Rate | Go/Leave |  MAC  |
  198. //  | OUT | PRM_Data |  ERROR   |   Clock    | Mode_Timeout |   detect  |  DataEx  | Reset |
  199. //  ----------------------------------------------------------------------------------------
  200. //     1       0          1           1             1             1          1         0      = 0xBE // Default
  201. //
  202. //wusenlin
  203. #ifdef DP_TIMESTAMP
  204. #  define INIT_VPC3_IND_L  0xFF//0xBF
  205. #else
  206. #  define INIT_VPC3_IND_L  0xFE//0xBE
  207. #endif
  208. /*-----------------------------------------------------------------------*/
  209. /* Interrupt Mask Register (15..8) ( page 23 )                           */
  210. /*-----------------------------------------------------------------------*/
  211. //  bit  15         14       13        12            11       10       9         8
  212. //  -----------------------------------------------------------------------------------
  213. //  | REQ_PDU | POLL_END | DX_OUT | Diag_Buffer | New_PRM | NewCfg | NewSSA |  NewGC  |
  214. //  |   Ind   |    Ind   |        |   Changed   |   Data  |  Data  |  Data  | Command |
  215. //  -----------------------------------------------------------------------------------
  216. //       1          1        1          1            1        1        0         0      = 0xFC // Default
  217. //
  218. #define INIT_VPC3_IND_H  (0xFC)
  219. //#define INIT_VPC3_IND_H  0xDC
  220. /*---------------------------------------------------------------------------*/
  221. /* end of user defines                                                       */
  222. /*---------------------------------------------------------------------------*/
  223. /*---------------------------------------------------------------------------*/
  224. /* !!!!! do not edit this calculating part !!!!!                             */
  225. /*---------------------------------------------------------------------------*/
  226. // == Segmentation VPC3+ ===============================================================
  227. #ifdef DP_VPC3_4KB_MODE
  228.     // 16 Byte segmentation
  229.     #define SEG_OFFSET              ((UBYTE)0x0F)
  230.     #define SEG_MULDIV              ((UBYTE)0x04)
  231.     #define SEG_ADDBYTE             ((UWORD)0xFFF0)
  232.     #define SEG_ADDWORD             ((UWORD)0xFFF0)
  233. #else
  234.     // 8 Byte segmentation
  235.     #define SEG_OFFSET              ((UBYTE)0x07)
  236.     #define SEG_MULDIV              ((UBYTE)0x03)
  237.     #define SEG_ADDBYTE             ((UWORD)0xF8)
  238.     #define SEG_ADDWORD             ((UWORD)0xFFF8)
  239. #endif
  240. // == DPV1/DPV2 ========================================================================
  241. #define DP_C1_USE_RD_WR_SAP         0x01
  242. #define DP_C1_USE_ALARM_SAP         0x04
  243. // == MSAC1 ============================================================================
  244. #ifdef DP_ALARM
  245.    #define DP_MSAC_C1
  246. #endif
  247. #ifdef DP_MSAC_C1
  248.     #define DP_C1_LEN               C1_LEN
  249. // == Alarm ========================================================================
  250. #ifdef DP_ALARM
  251.      #ifdef DP_ALARM_OVER_SAP50
  252.          #define DP_C1_SAPS ( DP_C1_USE_RD_WR_SAP | DP_C1_USE_ALARM_SAP )
  253.         #else
  254.             #define DP_C1_SAPS  ( DP_C1_USE_RD_WR_SAP )
  255.      #endif
  256.     #else
  257.      #define DP_C1_SAPS      ( DP_C1_USE_RD_WR_SAP )
  258. #endif
  259. #else
  260.     #define DP_C1_SAPS              0x00
  261.     #define DP_C1_LEN               ((UBYTE)0x00)
  262.     
  263.     #undef DP_ALARM
  264. #endif
  265. // == MSAC2 ============================================================================
  266. #ifdef DP_MSAC_C2
  267.     #define DP_C2_NUM_SAPS          C2_NUM_SAPS
  268.     #define DP_C2_LEN               C2_LEN
  269. #else
  270.     #define DP_C2_NUM_SAPS          ((UBYTE)0x00)
  271.     #define DP_C2_LEN               ((UBYTE)0x00)
  272. #endif
  273. // == Subscriber =======================================================================
  274. #ifdef DP_SUBSCRIBER
  275.     #define DP_MAX_LINK_SUPPORTED   MAX_LINK_SUPPORTED
  276.     #define DP_MAX_DATA_PER_LINK    MAX_DATA_PER_LINK
  277. #else
  278.     #define DP_MAX_LINK_SUPPORTED   0
  279.     #define DP_MAX_DATA_PER_LINK    0
  280. #endif
  281. // == Calculating FDL list =============================================================
  282. #if ( (defined DP_MSAC_C1) || (defined DP_MSAC_C2) )
  283.    #define DP_FDL
  284. #endif
  285. #if (DP_C1_SAPS & DP_C1_USE_RD_WR_SAP)
  286.     #define DP_TEMP_X1              1
  287. #else
  288.     #define DP_TEMP_X1              0
  289. #endif
  290. #if (DP_C1_SAPS & DP_C1_USE_ALARM_SAP )
  291.    #define DP_TEMP_X2               1
  292.    #define SAP_50
  293. #else
  294.    #define DP_TEMP_X2               0
  295. #endif
  296. #ifdef DP_MSAC_C1
  297.     #define DP_TEMP_X (DP_TEMP_X1 + DP_TEMP_X2)
  298. #else
  299.     #define DP_TEMP_X               0
  300. #endif
  301. #ifdef DP_MSAC_C2
  302.     #define DP_MAX_SAPS             (DP_TEMP_X + DP_C2_NUM_SAPS + 1 )
  303. #else
  304.     #define DP_MAX_SAPS             DP_TEMP_X
  305. #endif
  306. #define DP_ORG_LENGTH               0x40 // organizational parameter
  307. #if (defined (DP_FDL))
  308.    #define FDL_SAP_MAX DP_MAX_SAPS
  309.    /* length of vpc3-sap-list */
  310.    #define SAP_LENGTH          (((FDL_SAP_MAX*7)+SEG_OFFSET) & SEG_ADDBYTE)
  311. #else
  312.    #define SAP_LENGTH               0x10
  313. #endif
  314. #ifdef DP_VPC3_4KB_MODE
  315.     #define ASIC_RAM_LENGTH         0x1000
  316.     #define ASIC_USER_RAM           (ASIC_RAM_LENGTH - DP_ORG_LENGTH - SAP_LENGTH)
  317. #else
  318.     #define ASIC_RAM_LENGTH         0x800
  319.     #define ASIC_USER_RAM           (ASIC_RAM_LENGTH - DP_ORG_LENGTH - SAP_LENGTH)
  320. #endif
  321. #define ISR_ENABLE_VPC3_INT_MAC_RESET               0
  322. #define ISR_ENABLE_VPC3_INT_GO_LEAVE_DATA_EX        0
  323. #define ISR_ENABLE_VPC3_INT_BAUDRATE_DETECT         0
  324. #define ISR_ENABLE_VPC3_INT_WD_DP_TIMEOUT           0
  325. #define ISR_ENABLE_VPC3_INT_USER_TIMER_CLOCK        0
  326. #define ISR_ENABLE_VPC3_INT_DXB_LINK_ERROR          0
  327. #define ISR_ENABLE_VPC3_INT_NEW_EXT_PRM_DATA        0
  328. #define ISR_ENABLE_VPC3_INT_DXB_OUT                 0
  329. #define ISR_ENABLE_VPC3_INT_NEW_GC_COMMAND          0
  330. #define ISR_ENABLE_VPC3_INT_NEW_SSA_DATA            0
  331. #define ISR_ENABLE_VPC3_INT_NEW_CFG_DATA            0
  332. #define ISR_ENABLE_VPC3_INT_NEW_PRM_DATA            0
  333. #define ISR_ENABLE_VPC3_INT_DIAG_BUF_CHANGED        0
  334. #define ISR_ENABLE_VPC3_INT_DX_OUT                  0
  335. #define ISR_ENABLE_VPC3_INT_RESERVED                0
  336. #define ISR_ENABLE_VPC3_INT_SERVICE_ERROR           0
  337. #if( INIT_VPC3_IND_L & 0x01 )
  338.     #undef  ISR_ENABLE_VPC3_INT_MAC_RESET
  339.     #define ISR_ENABLE_VPC3_INT_MAC_RESET           1
  340. #endif
  341. #if( INIT_VPC3_IND_L & 0x02 )
  342.     #undef  ISR_ENABLE_VPC3_INT_GO_LEAVE_DATA_EX
  343.     #define ISR_ENABLE_VPC3_INT_GO_LEAVE_DATA_EX    1
  344. #endif
  345. #if( INIT_VPC3_IND_L & 0x04 )
  346.     #undef  ISR_ENABLE_VPC3_INT_BAUDRATE_DETECT
  347.     #define ISR_ENABLE_VPC3_INT_BAUDRATE_DETECT     1
  348. #endif
  349. #if( INIT_VPC3_IND_L & 0x08 )
  350.     #undef  ISR_ENABLE_VPC3_INT_WD_DP_TIMEOUT
  351.     #define ISR_ENABLE_VPC3_INT_WD_DP_TIMEOUT       1
  352. #endif
  353. #if( INIT_VPC3_IND_L & 0x10 )
  354.     #undef  ISR_ENABLE_VPC3_INT_USER_TIMER_CLOCK
  355.     #define ISR_ENABLE_VPC3_INT_USER_TIMER_CLOCK    1
  356. #endif
  357. #if( INIT_VPC3_IND_L & 0x20 )
  358.     #undef  ISR_ENABLE_VPC3_INT_DXB_LINK_ERROR
  359.     #define ISR_ENABLE_VPC3_INT_DXB_LINK_ERROR      1
  360. #endif
  361. #if( INIT_VPC3_IND_L & 0x40 )
  362.     #undef  ISR_ENABLE_VPC3_INT_NEW_EXT_PRM_DATA
  363.     #define ISR_ENABLE_VPC3_INT_NEW_EXT_PRM_DATA    1
  364. #endif
  365. #if( INIT_VPC3_IND_L & 0x80 )
  366.     #undef  ISR_ENABLE_VPC3_INT_DXB_OUT
  367.     #define ISR_ENABLE_VPC3_INT_DXB_OUT             1
  368. #endif
  369. #if( INIT_VPC3_IND_H & 0x01 )
  370.     #undef  ISR_ENABLE_VPC3_INT_NEW_GC_COMMAND
  371.     #define ISR_ENABLE_VPC3_INT_NEW_GC_COMMAND      1
  372. #endif
  373. #if( INIT_VPC3_IND_H & 0x02 )
  374.     #undef  ISR_ENABLE_VPC3_INT_NEW_SSA_DATA
  375.     #define ISR_ENABLE_VPC3_INT_NEW_SSA_DATA        1
  376. #endif
  377. #if( INIT_VPC3_IND_H & 0x04 )
  378.     #undef  ISR_ENABLE_VPC3_INT_NEW_CFG_DATA
  379.     #define ISR_ENABLE_VPC3_INT_NEW_CFG_DATA        1
  380. #endif
  381. #if( INIT_VPC3_IND_H & 0x08 )
  382.     #undef  ISR_ENABLE_VPC3_INT_NEW_PRM_DATA
  383.     #define ISR_ENABLE_VPC3_INT_NEW_PRM_DATA        1
  384. #endif
  385. #if( INIT_VPC3_IND_H & 0x10 )
  386.     #undef  ISR_ENABLE_VPC3_INT_DIAG_BUF_CHANGED
  387.     #define ISR_ENABLE_VPC3_INT_DIAG_BUF_CHANGED    1
  388. #endif
  389. #if( INIT_VPC3_IND_H & 0x20 )
  390.     #undef  ISR_ENABLE_VPC3_INT_DX_OUT
  391.     #define ISR_ENABLE_VPC3_INT_DX_OUT              1
  392. #endif
  393. #if( INIT_VPC3_IND_H & 0x40 )
  394.     #undef  ISR_ENABLE_VPC3_INT_POLL_END_IND
  395.     #define ISR_ENABLE_VPC3_INT_POLL_END_IND        1
  396. #endif
  397. #if( INIT_VPC3_IND_H & 0x80 )
  398.     #undef  ISR_ENABLE_VPC3_INT_FDL_IND
  399.     #define ISR_ENABLE_VPC3_INT_FDL_IND             1
  400. #endif
  401. /*****************************************************************************/
  402. /* reinclude-protection */
  403. #else
  404.     #pragma message "The header DP_CFG.H is included twice or more !"
  405. #endif
  406. /*****************************************************************************/
  407. /*  Copyright (C) profichip GmbH 2004. Confidential.                         */
  408. /*****************************************************************************/