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

📄 dy4max6634.h

📁 Curtiss-Wright Controls Embedded Computing公司的cw183板bsp源代码
💻 H
字号:
/* max6634.h - DY 4 VME-182 board series vxWorks file. *//*********************************************************************************  Filename: dy4max6634.h  **  Copyright 2003 by DY4 Systems.  All Rights Reserved.**  Project Name: 182 BSP **  Target:  182  **  Description: On-board CPU thermal sensor library**  Usage:      **  Log: *  Initial revision *  2003-10-06-JCS        Re-written ********************************************************************************//********************************************************************** * *   Copyright (c) 2003-2004, Dy 4 Systems All rights reserved. *   This Source Code is the Property of Dy 4 Systems Inc. and can *   only be used in accordance with Source Code License *   Agreement of Dy 4 Systems Inc. dba (doing business as)  *   CURTISS-WRIGHT CONTROLS EMBEDDED COMPUTING, "CWCEC".  * **********************************************************************//* Copyright 1984 - 1997 Wind River Systems, Inc. *//*modification history--------------------01b,04non04, tis        -add support for CCA-145                        -add the function STATUS dy4ThermalGetTemp01a,29may03, rgs        Standard file header added*//*DESCRIPTION:Temperature sensors header file.INCLUDE FILES:SEE ALSO:*//* * The maxim 6634 device is a temperature sensor with 2 comparators * The comparators allow an interrupt to be generated for over * and under temperature conditions. * * The device converts the temperatue every 500 mS. * * The device has a fault queue. If the fault queue is of depth * one (default) the first over/under temp warning will trigger * an interrupt. If the fault queue is set to a depth of 4, then * 4 over/under temp compares in a row will result in an int, if * a good temp is read, this clears the queue. * * The device support 2 modes of operation, comparator (default) * and interrupt mode. * * In interrupt mode the device will interrupt if the temp goes * out of range. (T < Tmin)||(T > Tmax) The interrupt will  * continue to be asserted until the temperature goes back  * within range plus the hysterisis temp.  * (T > (Tmin + Thyst))||( T < (Tmax - Thyst)) *  * In comparator mode, the device will interrupt if the temp goes * out of range. (T < Tmin)||(T > Tmax) A read of the temperature will  * clear the interrupt. * The device will interrupt again when the temperature comes back in  * range. (T > (Tmin + Thyst))||( T < (Tmax - Thyst)) * * The temperature sensors are located on the board in the following * layout * *   +--------------------------------+ *   |    +------+  +-----+           | *   | A  | cpu 0|  |cpu 1|           = P1 connector *   =    +------+  +-----+           = *   = FP 0 connector         =  C =  = *   |                  PMC 0 =    =  = *   |                        =    =  = *   |                        =    =  = *   |                        =    =  | *   |                        =    =  = P0 connector *   |                                =  *   |                  PMC 1 =    =  = *   |                        =    =  = *   |                        =    =  | *   |                        =    =  | *   |                        =    =  = P2 connector *   |                        =    =  = *   |                                = *   |                                = *   = FP 1 connector                 = *   |  B                          D  = *   |  =     IPM connectors      =   | *   +--------------------------------+ * *   A = temp sensor 1 - beside CPU 0, top side of card *   B = temp sensor 2 - behind FP 1 connector, bottom side of card *   C = temp sensor 3 - between PMC 0 connectors, top side of card *   D = temp sensor 4 - between IPM and P2 connectors, top side of card * */#ifndef _INCsensh#define _INCsensh#ifdef __cplusplusextern "C" {#endif/* * Card environmental profile type */#define SVME_L000_PROFILE /* see dy4thermalProfile.c */#undef  SVME_L100_PROFILE /* see dy4thermalProfile.c */#undef  DMV_L100_PROFILE  /* see dy4thermalProfile.c */#undef  DMV_L200_PROFILE  /* see dy4thermalProfile.c *//* * Sensor identifier */#ifdef CCA_145typedef enum sensId{    DY4THERMAL_1 = 0,    DY4THERMAL_2,    DY4THERMAL_MAX} DY4THERMAL_ID;#elsetypedef enum sensId{    DY4THERMAL_1 = 0,    DY4THERMAL_2,    DY4THERMAL_3,    DY4THERMAL_4,    DY4THERMAL_MAX} DY4THERMAL_ID;#endif/* * Output format for dy4ThermalRead */typedef enum sensUnit{    DY4THERMAL_CELSIUS = 0,    DY4THERMAL_FAHRENHEIT} DY4THERMAL_UNIT;/* * Register definitions for the MAX-6634 */#define DY4THERMAL_TEMP_REG       0x0	/* Temperature register */#define DY4THERMAL_CONFIG_REG     0x1 /* configuration register, see below for bits */#define DY4THERMAL_THYST_REG      0x2 /* hysterisis reg, delta to deassert alarm    */#define DY4THERMAL_RESERVED_REG   0x3 /* only on max6635 device                     */#define DY4THERMAL_TLOW_REG       0x4 /* warn when temp below this reg value        */#define DY4THERMAL_THIGH_REG      0x5 /* warn when temp above this reg value        *//* * Config register bit definitions */#define DY4THERMAL_CONFIG_SHUTDOWN		0x01  /* go into sleep mode           */#define DY4THERMAL_CONFIG_INT_MODE		0x02  /* interrupt or comparator      */#define DY4THERMAL_CONFIG_OVERT_ACTIVE_HIGH	0x04  /* int line active high or low  */#define DY4THERMAL_CONFIG_ALERT_ACTIVE_HIGH	0x08  /* int line active high or low  */#define DY4THERMAL_CONFIG_FAULT_QUEUE_4DEEP     0x10  /* 4 bad temps before int       */#define DY4THERMAL_CONFIG_I2C_COMPLIENT         0x20  /* SMB or I2C bus interface     */#define DY4THERMAL_CONFIG_INIT_VALUE	(DY4THERMAL_CONFIG_I2C_COMPLIENT | DY4THERMAL_CONFIG_INT_MODE)/* * Some useful constants */#define DY4THERMAL_TEMP_SHIFT	7       #define DY4THERMAL_TEMP_ERROR	2	/* Error in temp read over range in C  *//* * The thermal profile for the card */extern int dy4ThermalTHighTemps[DY4THERMAL_MAX];extern int dy4ThermalTLowTemps[DY4THERMAL_MAX];extern int dy4ThermalTHystTemps[DY4THERMAL_MAX];/* * External API */void dy4ThermalHwInit    (    void    );void dy4ThermalHwInit2    (    void    );void dy4ThermalConnect    (    DY4THERMAL_ID id,     void    (*routine)(int),     int     arg    );STATUS dy4ThermalReadTemp    (    DY4THERMAL_ID   sensId,     DY4THERMAL_UNIT unit,     int       *data    );UINT32 dy4ThermalGetTemp    (    DY4THERMAL_ID   sensId,     DY4THERMAL_UNIT unit    );STATUS dy4ThermalGetConfig    (    DY4THERMAL_ID   sensId,     char      *data    );STATUS dy4ThermalSetConfig    (    DY4THERMAL_ID   sensId,     char      data    );STATUS dy4ThermalGetHighTemp    (    DY4THERMAL_ID   sensId,     int       *data    );STATUS dy4ThermalSetHighTemp    (    DY4THERMAL_ID   sensId,     int       temp    );STATUS dy4ThermalGetLowTemp    (    DY4THERMAL_ID   sensId,     int       *data    );STATUS dy4ThermalSetLowTemp    (    DY4THERMAL_ID   sensId,     int       temp    );STATUS dy4ThermalGetHystTemp    (    DY4THERMAL_ID   sensId,     int       *data    );STATUS dy4ThermalSetHystTemp    (    DY4THERMAL_ID   sensId,     int       temp    );#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

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