Vergil Cola
/
MQTTGateway2
Fork of my original MQTTGateway
easy-connect/stm-spirit1-rf-driver/source/libs/spirit1/SPIRIT1_Library/Inc/SPIRIT_DirectRF.h@0:a1734fe1ec4b, 2017-04-08 (annotated)
- Committer:
- vpcola
- Date:
- Sat Apr 08 14:43:14 2017 +0000
- Revision:
- 0:a1734fe1ec4b
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vpcola | 0:a1734fe1ec4b | 1 | /** |
vpcola | 0:a1734fe1ec4b | 2 | ****************************************************************************** |
vpcola | 0:a1734fe1ec4b | 3 | * @file SPIRIT_DirectRF.h |
vpcola | 0:a1734fe1ec4b | 4 | * @author VMA division - AMS |
vpcola | 0:a1734fe1ec4b | 5 | * @version 3.2.2 |
vpcola | 0:a1734fe1ec4b | 6 | * @date 08-July-2015 |
vpcola | 0:a1734fe1ec4b | 7 | * @brief Configuration and management of SPIRIT direct transmission / receive modes. |
vpcola | 0:a1734fe1ec4b | 8 | * @details |
vpcola | 0:a1734fe1ec4b | 9 | * |
vpcola | 0:a1734fe1ec4b | 10 | * This module contains functions to manage the direct Tx/Rx mode. |
vpcola | 0:a1734fe1ec4b | 11 | * The user can choose the way to send data to Spirit through the |
vpcola | 0:a1734fe1ec4b | 12 | * enumerative types <i>@ref DirectTx</i>/<i>@ref DirectRx</i>. |
vpcola | 0:a1734fe1ec4b | 13 | * |
vpcola | 0:a1734fe1ec4b | 14 | * @attention |
vpcola | 0:a1734fe1ec4b | 15 | * |
vpcola | 0:a1734fe1ec4b | 16 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
vpcola | 0:a1734fe1ec4b | 17 | * |
vpcola | 0:a1734fe1ec4b | 18 | * Redistribution and use in source and binary forms, with or without modification, |
vpcola | 0:a1734fe1ec4b | 19 | * are permitted provided that the following conditions are met: |
vpcola | 0:a1734fe1ec4b | 20 | * 1. Redistributions of source code must retain the above copyright notice, |
vpcola | 0:a1734fe1ec4b | 21 | * this list of conditions and the following disclaimer. |
vpcola | 0:a1734fe1ec4b | 22 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
vpcola | 0:a1734fe1ec4b | 23 | * this list of conditions and the following disclaimer in the documentation |
vpcola | 0:a1734fe1ec4b | 24 | * and/or other materials provided with the distribution. |
vpcola | 0:a1734fe1ec4b | 25 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
vpcola | 0:a1734fe1ec4b | 26 | * may be used to endorse or promote products derived from this software |
vpcola | 0:a1734fe1ec4b | 27 | * without specific prior written permission. |
vpcola | 0:a1734fe1ec4b | 28 | * |
vpcola | 0:a1734fe1ec4b | 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
vpcola | 0:a1734fe1ec4b | 30 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
vpcola | 0:a1734fe1ec4b | 31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
vpcola | 0:a1734fe1ec4b | 32 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
vpcola | 0:a1734fe1ec4b | 33 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
vpcola | 0:a1734fe1ec4b | 34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
vpcola | 0:a1734fe1ec4b | 35 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
vpcola | 0:a1734fe1ec4b | 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
vpcola | 0:a1734fe1ec4b | 37 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
vpcola | 0:a1734fe1ec4b | 38 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
vpcola | 0:a1734fe1ec4b | 39 | * |
vpcola | 0:a1734fe1ec4b | 40 | ****************************************************************************** |
vpcola | 0:a1734fe1ec4b | 41 | */ |
vpcola | 0:a1734fe1ec4b | 42 | |
vpcola | 0:a1734fe1ec4b | 43 | /* Define to prevent recursive inclusion -------------------------------------*/ |
vpcola | 0:a1734fe1ec4b | 44 | #ifndef __SPIRIT1_DIRECT_RF_H |
vpcola | 0:a1734fe1ec4b | 45 | #define __SPIRIT1_DIRECT_RF_H |
vpcola | 0:a1734fe1ec4b | 46 | |
vpcola | 0:a1734fe1ec4b | 47 | /* Includes ------------------------------------------------------------------*/ |
vpcola | 0:a1734fe1ec4b | 48 | |
vpcola | 0:a1734fe1ec4b | 49 | #include "SPIRIT_Regs.h" |
vpcola | 0:a1734fe1ec4b | 50 | #include "SPIRIT_Types.h" |
vpcola | 0:a1734fe1ec4b | 51 | |
vpcola | 0:a1734fe1ec4b | 52 | |
vpcola | 0:a1734fe1ec4b | 53 | |
vpcola | 0:a1734fe1ec4b | 54 | #ifdef __cplusplus |
vpcola | 0:a1734fe1ec4b | 55 | extern "C" { |
vpcola | 0:a1734fe1ec4b | 56 | #endif |
vpcola | 0:a1734fe1ec4b | 57 | |
vpcola | 0:a1734fe1ec4b | 58 | |
vpcola | 0:a1734fe1ec4b | 59 | /** |
vpcola | 0:a1734fe1ec4b | 60 | * @addtogroup SPIRIT_Libraries |
vpcola | 0:a1734fe1ec4b | 61 | * @{ |
vpcola | 0:a1734fe1ec4b | 62 | */ |
vpcola | 0:a1734fe1ec4b | 63 | |
vpcola | 0:a1734fe1ec4b | 64 | |
vpcola | 0:a1734fe1ec4b | 65 | /** |
vpcola | 0:a1734fe1ec4b | 66 | * @defgroup SPIRIT_DirectRf Direct RF |
vpcola | 0:a1734fe1ec4b | 67 | * @brief Configuration and management of SPIRIT direct transmission / receive modes. |
vpcola | 0:a1734fe1ec4b | 68 | * @details See the file <i>@ref SPIRIT_DirectRF.h</i> for more details. |
vpcola | 0:a1734fe1ec4b | 69 | * @{ |
vpcola | 0:a1734fe1ec4b | 70 | */ |
vpcola | 0:a1734fe1ec4b | 71 | |
vpcola | 0:a1734fe1ec4b | 72 | /** |
vpcola | 0:a1734fe1ec4b | 73 | * @defgroup DirectRf_Exported_Types Direct RF Exported Types |
vpcola | 0:a1734fe1ec4b | 74 | * @{ |
vpcola | 0:a1734fe1ec4b | 75 | */ |
vpcola | 0:a1734fe1ec4b | 76 | |
vpcola | 0:a1734fe1ec4b | 77 | /** |
vpcola | 0:a1734fe1ec4b | 78 | * @brief Direct transmission mode enumeration for SPIRIT. |
vpcola | 0:a1734fe1ec4b | 79 | */ |
vpcola | 0:a1734fe1ec4b | 80 | typedef enum |
vpcola | 0:a1734fe1ec4b | 81 | { |
vpcola | 0:a1734fe1ec4b | 82 | NORMAL_TX_MODE = 0x00, /*!< Normal mode, no direct transmission is used */ |
vpcola | 0:a1734fe1ec4b | 83 | DIRECT_TX_FIFO_MODE = 0x04, /*!< Source is FIFO: payload bits are continuously read from the TX FIFO */ |
vpcola | 0:a1734fe1ec4b | 84 | DIRECT_TX_GPIO_MODE = 0x08, /*!< Source is GPIO: payload bits are continuously read from one of the GPIO ports and transmitted without any processing */ |
vpcola | 0:a1734fe1ec4b | 85 | PN9_TX_MODE = 0x0C /*!< A pseudorandom binary sequence is generated internally */ |
vpcola | 0:a1734fe1ec4b | 86 | }DirectTx; |
vpcola | 0:a1734fe1ec4b | 87 | |
vpcola | 0:a1734fe1ec4b | 88 | #define IS_DIRECT_TX(MODE) (((MODE) == NORMAL_TX_MODE) || \ |
vpcola | 0:a1734fe1ec4b | 89 | ((MODE) == DIRECT_TX_FIFO_MODE) || \ |
vpcola | 0:a1734fe1ec4b | 90 | ((MODE) == DIRECT_TX_GPIO_MODE) || \ |
vpcola | 0:a1734fe1ec4b | 91 | ((MODE) == PN9_TX_MODE)) |
vpcola | 0:a1734fe1ec4b | 92 | |
vpcola | 0:a1734fe1ec4b | 93 | /** |
vpcola | 0:a1734fe1ec4b | 94 | * @brief Direct receive mode enumeration for SPIRIT. |
vpcola | 0:a1734fe1ec4b | 95 | */ |
vpcola | 0:a1734fe1ec4b | 96 | typedef enum |
vpcola | 0:a1734fe1ec4b | 97 | { |
vpcola | 0:a1734fe1ec4b | 98 | NORMAL_RX_MODE = 0x00, /*!< Normal mode, no direct reception is used */ |
vpcola | 0:a1734fe1ec4b | 99 | DIRECT_RX_FIFO_MODE = 0x10, /*!< Destination is FIFO: payload bits are continuously written to the RX FIFO and not subjected to any processing*/ |
vpcola | 0:a1734fe1ec4b | 100 | 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*/ |
vpcola | 0:a1734fe1ec4b | 101 | }DirectRx; |
vpcola | 0:a1734fe1ec4b | 102 | |
vpcola | 0:a1734fe1ec4b | 103 | #define IS_DIRECT_RX(MODE) (((MODE) == NORMAL_RX_MODE) || \ |
vpcola | 0:a1734fe1ec4b | 104 | ((MODE) == DIRECT_RX_FIFO_MODE) || \ |
vpcola | 0:a1734fe1ec4b | 105 | ((MODE) == DIRECT_RX_GPIO_MODE)) |
vpcola | 0:a1734fe1ec4b | 106 | |
vpcola | 0:a1734fe1ec4b | 107 | |
vpcola | 0:a1734fe1ec4b | 108 | /** |
vpcola | 0:a1734fe1ec4b | 109 | *@} |
vpcola | 0:a1734fe1ec4b | 110 | */ |
vpcola | 0:a1734fe1ec4b | 111 | |
vpcola | 0:a1734fe1ec4b | 112 | |
vpcola | 0:a1734fe1ec4b | 113 | /** |
vpcola | 0:a1734fe1ec4b | 114 | * @defgroup DirectRf_Exported_Constants Direct RF Exported Constants |
vpcola | 0:a1734fe1ec4b | 115 | * @{ |
vpcola | 0:a1734fe1ec4b | 116 | */ |
vpcola | 0:a1734fe1ec4b | 117 | |
vpcola | 0:a1734fe1ec4b | 118 | |
vpcola | 0:a1734fe1ec4b | 119 | /** |
vpcola | 0:a1734fe1ec4b | 120 | *@} |
vpcola | 0:a1734fe1ec4b | 121 | */ |
vpcola | 0:a1734fe1ec4b | 122 | |
vpcola | 0:a1734fe1ec4b | 123 | |
vpcola | 0:a1734fe1ec4b | 124 | /** |
vpcola | 0:a1734fe1ec4b | 125 | * @defgroup DirectRf_Exported_Macros Direct RF Exported Macros |
vpcola | 0:a1734fe1ec4b | 126 | * @{ |
vpcola | 0:a1734fe1ec4b | 127 | */ |
vpcola | 0:a1734fe1ec4b | 128 | |
vpcola | 0:a1734fe1ec4b | 129 | |
vpcola | 0:a1734fe1ec4b | 130 | /** |
vpcola | 0:a1734fe1ec4b | 131 | *@} |
vpcola | 0:a1734fe1ec4b | 132 | */ |
vpcola | 0:a1734fe1ec4b | 133 | |
vpcola | 0:a1734fe1ec4b | 134 | |
vpcola | 0:a1734fe1ec4b | 135 | /** |
vpcola | 0:a1734fe1ec4b | 136 | * @defgroup DirectRf_Exported_Functions Direct RF Exported Functions |
vpcola | 0:a1734fe1ec4b | 137 | * @{ |
vpcola | 0:a1734fe1ec4b | 138 | */ |
vpcola | 0:a1734fe1ec4b | 139 | |
vpcola | 0:a1734fe1ec4b | 140 | void SpiritDirectRfSetRxMode(DirectRx xDirectRx); |
vpcola | 0:a1734fe1ec4b | 141 | DirectRx SpiritDirectRfGetRxMode(void); |
vpcola | 0:a1734fe1ec4b | 142 | void SpiritDirectRfSetTxMode(DirectTx xDirectTx); |
vpcola | 0:a1734fe1ec4b | 143 | DirectTx SpiritDirectRfGetTxMode(void); |
vpcola | 0:a1734fe1ec4b | 144 | |
vpcola | 0:a1734fe1ec4b | 145 | /** |
vpcola | 0:a1734fe1ec4b | 146 | *@} |
vpcola | 0:a1734fe1ec4b | 147 | */ |
vpcola | 0:a1734fe1ec4b | 148 | |
vpcola | 0:a1734fe1ec4b | 149 | /** |
vpcola | 0:a1734fe1ec4b | 150 | *@} |
vpcola | 0:a1734fe1ec4b | 151 | */ |
vpcola | 0:a1734fe1ec4b | 152 | |
vpcola | 0:a1734fe1ec4b | 153 | |
vpcola | 0:a1734fe1ec4b | 154 | /** |
vpcola | 0:a1734fe1ec4b | 155 | *@} |
vpcola | 0:a1734fe1ec4b | 156 | */ |
vpcola | 0:a1734fe1ec4b | 157 | |
vpcola | 0:a1734fe1ec4b | 158 | |
vpcola | 0:a1734fe1ec4b | 159 | #ifdef __cplusplus |
vpcola | 0:a1734fe1ec4b | 160 | } |
vpcola | 0:a1734fe1ec4b | 161 | #endif |
vpcola | 0:a1734fe1ec4b | 162 | |
vpcola | 0:a1734fe1ec4b | 163 | #endif |
vpcola | 0:a1734fe1ec4b | 164 | |
vpcola | 0:a1734fe1ec4b | 165 | /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/ |