Vergil Cola
/
MQTTGateway2
Fork of my original MQTTGateway
easy-connect/stm-spirit1-rf-driver/source/libs/spirit1/SPIRIT1_Library/Inc/SPIRIT_Commands.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_Commands.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 Management of SPIRIT Commands. |
vpcola | 0:a1734fe1ec4b | 8 | * |
vpcola | 0:a1734fe1ec4b | 9 | * @details |
vpcola | 0:a1734fe1ec4b | 10 | * |
vpcola | 0:a1734fe1ec4b | 11 | * In this module can be found all the API used to strobe commands to |
vpcola | 0:a1734fe1ec4b | 12 | * Spirit. |
vpcola | 0:a1734fe1ec4b | 13 | * Every command strobe is an SPI transaction with a specific command code. |
vpcola | 0:a1734fe1ec4b | 14 | * |
vpcola | 0:a1734fe1ec4b | 15 | * <b>Example:</b> |
vpcola | 0:a1734fe1ec4b | 16 | * @code |
vpcola | 0:a1734fe1ec4b | 17 | * ... |
vpcola | 0:a1734fe1ec4b | 18 | * |
vpcola | 0:a1734fe1ec4b | 19 | * SpiritCmdStrobeRx(); |
vpcola | 0:a1734fe1ec4b | 20 | * |
vpcola | 0:a1734fe1ec4b | 21 | * ... |
vpcola | 0:a1734fe1ec4b | 22 | * @endcode |
vpcola | 0:a1734fe1ec4b | 23 | * |
vpcola | 0:a1734fe1ec4b | 24 | * |
vpcola | 0:a1734fe1ec4b | 25 | * @attention |
vpcola | 0:a1734fe1ec4b | 26 | * |
vpcola | 0:a1734fe1ec4b | 27 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
vpcola | 0:a1734fe1ec4b | 28 | * |
vpcola | 0:a1734fe1ec4b | 29 | * Redistribution and use in source and binary forms, with or without modification, |
vpcola | 0:a1734fe1ec4b | 30 | * are permitted provided that the following conditions are met: |
vpcola | 0:a1734fe1ec4b | 31 | * 1. Redistributions of source code must retain the above copyright notice, |
vpcola | 0:a1734fe1ec4b | 32 | * this list of conditions and the following disclaimer. |
vpcola | 0:a1734fe1ec4b | 33 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
vpcola | 0:a1734fe1ec4b | 34 | * this list of conditions and the following disclaimer in the documentation |
vpcola | 0:a1734fe1ec4b | 35 | * and/or other materials provided with the distribution. |
vpcola | 0:a1734fe1ec4b | 36 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
vpcola | 0:a1734fe1ec4b | 37 | * may be used to endorse or promote products derived from this software |
vpcola | 0:a1734fe1ec4b | 38 | * without specific prior written permission. |
vpcola | 0:a1734fe1ec4b | 39 | * |
vpcola | 0:a1734fe1ec4b | 40 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
vpcola | 0:a1734fe1ec4b | 41 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
vpcola | 0:a1734fe1ec4b | 42 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
vpcola | 0:a1734fe1ec4b | 43 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
vpcola | 0:a1734fe1ec4b | 44 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
vpcola | 0:a1734fe1ec4b | 45 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
vpcola | 0:a1734fe1ec4b | 46 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
vpcola | 0:a1734fe1ec4b | 47 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
vpcola | 0:a1734fe1ec4b | 48 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
vpcola | 0:a1734fe1ec4b | 49 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
vpcola | 0:a1734fe1ec4b | 50 | * |
vpcola | 0:a1734fe1ec4b | 51 | ****************************************************************************** |
vpcola | 0:a1734fe1ec4b | 52 | */ |
vpcola | 0:a1734fe1ec4b | 53 | |
vpcola | 0:a1734fe1ec4b | 54 | /* Define to prevent recursive inclusion -------------------------------------*/ |
vpcola | 0:a1734fe1ec4b | 55 | #ifndef __SPIRIT_COMMANDS_H |
vpcola | 0:a1734fe1ec4b | 56 | #define __SPIRIT_COMMANDS_H |
vpcola | 0:a1734fe1ec4b | 57 | |
vpcola | 0:a1734fe1ec4b | 58 | |
vpcola | 0:a1734fe1ec4b | 59 | /* Includes ------------------------------------------------------------------*/ |
vpcola | 0:a1734fe1ec4b | 60 | |
vpcola | 0:a1734fe1ec4b | 61 | #include "SPIRIT_Regs.h" |
vpcola | 0:a1734fe1ec4b | 62 | #include "SPIRIT_Types.h" |
vpcola | 0:a1734fe1ec4b | 63 | |
vpcola | 0:a1734fe1ec4b | 64 | |
vpcola | 0:a1734fe1ec4b | 65 | #ifdef __cplusplus |
vpcola | 0:a1734fe1ec4b | 66 | extern "C" { |
vpcola | 0:a1734fe1ec4b | 67 | #endif |
vpcola | 0:a1734fe1ec4b | 68 | |
vpcola | 0:a1734fe1ec4b | 69 | |
vpcola | 0:a1734fe1ec4b | 70 | /** |
vpcola | 0:a1734fe1ec4b | 71 | * @addtogroup SPIRIT_Libraries |
vpcola | 0:a1734fe1ec4b | 72 | * @{ |
vpcola | 0:a1734fe1ec4b | 73 | */ |
vpcola | 0:a1734fe1ec4b | 74 | |
vpcola | 0:a1734fe1ec4b | 75 | |
vpcola | 0:a1734fe1ec4b | 76 | /** |
vpcola | 0:a1734fe1ec4b | 77 | * @defgroup SPIRIT_Commands Commands |
vpcola | 0:a1734fe1ec4b | 78 | * @brief Management of SPIRIT Commands. |
vpcola | 0:a1734fe1ec4b | 79 | * @details See the file <i>@ref SPIRIT_Commands.h</i> for more details. |
vpcola | 0:a1734fe1ec4b | 80 | * @{ |
vpcola | 0:a1734fe1ec4b | 81 | */ |
vpcola | 0:a1734fe1ec4b | 82 | |
vpcola | 0:a1734fe1ec4b | 83 | /** |
vpcola | 0:a1734fe1ec4b | 84 | * @defgroup Commands_Exported_Types Commands Exported Types |
vpcola | 0:a1734fe1ec4b | 85 | * @{ |
vpcola | 0:a1734fe1ec4b | 86 | */ |
vpcola | 0:a1734fe1ec4b | 87 | |
vpcola | 0:a1734fe1ec4b | 88 | /** |
vpcola | 0:a1734fe1ec4b | 89 | * @brief SPIRIT Commands codes enumeration |
vpcola | 0:a1734fe1ec4b | 90 | */ |
vpcola | 0:a1734fe1ec4b | 91 | typedef enum |
vpcola | 0:a1734fe1ec4b | 92 | { |
vpcola | 0:a1734fe1ec4b | 93 | CMD_TX = COMMAND_TX, /*!< Start to transmit; valid only from READY */ |
vpcola | 0:a1734fe1ec4b | 94 | CMD_RX = COMMAND_RX, /*!< Start to receive; valid only from READY */ |
vpcola | 0:a1734fe1ec4b | 95 | CMD_READY = COMMAND_READY, /*!< Go to READY; valid only from STANDBY or SLEEP or LOCK */ |
vpcola | 0:a1734fe1ec4b | 96 | CMD_STANDBY = COMMAND_STANDBY, /*!< Go to STANDBY; valid only from READY */ |
vpcola | 0:a1734fe1ec4b | 97 | CMD_SLEEP = COMMAND_SLEEP, /*!< Go to SLEEP; valid only from READY */ |
vpcola | 0:a1734fe1ec4b | 98 | CMD_LOCKRX = COMMAND_LOCKRX, /*!< Go to LOCK state by using the RX configuration of the synth; valid only from READY */ |
vpcola | 0:a1734fe1ec4b | 99 | CMD_LOCKTX = COMMAND_LOCKTX, /*!< Go to LOCK state by using the TX configuration of the synth; valid only from READY */ |
vpcola | 0:a1734fe1ec4b | 100 | CMD_SABORT = COMMAND_SABORT, /*!< Force exit form TX or RX states and go to READY state; valid only from TX or RX */ |
vpcola | 0:a1734fe1ec4b | 101 | CMD_LDC_RELOAD = COMMAND_LDC_RELOAD, /*!< LDC Mode: Reload the LDC timer with the value stored in the LDC_PRESCALER / COUNTER registers; valid from all states */ |
vpcola | 0:a1734fe1ec4b | 102 | CMD_SEQUENCE_UPDATE = COMMAND_SEQUENCE_UPDATE, /*!< Autoretransmission: Reload the Packet sequence counter with the value stored in the PROTOCOL[2] register valid from all states */ |
vpcola | 0:a1734fe1ec4b | 103 | CMD_AES_ENC = COMMAND_AES_ENC, /*!< Commands: Start the encryption routine; valid from all states; valid from all states */ |
vpcola | 0:a1734fe1ec4b | 104 | CMD_AES_KEY = COMMAND_AES_KEY, /*!< Commands: Start the procedure to compute the key for the decryption; valid from all states */ |
vpcola | 0:a1734fe1ec4b | 105 | CMD_AES_DEC = COMMAND_AES_DEC, /*!< Commands: Start the decryption routine using the current key; valid from all states */ |
vpcola | 0:a1734fe1ec4b | 106 | CMD_AES_KEY_DEC = COMMAND_AES_KEY_DEC, /*!< Commands: Compute the key and start the decryption; valid from all states */ |
vpcola | 0:a1734fe1ec4b | 107 | CMD_SRES = COMMAND_SRES, /*!< Reset of all digital part, except SPI registers */ |
vpcola | 0:a1734fe1ec4b | 108 | CMD_FLUSHRXFIFO = COMMAND_FLUSHRXFIFO, /*!< Clean the RX FIFO; valid from all states */ |
vpcola | 0:a1734fe1ec4b | 109 | CMD_FLUSHTXFIFO = COMMAND_FLUSHTXFIFO, /*!< Clean the TX FIFO; valid from all states */ |
vpcola | 0:a1734fe1ec4b | 110 | } SpiritCmd; |
vpcola | 0:a1734fe1ec4b | 111 | |
vpcola | 0:a1734fe1ec4b | 112 | #define IS_SPIRIT_CMD(CMD) (CMD == CMD_TX || \ |
vpcola | 0:a1734fe1ec4b | 113 | CMD == CMD_RX || \ |
vpcola | 0:a1734fe1ec4b | 114 | CMD == CMD_READY || \ |
vpcola | 0:a1734fe1ec4b | 115 | CMD == CMD_STANDBY || \ |
vpcola | 0:a1734fe1ec4b | 116 | CMD == CMD_SLEEP || \ |
vpcola | 0:a1734fe1ec4b | 117 | CMD == CMD_LOCKRX || \ |
vpcola | 0:a1734fe1ec4b | 118 | CMD == CMD_LOCKTX || \ |
vpcola | 0:a1734fe1ec4b | 119 | CMD == CMD_SABORT || \ |
vpcola | 0:a1734fe1ec4b | 120 | CMD == CMD_LDC_RELOAD || \ |
vpcola | 0:a1734fe1ec4b | 121 | CMD == CMD_SEQUENCE_UPDATE || \ |
vpcola | 0:a1734fe1ec4b | 122 | CMD == CMD_AES_ENC || \ |
vpcola | 0:a1734fe1ec4b | 123 | CMD == CMD_AES_KEY || \ |
vpcola | 0:a1734fe1ec4b | 124 | CMD == CMD_AES_DEC || \ |
vpcola | 0:a1734fe1ec4b | 125 | CMD == CMD_AES_KEY_DEC || \ |
vpcola | 0:a1734fe1ec4b | 126 | CMD == CMD_SRES || \ |
vpcola | 0:a1734fe1ec4b | 127 | CMD == CMD_FLUSHRXFIFO || \ |
vpcola | 0:a1734fe1ec4b | 128 | CMD == CMD_FLUSHTXFIFO \ |
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 | /** |
vpcola | 0:a1734fe1ec4b | 137 | * @defgroup Commands_Exported_Constants Commands Exported Constants |
vpcola | 0:a1734fe1ec4b | 138 | * @{ |
vpcola | 0:a1734fe1ec4b | 139 | */ |
vpcola | 0:a1734fe1ec4b | 140 | |
vpcola | 0:a1734fe1ec4b | 141 | |
vpcola | 0:a1734fe1ec4b | 142 | /** |
vpcola | 0:a1734fe1ec4b | 143 | * @} |
vpcola | 0:a1734fe1ec4b | 144 | */ |
vpcola | 0:a1734fe1ec4b | 145 | |
vpcola | 0:a1734fe1ec4b | 146 | |
vpcola | 0:a1734fe1ec4b | 147 | /** |
vpcola | 0:a1734fe1ec4b | 148 | * @defgroup Commands_Exported_Macros Commands Exported Macros |
vpcola | 0:a1734fe1ec4b | 149 | * @{ |
vpcola | 0:a1734fe1ec4b | 150 | */ |
vpcola | 0:a1734fe1ec4b | 151 | |
vpcola | 0:a1734fe1ec4b | 152 | /** |
vpcola | 0:a1734fe1ec4b | 153 | * @brief Sends the TX command to SPIRIT. Start to transmit. |
vpcola | 0:a1734fe1ec4b | 154 | * @param None. |
vpcola | 0:a1734fe1ec4b | 155 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 156 | */ |
vpcola | 0:a1734fe1ec4b | 157 | #define SpiritCmdStrobeTx() {SpiritManagementWaCmdStrobeTx(); \ |
vpcola | 0:a1734fe1ec4b | 158 | SpiritCmdStrobeCommand(CMD_TX);} |
vpcola | 0:a1734fe1ec4b | 159 | |
vpcola | 0:a1734fe1ec4b | 160 | |
vpcola | 0:a1734fe1ec4b | 161 | /** |
vpcola | 0:a1734fe1ec4b | 162 | * @brief Sends the RX command to SPIRIT. Start to receive. |
vpcola | 0:a1734fe1ec4b | 163 | * @param None. |
vpcola | 0:a1734fe1ec4b | 164 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 165 | */ |
vpcola | 0:a1734fe1ec4b | 166 | #define SpiritCmdStrobeRx() {SpiritManagementWaCmdStrobeRx(); \ |
vpcola | 0:a1734fe1ec4b | 167 | SpiritCmdStrobeCommand(CMD_RX); \ |
vpcola | 0:a1734fe1ec4b | 168 | } |
vpcola | 0:a1734fe1ec4b | 169 | |
vpcola | 0:a1734fe1ec4b | 170 | |
vpcola | 0:a1734fe1ec4b | 171 | /** |
vpcola | 0:a1734fe1ec4b | 172 | * @brief Sends the Ready state command to SPIRIT. Go to READY. |
vpcola | 0:a1734fe1ec4b | 173 | * @param None. |
vpcola | 0:a1734fe1ec4b | 174 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 175 | */ |
vpcola | 0:a1734fe1ec4b | 176 | #define SpiritCmdStrobeReady() SpiritCmdStrobeCommand(CMD_READY) |
vpcola | 0:a1734fe1ec4b | 177 | |
vpcola | 0:a1734fe1ec4b | 178 | |
vpcola | 0:a1734fe1ec4b | 179 | |
vpcola | 0:a1734fe1ec4b | 180 | /** |
vpcola | 0:a1734fe1ec4b | 181 | * @brief Sends the Standby command to SPIRIT. Go to STANDBY. |
vpcola | 0:a1734fe1ec4b | 182 | * @param None. |
vpcola | 0:a1734fe1ec4b | 183 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 184 | */ |
vpcola | 0:a1734fe1ec4b | 185 | #define SpiritCmdStrobeStandby() SpiritCmdStrobeCommand(CMD_STANDBY) |
vpcola | 0:a1734fe1ec4b | 186 | |
vpcola | 0:a1734fe1ec4b | 187 | |
vpcola | 0:a1734fe1ec4b | 188 | |
vpcola | 0:a1734fe1ec4b | 189 | /** |
vpcola | 0:a1734fe1ec4b | 190 | * @brief Sends the Sleep command to SPIRIT. Go to SLEEP. |
vpcola | 0:a1734fe1ec4b | 191 | * @param None. |
vpcola | 0:a1734fe1ec4b | 192 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 193 | */ |
vpcola | 0:a1734fe1ec4b | 194 | #define SpiritCmdStrobeSleep() SpiritCmdStrobeCommand(CMD_SLEEP) |
vpcola | 0:a1734fe1ec4b | 195 | |
vpcola | 0:a1734fe1ec4b | 196 | |
vpcola | 0:a1734fe1ec4b | 197 | |
vpcola | 0:a1734fe1ec4b | 198 | /** |
vpcola | 0:a1734fe1ec4b | 199 | * @brief Sends the LOCK_RX command to SPIRIT. Go to the LOCK state by using the RX configuration of the synthesizer. |
vpcola | 0:a1734fe1ec4b | 200 | * @param None. |
vpcola | 0:a1734fe1ec4b | 201 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 202 | */ |
vpcola | 0:a1734fe1ec4b | 203 | #define SpiritCmdStrobeLockRx() SpiritCmdStrobeCommand(CMD_LOCKRX) |
vpcola | 0:a1734fe1ec4b | 204 | |
vpcola | 0:a1734fe1ec4b | 205 | |
vpcola | 0:a1734fe1ec4b | 206 | |
vpcola | 0:a1734fe1ec4b | 207 | /** |
vpcola | 0:a1734fe1ec4b | 208 | * @brief Sends the LOCK_TX command to SPIRIT. Go to the LOCK state by using the TX configuration of the synthesizer. |
vpcola | 0:a1734fe1ec4b | 209 | * @param None. |
vpcola | 0:a1734fe1ec4b | 210 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 211 | */ |
vpcola | 0:a1734fe1ec4b | 212 | #define SpiritCmdStrobeLockTx() SpiritCmdStrobeCommand(CMD_LOCKTX) |
vpcola | 0:a1734fe1ec4b | 213 | |
vpcola | 0:a1734fe1ec4b | 214 | |
vpcola | 0:a1734fe1ec4b | 215 | |
vpcola | 0:a1734fe1ec4b | 216 | /** |
vpcola | 0:a1734fe1ec4b | 217 | * @brief Sends the SABORT command to SPIRIT. Exit from TX or RX states and go to READY state. |
vpcola | 0:a1734fe1ec4b | 218 | * @param None. |
vpcola | 0:a1734fe1ec4b | 219 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 220 | */ |
vpcola | 0:a1734fe1ec4b | 221 | #define SpiritCmdStrobeSabort() SpiritCmdStrobeCommand(CMD_SABORT) |
vpcola | 0:a1734fe1ec4b | 222 | |
vpcola | 0:a1734fe1ec4b | 223 | |
vpcola | 0:a1734fe1ec4b | 224 | /** |
vpcola | 0:a1734fe1ec4b | 225 | * @brief Sends the LDC_RELOAD command to SPIRIT. Reload the LDC timer with the value stored in the LDC_PRESCALER / COUNTER registers. |
vpcola | 0:a1734fe1ec4b | 226 | * @param None. |
vpcola | 0:a1734fe1ec4b | 227 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 228 | */ |
vpcola | 0:a1734fe1ec4b | 229 | #define SpiritCmdStrobeLdcReload() SpiritCmdStrobeCommand(CMD_LDC_RELOAD) |
vpcola | 0:a1734fe1ec4b | 230 | |
vpcola | 0:a1734fe1ec4b | 231 | |
vpcola | 0:a1734fe1ec4b | 232 | |
vpcola | 0:a1734fe1ec4b | 233 | /** |
vpcola | 0:a1734fe1ec4b | 234 | * @brief Sends the SEQUENCE_UPDATE command to SPIRIT. Reload the Packet sequence counter with the value stored in the PROTOCOL[2] register. |
vpcola | 0:a1734fe1ec4b | 235 | * @param None. |
vpcola | 0:a1734fe1ec4b | 236 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 237 | */ |
vpcola | 0:a1734fe1ec4b | 238 | #define SpiritCmdStrobeSequenceUpdate() SpiritCmdStrobeCommand(CMD_SEQUENCE_UPDATE) |
vpcola | 0:a1734fe1ec4b | 239 | |
vpcola | 0:a1734fe1ec4b | 240 | |
vpcola | 0:a1734fe1ec4b | 241 | |
vpcola | 0:a1734fe1ec4b | 242 | /** |
vpcola | 0:a1734fe1ec4b | 243 | * @brief Sends the AES_ENC command to SPIRIT. Starts the encryption routine. |
vpcola | 0:a1734fe1ec4b | 244 | * @param None. |
vpcola | 0:a1734fe1ec4b | 245 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 246 | */ |
vpcola | 0:a1734fe1ec4b | 247 | #define SpiritCmdStrobeAesEnc() SpiritCmdStrobeCommand(CMD_AES_ENC) |
vpcola | 0:a1734fe1ec4b | 248 | |
vpcola | 0:a1734fe1ec4b | 249 | |
vpcola | 0:a1734fe1ec4b | 250 | |
vpcola | 0:a1734fe1ec4b | 251 | /** |
vpcola | 0:a1734fe1ec4b | 252 | * @brief Sends the AES_KEY command to SPIRIT. Starts the procedure to compute the key for the decryption. |
vpcola | 0:a1734fe1ec4b | 253 | * @param None. |
vpcola | 0:a1734fe1ec4b | 254 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 255 | */ |
vpcola | 0:a1734fe1ec4b | 256 | #define SpiritCmdStrobeAesKey() SpiritCmdStrobeCommand(CMD_AES_KEY) |
vpcola | 0:a1734fe1ec4b | 257 | |
vpcola | 0:a1734fe1ec4b | 258 | |
vpcola | 0:a1734fe1ec4b | 259 | |
vpcola | 0:a1734fe1ec4b | 260 | /** |
vpcola | 0:a1734fe1ec4b | 261 | * @brief Sends the AES_DEC command to SPIRIT. Starts the decryption using the current key. |
vpcola | 0:a1734fe1ec4b | 262 | * @param None. |
vpcola | 0:a1734fe1ec4b | 263 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 264 | */ |
vpcola | 0:a1734fe1ec4b | 265 | #define SpiritCmdStrobeAesDec() SpiritCmdStrobeCommand(CMD_AES_DEC) |
vpcola | 0:a1734fe1ec4b | 266 | |
vpcola | 0:a1734fe1ec4b | 267 | |
vpcola | 0:a1734fe1ec4b | 268 | |
vpcola | 0:a1734fe1ec4b | 269 | /** |
vpcola | 0:a1734fe1ec4b | 270 | * @brief Sends the KEY_DEC command to SPIRIT. Computes the key derivation and start the decryption. |
vpcola | 0:a1734fe1ec4b | 271 | * @param None. |
vpcola | 0:a1734fe1ec4b | 272 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 273 | */ |
vpcola | 0:a1734fe1ec4b | 274 | #define SpiritCmdStrobeAesKeyDec() SpiritCmdStrobeCommand(CMD_AES_KEY_DEC) |
vpcola | 0:a1734fe1ec4b | 275 | |
vpcola | 0:a1734fe1ec4b | 276 | /** |
vpcola | 0:a1734fe1ec4b | 277 | * @brief Sends the SRES command to SPIRIT. Partial reset: all digital circuit will be reset (exception for SPI only). |
vpcola | 0:a1734fe1ec4b | 278 | * @param None. |
vpcola | 0:a1734fe1ec4b | 279 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 280 | */ |
vpcola | 0:a1734fe1ec4b | 281 | #define SpiritCmdStrobeSres() SpiritCmdStrobeCommand(CMD_SRES) |
vpcola | 0:a1734fe1ec4b | 282 | |
vpcola | 0:a1734fe1ec4b | 283 | |
vpcola | 0:a1734fe1ec4b | 284 | /** |
vpcola | 0:a1734fe1ec4b | 285 | * @brief Sends the FLUSHRXFIFO command to SPIRIT. Clean the RX FIFO. |
vpcola | 0:a1734fe1ec4b | 286 | * @param None. |
vpcola | 0:a1734fe1ec4b | 287 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 288 | */ |
vpcola | 0:a1734fe1ec4b | 289 | #define SpiritCmdStrobeFlushRxFifo() SpiritCmdStrobeCommand(CMD_FLUSHRXFIFO) |
vpcola | 0:a1734fe1ec4b | 290 | |
vpcola | 0:a1734fe1ec4b | 291 | |
vpcola | 0:a1734fe1ec4b | 292 | |
vpcola | 0:a1734fe1ec4b | 293 | /** |
vpcola | 0:a1734fe1ec4b | 294 | * @brief Sends the FLUSHTXFIFO command to SPIRIT. Clean the TX FIFO. |
vpcola | 0:a1734fe1ec4b | 295 | * @param None. |
vpcola | 0:a1734fe1ec4b | 296 | * @retval None. |
vpcola | 0:a1734fe1ec4b | 297 | */ |
vpcola | 0:a1734fe1ec4b | 298 | #define SpiritCmdStrobeFlushTxFifo() SpiritCmdStrobeCommand(CMD_FLUSHTXFIFO) |
vpcola | 0:a1734fe1ec4b | 299 | |
vpcola | 0:a1734fe1ec4b | 300 | |
vpcola | 0:a1734fe1ec4b | 301 | |
vpcola | 0:a1734fe1ec4b | 302 | /** |
vpcola | 0:a1734fe1ec4b | 303 | * @} |
vpcola | 0:a1734fe1ec4b | 304 | */ |
vpcola | 0:a1734fe1ec4b | 305 | |
vpcola | 0:a1734fe1ec4b | 306 | |
vpcola | 0:a1734fe1ec4b | 307 | /** |
vpcola | 0:a1734fe1ec4b | 308 | * @defgroup Commands_Exported_Functions Commands Exported Functions |
vpcola | 0:a1734fe1ec4b | 309 | * @{ |
vpcola | 0:a1734fe1ec4b | 310 | */ |
vpcola | 0:a1734fe1ec4b | 311 | void SpiritCmdStrobeCommand(SpiritCmd xCommandCode); |
vpcola | 0:a1734fe1ec4b | 312 | |
vpcola | 0:a1734fe1ec4b | 313 | |
vpcola | 0:a1734fe1ec4b | 314 | /** |
vpcola | 0:a1734fe1ec4b | 315 | * @} |
vpcola | 0:a1734fe1ec4b | 316 | */ |
vpcola | 0:a1734fe1ec4b | 317 | |
vpcola | 0:a1734fe1ec4b | 318 | /** |
vpcola | 0:a1734fe1ec4b | 319 | * @} |
vpcola | 0:a1734fe1ec4b | 320 | */ |
vpcola | 0:a1734fe1ec4b | 321 | |
vpcola | 0:a1734fe1ec4b | 322 | |
vpcola | 0:a1734fe1ec4b | 323 | /** |
vpcola | 0:a1734fe1ec4b | 324 | * @} |
vpcola | 0:a1734fe1ec4b | 325 | */ |
vpcola | 0:a1734fe1ec4b | 326 | |
vpcola | 0:a1734fe1ec4b | 327 | |
vpcola | 0:a1734fe1ec4b | 328 | |
vpcola | 0:a1734fe1ec4b | 329 | |
vpcola | 0:a1734fe1ec4b | 330 | #ifdef __cplusplus |
vpcola | 0:a1734fe1ec4b | 331 | } |
vpcola | 0:a1734fe1ec4b | 332 | #endif |
vpcola | 0:a1734fe1ec4b | 333 | |
vpcola | 0:a1734fe1ec4b | 334 | #endif |
vpcola | 0:a1734fe1ec4b | 335 | |
vpcola | 0:a1734fe1ec4b | 336 | /******************* (C) COPYRIGHT 2015 STMicroelectronics *****END OF FILE****/ |