⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dy4thermalprofile.c

📁 Curtiss-Wright Controls Embedded Computing公司的cw183板bsp源代码
💻 C
字号:
/************************************************************************** * *   Copyright (c) 2005 Curtiss-Wright Controls, Inc. All rights *   reserved.  This Source Code is the Property of Curtiss-Wright *   Controls, Inc. and can only be used in accordance with Source *   Code License Agreement(s) of Curtiss-Wright Controls, Inc. or any *   of its subsidiaries. * **************************************************************************//*FILE HEADER************************************************************** * Product Name: * * Header %name: dy4ThermalProfile.c % * Instance:      kanata_1 * * Description: On-board CPU thermal sensor library * * %created_by:   tissa % * %date_created: Mon Dec 12 17:47:09 2005 % * * Notes: * * History: *  2005,12-12-tis       rename Discovery_II directory to Discovery_III CR#12858. *  2005-11-03-rsr       CR12348 -added boardName.h and dy4max6634.h and *                       -wrapped /h/drv/temp/max.. with ifndef VME_182 *  2005-05-09-tis 	 add CCA-146 support *  2004-10-17-jb 	 add CCA-145 support *  2003-10-06-JCS        Re-written * * ***************************************************************************/#include "vxWorks.h"#include "intLib.h"      #include "h/drv/dy4/boardName.h"#ifdef VME_182#include "dy4182.h"#include "h/drv/thermal/dy4max6634.h"#endif#ifdef CCA_145#include "cca145.h"#endif#ifdef CCA_146#include "cca146.h"#endif#ifdef VME_183#include "cwv183.h"#endif#ifdef VME_183#include "h/drv/discovery_III/i2c/gtI2c.h"#else#include "h/drv/discovery_II/i2c/gtI2c.h"#endif#if defined(CCA_145)|| defined(VME_183)#include "h/drv/thermal/dy4max6634.h"#elif defined(CCA_146)#include "h/drv/thermal/thermalSensors.h"#else#ifndef VME_182#include "h/drv/temp/max6634_dy4.h"#endif#endif#ifdef INCLUDE_DY4DEBUG#include "h/drv/dy4Debug/dy4Debug.h"#else#define DEBUGP(a)         /*  normal debug output */#define DEBUGMP(a)        /*  message output      */#define DEBUGEP(a)  printf a      /*  error output        */#define DEBUGRP(a)        /*  resource output     */#define DEBUGIP(a)        /*  extra info output   */#define DEBUGXP(a)        /*  temporary messages  */#define DEBUGINTDP(a)     /*  interrupt level normal debug output */#define DEBUGINTMP(a)     /*  interrupt level message output      */#define DEBUGINTEP(a)     /*  interrupt level error output        */#define DEBUGINTIP(a)     /*  interrupt level extra info output   */#define DEBUGINTXP(a)     /*  interrupt level temporary messages  */#endif/* * These temperatures are from the mechanical thermal analysis of the 2 base card * types, SVME and DMV. The differential temperatures at each sensor location was * calculated for each thermal profile (Level 0, 100 and 200). These temperatures * are the maximum operating temperatures. There is margin in the design, but operation * above these temperatures is not guaranteed. The application designer may choose * to lower these tempertures so that action can be taken before the limit is reached. * * NOTE: the temperatures are calculated to 1/10 C, but the registers accept only integer * values. High limits are floored, low limit are ceilinged. */#if defined( SVME_L000_PROFILE )  /* SVME-182 Level 000  0C to +50C inlet air temp */    int dy4ThermalTHighTemps[DY4THERMAL_MAX] = {\	( 73 - DY4THERMAL_TEMP_ERROR),  /*  73.7 C max - error */#if defined(CCA_145)	( 66 - DY4THERMAL_TEMP_ERROR)};  /*  66.6 C max - error */#elif defined(CCA_146)	( 66 - DY4THERMAL_TEMP_ERROR),  /*  66.6 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  71.2 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR), /*  66.7 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  92.2 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR)}; /*  87.7 C max - error */#else	( 66 - DY4THERMAL_TEMP_ERROR),  /*  66.6 C max - error */	( 71 - DY4THERMAL_TEMP_ERROR),  /*  71.2 C max - error */	( 66 - DY4THERMAL_TEMP_ERROR)}; /*  66.7 C max - error */#endif    int dy4ThermalTLowTemps[DY4THERMAL_MAX] = {\	( 24 + DY4THERMAL_TEMP_ERROR),  /*  23.7 C min + error */#if defined(CCA_145)	( 17 + DY4THERMAL_TEMP_ERROR)};  /*  16.6 C min + error */#elif defined(CCA_146)	( 17 + DY4THERMAL_TEMP_ERROR),  /*  16.6 C min + error */	( 20 + DY4THERMAL_TEMP_ERROR),  /*  21.2 C min + error */	( 20 + DY4THERMAL_TEMP_ERROR), /*  16.7 C min + error */	( 20 + DY4THERMAL_TEMP_ERROR),  /*  21.2 C min + error */	( 20 + DY4THERMAL_TEMP_ERROR)}; /*  16.7 C min + error */#else	( 17 + DY4THERMAL_TEMP_ERROR),  /*  16.6 C min + error */	( 22 + DY4THERMAL_TEMP_ERROR),  /*  21.2 C min + error */	( 17 + DY4THERMAL_TEMP_ERROR)}; /*  16.7 C min + error */#endif    int dy4ThermalTHystTemps[DY4THERMAL_MAX] = {\	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */#if defined(CCA_145)	(  2 * DY4THERMAL_TEMP_ERROR)};  /*  2 * error          */#elif defined(CCA_146)	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  0  ),	(  0  ),	(  0  ),	(  0  )};#else	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  2 * DY4THERMAL_TEMP_ERROR)}; /*  2 * error          */#endif#elif defined( SVME_L100_PROFILE )/* SVME-182 Level 100 -40C to +71C inlet air temp */    int dy4ThermalTHighTemps[DY4THERMAL_MAX] = {\	( 94 - DY4THERMAL_TEMP_ERROR),  /*  94.7 C max - error */#if defined(CCA_145)	( 87 - DY4THERMAL_TEMP_ERROR)};  /*  87.6 C max - error */#elif  defined(CCA_146)	( 87 - DY4THERMAL_TEMP_ERROR),  /*  87.6 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  92.2 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR), /*  87.7 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  92.2 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR)}; /*  87.7 C max - error */#else	( 87 - DY4THERMAL_TEMP_ERROR),  /*  87.6 C max - error */	( 92 - DY4THERMAL_TEMP_ERROR),  /*  92.2 C max - error */	( 87 - DY4THERMAL_TEMP_ERROR)}; /*  87.7 C max - error */#endif    int dy4ThermalTLowTemps[DY4THERMAL_MAX] = {\	(-17 + DY4THERMAL_TEMP_ERROR),  /* -16.3 C min + error */#if defined(CCA_145)	(-24 + DY4THERMAL_TEMP_ERROR)};  /* -23.4 C min + error */#elif defined(CCA_146)	(-24 + DY4THERMAL_TEMP_ERROR),  /* -23.4 C min + error */	(-19 + DY4THERMAL_TEMP_ERROR),  /* -18.8 C min + error */	(-24 + DY4THERMAL_TEMP_ERROR),  /* -23.4 C min + error */	(-19 + DY4THERMAL_TEMP_ERROR),  /* -18.8 C min + error */	(-24 + DY4THERMAL_TEMP_ERROR)}; /* -23.3 C min + error */#else	(-24 + DY4THERMAL_TEMP_ERROR),  /* -23.4 C min + error */	(-19 + DY4THERMAL_TEMP_ERROR),  /* -18.8 C min + error */	(-24 + DY4THERMAL_TEMP_ERROR)}; /* -23.3 C min + error */#endif    int dy4ThermalTHystTemps[DY4THERMAL_MAX] = {\	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */#if defined(CCA_145)	(  2 * DY4THERMAL_TEMP_ERROR)};  /*  2 * error          */#elif defined(CCA_146)	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  0  ),	(  0  ),	(  0  ),	(  0  )};#else	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  2 * DY4THERMAL_TEMP_ERROR)}; /*  2 * error          */#endif#elif defined( DMV_L100_PROFILE ) /* DMV-182 Level 100  -40C to +71C card edge temp */    int dy4ThermalTHighTemps[DY4THERMAL_MAX] = {\	( 80 - DY4THERMAL_TEMP_ERROR),  /*  80.4 C max - error */#if defined(CCA_145)	( 78 - DY4THERMAL_TEMP_ERROR)};  /*  78.5 C max - error */#elif defined(CCA_146)	( 78 - DY4THERMAL_TEMP_ERROR),  /*  78.5 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  85.5 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  78.5 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  85.5 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR)}; /*  79.2 C max - error */#else	( 78 - DY4THERMAL_TEMP_ERROR),  /*  78.5 C max - error */	( 85 - DY4THERMAL_TEMP_ERROR),  /*  85.5 C max - error */	( 79 - DY4THERMAL_TEMP_ERROR)}; /*  79.2 C max - error */#endif    int dy4ThermalTLowTemps[DY4THERMAL_MAX] = {\	(-31 + DY4THERMAL_TEMP_ERROR),  /* -30.6 C min + error */#if defined(CCA_145) || defined(CCA_146)	(-33 + DY4THERMAL_TEMP_ERROR)};  /* -32.5 C min + error */#elif defined(CCA_146)	(-33 + DY4THERMAL_TEMP_ERROR),  /* -32.5 C min + error */	(-26 + DY4THERMAL_TEMP_ERROR),  /* -25.5 C min + error */	(-33 + DY4THERMAL_TEMP_ERROR),  /* -32.5 C min + error */	(-26 + DY4THERMAL_TEMP_ERROR),  /* -25.5 C min + error */	(-32 + DY4THERMAL_TEMP_ERROR)}; /* -31.8 C min + error */#else	(-33 + DY4THERMAL_TEMP_ERROR),  /* -32.5 C min + error */	(-26 + DY4THERMAL_TEMP_ERROR),  /* -25.5 C min + error */	(-32 + DY4THERMAL_TEMP_ERROR)}; /* -31.8 C min + error */#endif    int dy4ThermalTHystTemps[DY4THERMAL_MAX] = {\	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */#if defined(CCA_145)	(  2 * DY4THERMAL_TEMP_ERROR)};  /*  2 * error          */#elif defined(CCA_146)	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  0  ),	(  0  ),	(  0  ),	(  0  )};#else	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  2 * DY4THERMAL_TEMP_ERROR)}; /*  2 * error          */#endif#elif defined( DMV_L200_PROFILE ) /* DMV-182 Level 100  -40C to +85C card edge temp */    int dy4ThermalTHighTemps[DY4THERMAL_MAX] = {\	( 94 - DY4THERMAL_TEMP_ERROR),  /*  94.4 C max - error */#ifdef CCA_145	( 92 - DY4THERMAL_TEMP_ERROR)};  /*  92.5 C max - error */#elif defined(CCA_146)	( 92 - DY4THERMAL_TEMP_ERROR),  /*  92.5 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  99.5 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  92.5 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR),  /*  99.5 C max - error */	( 100 - DY4THERMAL_TEMP_ERROR)}; /*  93.2 C max - error */#else	( 92 - DY4THERMAL_TEMP_ERROR),  /*  92.5 C max - error */	( 99 - DY4THERMAL_TEMP_ERROR),  /*  99.5 C max - error */	( 93 - DY4THERMAL_TEMP_ERROR)}; /*  93.2 C max - error */#endif    int dy4ThermalTLowTemps[DY4THERMAL_MAX] = {\	(-31 + DY4THERMAL_TEMP_ERROR),  /* -30.6 C min + error */#ifdef CCA_145	(-33 + DY4THERMAL_TEMP_ERROR)};  /* -32.5 C min + error */#elif defined(CCA_146)	(-33 + DY4THERMAL_TEMP_ERROR),  /* -32.5 C min + error */	(-26 + DY4THERMAL_TEMP_ERROR),  /* -25.5 C min + error */	(-33 + DY4THERMAL_TEMP_ERROR),  /* -32.5 C min + error */	(-26 + DY4THERMAL_TEMP_ERROR),  /* -25.5 C min + error */	(-32 + DY4THERMAL_TEMP_ERROR)}; /* -31.8 C min + error */#else	(-33 + DY4THERMAL_TEMP_ERROR),  /* -32.5 C min + error */	(-26 + DY4THERMAL_TEMP_ERROR),  /* -25.5 C min + error */	(-32 + DY4THERMAL_TEMP_ERROR)}; /* -31.8 C min + error */#endif    int dy4ThermalTHystTemps[DY4THERMAL_MAX] = {\	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */#ifdef CCA_145	(  2 * DY4THERMAL_TEMP_ERROR)};  /*  2 * error          */  #elif defined(CCA_146)	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  0  ),	(  0  ),	(  0  ),	(  0  )};#else	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  2 * DY4THERMAL_TEMP_ERROR),  /*  2 * error          */	(  2 * DY4THERMAL_TEMP_ERROR)}; /*  2 * error          */#endif    #endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -