Vergil Cola
/
MQTTGateway2
Fork of my original MQTTGateway
Embed:
(wiki syntax)
Show/hide line numbers
SPIRIT_General.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file SPIRIT_General.h 00004 * @author VMA division - AMS 00005 * @version 3.2.2 00006 * @date 08-July-2015 00007 * @brief Configuration and management of SPIRIT General functionalities. 00008 * @details 00009 * 00010 * @attention 00011 * 00012 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> 00013 * 00014 * Redistribution and use in source and binary forms, with or without modification, 00015 * are permitted provided that the following conditions are met: 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 2. Redistributions in binary form must reproduce the above copyright notice, 00019 * this list of conditions and the following disclaimer in the documentation 00020 * and/or other materials provided with the distribution. 00021 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00022 * may be used to endorse or promote products derived from this software 00023 * without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00026 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00028 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00029 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00030 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00031 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00032 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00033 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00034 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 * 00036 ****************************************************************************** 00037 */ 00038 00039 /* Define to prevent recursive inclusion -------------------------------------*/ 00040 #ifndef __SPIRIT_GENERAL_H 00041 #define __SPIRIT_GENERAL_H 00042 00043 00044 /* Includes ------------------------------------------------------------------*/ 00045 00046 #include "SPIRIT_Regs.h" 00047 #include "SPIRIT_Types.h" 00048 00049 00050 #ifdef __cplusplus 00051 extern "C" { 00052 #endif 00053 00054 /** 00055 * @addtogroup SPIRIT_Libraries 00056 * @{ 00057 */ 00058 00059 00060 /** 00061 * @defgroup SPIRIT_General General 00062 * @brief Configuration and management of SPIRIT General functionalities. 00063 * @details See the file <i>@ref SPIRIT_General.h</i> for more details. 00064 * @{ 00065 */ 00066 00067 /** 00068 * @defgroup General_Exported_Types General Exported Types 00069 * @{ 00070 */ 00071 00072 00073 /** 00074 * @brief SPIRIT ModeExtRef enumeration 00075 */ 00076 00077 typedef enum 00078 { 00079 MODE_EXT_XO = 0, 00080 MODE_EXT_XIN = !MODE_EXT_XO 00081 } ModeExtRef; 00082 00083 #define IS_MODE_EXT(MODE) (MODE == MODE_EXT_XO || \ 00084 MODE == MODE_EXT_XIN) 00085 00086 00087 /** 00088 * @brief SPIRIT BatteryLevel enumeration 00089 */ 00090 00091 typedef enum 00092 { 00093 BLD_LVL_2_7_V = 0, 00094 BLD_LVL_2_5_V = 1, 00095 BLD_LVL_2_3_V = 2, 00096 BLD_LVL_2_1_V = 3 00097 } BatteryLevel; 00098 00099 #define IS_BLD_LVL(MODE) (MODE == BLD_LVL_2_7_V || \ 00100 MODE == BLD_LVL_2_5_V || \ 00101 MODE == BLD_LVL_2_3_V || \ 00102 MODE == BLD_LVL_2_1_V) 00103 00104 00105 /** 00106 * @brief SPIRIT GmConf enumeration 00107 */ 00108 00109 typedef enum 00110 { 00111 GM_SU_13_2 = 0, 00112 GM_SU_18_2, 00113 GM_SU_21_5, 00114 GM_SU_25_6, 00115 GM_SU_28_8, 00116 GM_SU_33_9, 00117 GM_SU_38_5, 00118 GM_SU_43_0 00119 } GmConf; 00120 00121 #define IS_GM_CONF(MODE) (MODE == GM_SU_13_2 || \ 00122 MODE == GM_SU_18_2 || \ 00123 MODE == GM_SU_21_5 || \ 00124 MODE == GM_SU_25_6 || \ 00125 MODE == GM_SU_28_8 || \ 00126 MODE == GM_SU_33_9 || \ 00127 MODE == GM_SU_38_5 || \ 00128 MODE == GM_SU_43_0) 00129 00130 00131 /** 00132 * @brief SPIRIT packet type enumeration 00133 */ 00134 00135 typedef enum 00136 { 00137 PKT_BASIC = 0x00, 00138 PKT_MBUS = 0x02, 00139 PKT_STACK 00140 00141 } PacketType; 00142 00143 #define IS_PKT_TYPE(TYPE) (TYPE == PKT_BASIC || \ 00144 TYPE == PKT_MBUS || \ 00145 TYPE == PKT_STACK || \ 00146 ) 00147 00148 00149 /** 00150 * @brief SPIRIT version type enumeration 00151 */ 00152 00153 typedef enum 00154 { 00155 SPIRIT_VERSION_2_1 = 0x01, /* Deprecated */ 00156 SPIRIT_VERSION_3_0, /* The only version of SPIRIT1 */ 00157 } SpiritVersion; 00158 00159 00160 /** 00161 * @} 00162 */ 00163 00164 00165 /** 00166 * @defgroup General_Exported_Constants General Exported Constants 00167 * @{ 00168 */ 00169 00170 00171 /** 00172 * @} 00173 */ 00174 00175 00176 /** 00177 * @defgroup General_Exported_Macros General Exported Macros 00178 * @{ 00179 */ 00180 #define SpiritGeneralLibraryVersion() "Spirit1_Libraries_v.3.2.0" 00181 00182 00183 /** 00184 * @} 00185 */ 00186 00187 00188 /** 00189 * @defgroup General_Exported_Functions General Exported Functions 00190 * @{ 00191 */ 00192 00193 00194 void SpiritGeneralBatteryLevel(SpiritFunctionalState xNewState); 00195 void SpiritGeneralSetBatteryLevel(BatteryLevel xBatteryLevel); 00196 BatteryLevel SpiritGeneralGetBatteryLevel(void); 00197 void SpiritGeneralBrownOut(SpiritFunctionalState xNewState); 00198 void SpiritGeneralHighPwr(SpiritFunctionalState xNewState); 00199 void SpiritGeneralSetExtRef(ModeExtRef xExtMode); 00200 ModeExtRef SpiritGeneralGetExtRef(void); 00201 void SpiritGeneralSetXoGm(GmConf xGm); 00202 GmConf SpiritGeneralGetXoGm(void); 00203 PacketType SpiritGeneralGetPktType(void); 00204 uint16_t SpiritGeneralGetDevicePartNumber(void); 00205 uint8_t SpiritGeneralGetSpiritVersion(void); 00206 00207 /** 00208 * @} 00209 */ 00210 00211 /** 00212 * @} 00213 */ 00214 00215 00216 /** 00217 * @} 00218 */ 00219 00220 00221 #ifdef __cplusplus 00222 } 00223 #endif 00224 00225 #endif 00226 00227 /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/
Generated on Tue Jul 12 2022 18:06:46 by 1.7.2