Vergil Cola
/
MQTTGateway2
Fork of my original MQTTGateway
Embed:
(wiki syntax)
Show/hide line numbers
SPIRIT_DirectRF.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file SPIRIT_DirectRF.h 00004 * @author VMA division - AMS 00005 * @version 3.2.2 00006 * @date 08-July-2015 00007 * @brief Configuration and management of SPIRIT direct transmission / receive modes. 00008 * @details 00009 * 00010 * This module contains functions to manage the direct Tx/Rx mode. 00011 * The user can choose the way to send data to Spirit through the 00012 * enumerative types <i>@ref DirectTx</i>/<i>@ref DirectRx</i>. 00013 * 00014 * @attention 00015 * 00016 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> 00017 * 00018 * Redistribution and use in source and binary forms, with or without modification, 00019 * are permitted provided that the following conditions are met: 00020 * 1. Redistributions of source code must retain the above copyright notice, 00021 * this list of conditions and the following disclaimer. 00022 * 2. Redistributions in binary form must reproduce the above copyright notice, 00023 * this list of conditions and the following disclaimer in the documentation 00024 * and/or other materials provided with the distribution. 00025 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00026 * may be used to endorse or promote products derived from this software 00027 * without specific prior written permission. 00028 * 00029 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00030 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00031 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00032 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00033 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00034 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00035 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00036 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00037 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00038 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00039 * 00040 ****************************************************************************** 00041 */ 00042 00043 /* Define to prevent recursive inclusion -------------------------------------*/ 00044 #ifndef __SPIRIT1_DIRECT_RF_H 00045 #define __SPIRIT1_DIRECT_RF_H 00046 00047 /* Includes ------------------------------------------------------------------*/ 00048 00049 #include "SPIRIT_Regs.h" 00050 #include "SPIRIT_Types.h" 00051 00052 00053 00054 #ifdef __cplusplus 00055 extern "C" { 00056 #endif 00057 00058 00059 /** 00060 * @addtogroup SPIRIT_Libraries 00061 * @{ 00062 */ 00063 00064 00065 /** 00066 * @defgroup SPIRIT_DirectRf Direct RF 00067 * @brief Configuration and management of SPIRIT direct transmission / receive modes. 00068 * @details See the file <i>@ref SPIRIT_DirectRF.h</i> for more details. 00069 * @{ 00070 */ 00071 00072 /** 00073 * @defgroup DirectRf_Exported_Types Direct RF Exported Types 00074 * @{ 00075 */ 00076 00077 /** 00078 * @brief Direct transmission mode enumeration for SPIRIT. 00079 */ 00080 typedef enum 00081 { 00082 NORMAL_TX_MODE = 0x00, /*!< Normal mode, no direct transmission is used */ 00083 DIRECT_TX_FIFO_MODE = 0x04, /*!< Source is FIFO: payload bits are continuously read from the TX FIFO */ 00084 DIRECT_TX_GPIO_MODE = 0x08, /*!< Source is GPIO: payload bits are continuously read from one of the GPIO ports and transmitted without any processing */ 00085 PN9_TX_MODE = 0x0C /*!< A pseudorandom binary sequence is generated internally */ 00086 }DirectTx; 00087 00088 #define IS_DIRECT_TX(MODE) (((MODE) == NORMAL_TX_MODE) || \ 00089 ((MODE) == DIRECT_TX_FIFO_MODE) || \ 00090 ((MODE) == DIRECT_TX_GPIO_MODE) || \ 00091 ((MODE) == PN9_TX_MODE)) 00092 00093 /** 00094 * @brief Direct receive mode enumeration for SPIRIT. 00095 */ 00096 typedef enum 00097 { 00098 NORMAL_RX_MODE = 0x00, /*!< Normal mode, no direct reception is used */ 00099 DIRECT_RX_FIFO_MODE = 0x10, /*!< Destination is FIFO: payload bits are continuously written to the RX FIFO and not subjected to any processing*/ 00100 DIRECT_RX_GPIO_MODE = 0x20 /*!< Destination is GPIO: payload bits are continuously written to one of the GPIO ports and not subjected to any processing*/ 00101 }DirectRx; 00102 00103 #define IS_DIRECT_RX(MODE) (((MODE) == NORMAL_RX_MODE) || \ 00104 ((MODE) == DIRECT_RX_FIFO_MODE) || \ 00105 ((MODE) == DIRECT_RX_GPIO_MODE)) 00106 00107 00108 /** 00109 *@} 00110 */ 00111 00112 00113 /** 00114 * @defgroup DirectRf_Exported_Constants Direct RF Exported Constants 00115 * @{ 00116 */ 00117 00118 00119 /** 00120 *@} 00121 */ 00122 00123 00124 /** 00125 * @defgroup DirectRf_Exported_Macros Direct RF Exported Macros 00126 * @{ 00127 */ 00128 00129 00130 /** 00131 *@} 00132 */ 00133 00134 00135 /** 00136 * @defgroup DirectRf_Exported_Functions Direct RF Exported Functions 00137 * @{ 00138 */ 00139 00140 void SpiritDirectRfSetRxMode(DirectRx xDirectRx); 00141 DirectRx SpiritDirectRfGetRxMode(void); 00142 void SpiritDirectRfSetTxMode(DirectTx xDirectTx); 00143 DirectTx SpiritDirectRfGetTxMode(void); 00144 00145 /** 00146 *@} 00147 */ 00148 00149 /** 00150 *@} 00151 */ 00152 00153 00154 /** 00155 *@} 00156 */ 00157 00158 00159 #ifdef __cplusplus 00160 } 00161 #endif 00162 00163 #endif 00164 00165 /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/
Generated on Tue Jul 12 2022 18:06:46 by 1.7.2