mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Wed Feb 26 09:45:12 2014 +0000
Revision:
106:ced8cbb51063
Parent:
76:aeb1df146756
Synchronized with git revision 4222735eff5868389433f0e9271976b39c8115cd

Full URL: https://github.com/mbedmicro/mbed/commit/4222735eff5868389433f0e9271976b39c8115cd/

[NUCLEO_xxx] Update STM32CubeF4 driver V1.0.0 + update license

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 76:aeb1df146756 1 /**
mbed_official 76:aeb1df146756 2 ******************************************************************************
mbed_official 76:aeb1df146756 3 * @file stm32f0xx_crc.c
mbed_official 76:aeb1df146756 4 * @author MCD Application Team
mbed_official 76:aeb1df146756 5 * @version V1.3.0
mbed_official 76:aeb1df146756 6 * @date 16-January-2014
mbed_official 76:aeb1df146756 7 * @brief This file provides firmware functions to manage the following
mbed_official 76:aeb1df146756 8 * functionalities of CRC computation unit peripheral:
mbed_official 76:aeb1df146756 9 * + Configuration of the CRC computation unit
mbed_official 76:aeb1df146756 10 * + CRC computation of one/many 32-bit data
mbed_official 76:aeb1df146756 11 * + CRC Independent register (IDR) access
mbed_official 76:aeb1df146756 12 *
mbed_official 76:aeb1df146756 13 * @verbatim
mbed_official 76:aeb1df146756 14 ===============================================================================
mbed_official 76:aeb1df146756 15 ##### How to use this driver #####
mbed_official 76:aeb1df146756 16 ===============================================================================
mbed_official 76:aeb1df146756 17 [..]
mbed_official 76:aeb1df146756 18
mbed_official 76:aeb1df146756 19 (+) Enable CRC AHB clock using RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE)
mbed_official 76:aeb1df146756 20 function
mbed_official 76:aeb1df146756 21 (+) If required, select the reverse operation on input data
mbed_official 76:aeb1df146756 22 using CRC_ReverseInputDataSelect()
mbed_official 76:aeb1df146756 23 (+) If required, enable the reverse operation on output data
mbed_official 76:aeb1df146756 24 using CRC_ReverseOutputDataCmd(Enable)
mbed_official 76:aeb1df146756 25 (+) use CRC_CalcCRC() function to compute the CRC of a 32-bit data
mbed_official 76:aeb1df146756 26 or use CRC_CalcBlockCRC() function to compute the CRC if a 32-bit
mbed_official 76:aeb1df146756 27 data buffer
mbed_official 76:aeb1df146756 28 (@) To compute the CRC of a new data use CRC_ResetDR() to reset
mbed_official 76:aeb1df146756 29 the CRC computation unit before starting the computation
mbed_official 76:aeb1df146756 30 otherwise you can get wrong CRC values.
mbed_official 76:aeb1df146756 31
mbed_official 76:aeb1df146756 32 @endverbatim
mbed_official 76:aeb1df146756 33 *
mbed_official 76:aeb1df146756 34 ******************************************************************************
mbed_official 76:aeb1df146756 35 * @attention
mbed_official 76:aeb1df146756 36 *
mbed_official 106:ced8cbb51063 37 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 76:aeb1df146756 38 *
mbed_official 106:ced8cbb51063 39 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 106:ced8cbb51063 40 * are permitted provided that the following conditions are met:
mbed_official 106:ced8cbb51063 41 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 106:ced8cbb51063 42 * this list of conditions and the following disclaimer.
mbed_official 106:ced8cbb51063 43 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 106:ced8cbb51063 44 * this list of conditions and the following disclaimer in the documentation
mbed_official 106:ced8cbb51063 45 * and/or other materials provided with the distribution.
mbed_official 106:ced8cbb51063 46 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 106:ced8cbb51063 47 * may be used to endorse or promote products derived from this software
mbed_official 106:ced8cbb51063 48 * without specific prior written permission.
mbed_official 76:aeb1df146756 49 *
mbed_official 106:ced8cbb51063 50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 106:ced8cbb51063 51 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 106:ced8cbb51063 52 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 106:ced8cbb51063 53 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 106:ced8cbb51063 54 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 106:ced8cbb51063 55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 106:ced8cbb51063 56 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 106:ced8cbb51063 57 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 106:ced8cbb51063 58 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 106:ced8cbb51063 59 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 76:aeb1df146756 60 *
mbed_official 76:aeb1df146756 61 ******************************************************************************
mbed_official 76:aeb1df146756 62 */
mbed_official 76:aeb1df146756 63
mbed_official 76:aeb1df146756 64 /* Includes ------------------------------------------------------------------*/
mbed_official 76:aeb1df146756 65 #include "stm32f0xx_crc.h"
mbed_official 76:aeb1df146756 66
mbed_official 76:aeb1df146756 67 /** @addtogroup STM32F0xx_StdPeriph_Driver
mbed_official 76:aeb1df146756 68 * @{
mbed_official 76:aeb1df146756 69 */
mbed_official 76:aeb1df146756 70
mbed_official 76:aeb1df146756 71 /** @defgroup CRC
mbed_official 76:aeb1df146756 72 * @brief CRC driver modules
mbed_official 76:aeb1df146756 73 * @{
mbed_official 76:aeb1df146756 74 */
mbed_official 76:aeb1df146756 75
mbed_official 76:aeb1df146756 76 /* Private typedef -----------------------------------------------------------*/
mbed_official 76:aeb1df146756 77 /* Private define ------------------------------------------------------------*/
mbed_official 76:aeb1df146756 78 /* Private macro -------------------------------------------------------------*/
mbed_official 76:aeb1df146756 79 /* Private variables ---------------------------------------------------------*/
mbed_official 76:aeb1df146756 80 /* Private function prototypes -----------------------------------------------*/
mbed_official 76:aeb1df146756 81 /* Private functions ---------------------------------------------------------*/
mbed_official 76:aeb1df146756 82
mbed_official 76:aeb1df146756 83 /** @defgroup CRC_Private_Functions
mbed_official 76:aeb1df146756 84 * @{
mbed_official 76:aeb1df146756 85 */
mbed_official 76:aeb1df146756 86
mbed_official 76:aeb1df146756 87 /** @defgroup CRC_Group1 Configuration of the CRC computation unit functions
mbed_official 76:aeb1df146756 88 * @brief Configuration of the CRC computation unit functions
mbed_official 76:aeb1df146756 89 *
mbed_official 76:aeb1df146756 90 @verbatim
mbed_official 76:aeb1df146756 91 ===============================================================================
mbed_official 76:aeb1df146756 92 ##### CRC configuration functions #####
mbed_official 76:aeb1df146756 93 ===============================================================================
mbed_official 76:aeb1df146756 94
mbed_official 76:aeb1df146756 95 @endverbatim
mbed_official 76:aeb1df146756 96 * @{
mbed_official 76:aeb1df146756 97 */
mbed_official 76:aeb1df146756 98
mbed_official 76:aeb1df146756 99 /**
mbed_official 76:aeb1df146756 100 * @brief Deinitializes CRC peripheral registers to their default reset values.
mbed_official 76:aeb1df146756 101 * @param None
mbed_official 76:aeb1df146756 102 * @retval None
mbed_official 76:aeb1df146756 103 */
mbed_official 76:aeb1df146756 104 void CRC_DeInit(void)
mbed_official 76:aeb1df146756 105 {
mbed_official 76:aeb1df146756 106 /* Set DR register to reset value */
mbed_official 76:aeb1df146756 107 CRC->DR = 0xFFFFFFFF;
mbed_official 76:aeb1df146756 108
mbed_official 76:aeb1df146756 109 /* Set the POL register to the reset value: 0x04C11DB7 */
mbed_official 76:aeb1df146756 110 CRC->POL = 0x04C11DB7;
mbed_official 76:aeb1df146756 111
mbed_official 76:aeb1df146756 112 /* Reset IDR register */
mbed_official 76:aeb1df146756 113 CRC->IDR = 0x00;
mbed_official 76:aeb1df146756 114
mbed_official 76:aeb1df146756 115 /* Set INIT register to reset value */
mbed_official 76:aeb1df146756 116 CRC->INIT = 0xFFFFFFFF;
mbed_official 76:aeb1df146756 117
mbed_official 76:aeb1df146756 118 /* Reset the CRC calculation unit */
mbed_official 76:aeb1df146756 119 CRC->CR = CRC_CR_RESET;
mbed_official 76:aeb1df146756 120 }
mbed_official 76:aeb1df146756 121
mbed_official 76:aeb1df146756 122 /**
mbed_official 76:aeb1df146756 123 * @brief Resets the CRC calculation unit and sets INIT register content in DR register.
mbed_official 76:aeb1df146756 124 * @param None
mbed_official 76:aeb1df146756 125 * @retval None
mbed_official 76:aeb1df146756 126 */
mbed_official 76:aeb1df146756 127 void CRC_ResetDR(void)
mbed_official 76:aeb1df146756 128 {
mbed_official 76:aeb1df146756 129 /* Reset CRC generator */
mbed_official 76:aeb1df146756 130 CRC->CR |= CRC_CR_RESET;
mbed_official 76:aeb1df146756 131 }
mbed_official 76:aeb1df146756 132
mbed_official 76:aeb1df146756 133 /**
mbed_official 76:aeb1df146756 134 * @brief Selects the polynomial size. This function is only applicable for
mbed_official 76:aeb1df146756 135 * STM32F072 devices.
mbed_official 76:aeb1df146756 136 * @param CRC_PolSize: Specifies the polynomial size.
mbed_official 76:aeb1df146756 137 * This parameter can be:
mbed_official 76:aeb1df146756 138 * @arg CRC_PolSize_7: 7-bit polynomial for CRC calculation
mbed_official 76:aeb1df146756 139 * @arg CRC_PolSize_8: 8-bit polynomial for CRC calculation
mbed_official 76:aeb1df146756 140 * @arg CRC_PolSize_16: 16-bit polynomial for CRC calculation
mbed_official 76:aeb1df146756 141 * @arg CRC_PolSize_32: 32-bit polynomial for CRC calculation
mbed_official 76:aeb1df146756 142 * @retval None
mbed_official 76:aeb1df146756 143 */
mbed_official 76:aeb1df146756 144 void CRC_PolynomialSizeSelect(uint32_t CRC_PolSize)
mbed_official 76:aeb1df146756 145 {
mbed_official 76:aeb1df146756 146 uint32_t tmpcr = 0;
mbed_official 76:aeb1df146756 147
mbed_official 76:aeb1df146756 148 /* Check the parameter */
mbed_official 76:aeb1df146756 149 assert_param(IS_CRC_POL_SIZE(CRC_PolSize));
mbed_official 76:aeb1df146756 150
mbed_official 76:aeb1df146756 151 /* Get CR register value */
mbed_official 76:aeb1df146756 152 tmpcr = CRC->CR;
mbed_official 76:aeb1df146756 153
mbed_official 76:aeb1df146756 154 /* Reset POL_SIZE bits */
mbed_official 76:aeb1df146756 155 tmpcr &= (uint32_t)~((uint32_t)CRC_CR_POLSIZE);
mbed_official 76:aeb1df146756 156 /* Set the polynomial size */
mbed_official 76:aeb1df146756 157 tmpcr |= (uint32_t)CRC_PolSize;
mbed_official 76:aeb1df146756 158
mbed_official 76:aeb1df146756 159 /* Write to CR register */
mbed_official 76:aeb1df146756 160 CRC->CR = (uint32_t)tmpcr;
mbed_official 76:aeb1df146756 161 }
mbed_official 76:aeb1df146756 162
mbed_official 76:aeb1df146756 163 /**
mbed_official 76:aeb1df146756 164 * @brief Selects the reverse operation to be performed on input data.
mbed_official 76:aeb1df146756 165 * @param CRC_ReverseInputData: Specifies the reverse operation on input data.
mbed_official 76:aeb1df146756 166 * This parameter can be:
mbed_official 76:aeb1df146756 167 * @arg CRC_ReverseInputData_No: No reverse operation is performed
mbed_official 76:aeb1df146756 168 * @arg CRC_ReverseInputData_8bits: reverse operation performed on 8 bits
mbed_official 76:aeb1df146756 169 * @arg CRC_ReverseInputData_16bits: reverse operation performed on 16 bits
mbed_official 76:aeb1df146756 170 * @arg CRC_ReverseInputData_32bits: reverse operation performed on 32 bits
mbed_official 76:aeb1df146756 171 * @retval None
mbed_official 76:aeb1df146756 172 */
mbed_official 76:aeb1df146756 173 void CRC_ReverseInputDataSelect(uint32_t CRC_ReverseInputData)
mbed_official 76:aeb1df146756 174 {
mbed_official 76:aeb1df146756 175 uint32_t tmpcr = 0;
mbed_official 76:aeb1df146756 176
mbed_official 76:aeb1df146756 177 /* Check the parameter */
mbed_official 76:aeb1df146756 178 assert_param(IS_CRC_REVERSE_INPUT_DATA(CRC_ReverseInputData));
mbed_official 76:aeb1df146756 179
mbed_official 76:aeb1df146756 180 /* Get CR register value */
mbed_official 76:aeb1df146756 181 tmpcr = CRC->CR;
mbed_official 76:aeb1df146756 182
mbed_official 76:aeb1df146756 183 /* Reset REV_IN bits */
mbed_official 76:aeb1df146756 184 tmpcr &= (uint32_t)~((uint32_t)CRC_CR_REV_IN);
mbed_official 76:aeb1df146756 185 /* Set the reverse operation */
mbed_official 76:aeb1df146756 186 tmpcr |= (uint32_t)CRC_ReverseInputData;
mbed_official 76:aeb1df146756 187
mbed_official 76:aeb1df146756 188 /* Write to CR register */
mbed_official 76:aeb1df146756 189 CRC->CR = (uint32_t)tmpcr;
mbed_official 76:aeb1df146756 190 }
mbed_official 76:aeb1df146756 191
mbed_official 76:aeb1df146756 192 /**
mbed_official 76:aeb1df146756 193 * @brief Enables or disable the reverse operation on output data.
mbed_official 76:aeb1df146756 194 * The reverse operation on output data is performed on 32-bit.
mbed_official 76:aeb1df146756 195 * @param NewState: new state of the reverse operation on output data.
mbed_official 76:aeb1df146756 196 * This parameter can be: ENABLE or DISABLE.
mbed_official 76:aeb1df146756 197 * @retval None
mbed_official 76:aeb1df146756 198 */
mbed_official 76:aeb1df146756 199 void CRC_ReverseOutputDataCmd(FunctionalState NewState)
mbed_official 76:aeb1df146756 200 {
mbed_official 76:aeb1df146756 201 /* Check the parameters */
mbed_official 76:aeb1df146756 202 assert_param(IS_FUNCTIONAL_STATE(NewState));
mbed_official 76:aeb1df146756 203
mbed_official 76:aeb1df146756 204 if (NewState != DISABLE)
mbed_official 76:aeb1df146756 205 {
mbed_official 76:aeb1df146756 206 /* Enable reverse operation on output data */
mbed_official 76:aeb1df146756 207 CRC->CR |= CRC_CR_REV_OUT;
mbed_official 76:aeb1df146756 208 }
mbed_official 76:aeb1df146756 209 else
mbed_official 76:aeb1df146756 210 {
mbed_official 76:aeb1df146756 211 /* Disable reverse operation on output data */
mbed_official 76:aeb1df146756 212 CRC->CR &= (uint32_t)~((uint32_t)CRC_CR_REV_OUT);
mbed_official 76:aeb1df146756 213 }
mbed_official 76:aeb1df146756 214 }
mbed_official 76:aeb1df146756 215
mbed_official 76:aeb1df146756 216 /**
mbed_official 76:aeb1df146756 217 * @brief Initializes the INIT register.
mbed_official 76:aeb1df146756 218 * @note After resetting CRC calculation unit, CRC_InitValue is stored in DR register
mbed_official 76:aeb1df146756 219 * @param CRC_InitValue: Programmable initial CRC value
mbed_official 76:aeb1df146756 220 * @retval None
mbed_official 76:aeb1df146756 221 */
mbed_official 76:aeb1df146756 222 void CRC_SetInitRegister(uint32_t CRC_InitValue)
mbed_official 76:aeb1df146756 223 {
mbed_official 76:aeb1df146756 224 CRC->INIT = CRC_InitValue;
mbed_official 76:aeb1df146756 225 }
mbed_official 76:aeb1df146756 226
mbed_official 76:aeb1df146756 227 /**
mbed_official 76:aeb1df146756 228 * @brief Initializes the polynomail coefficients. This function is only
mbed_official 76:aeb1df146756 229 * applicable for STM32F072 devices.
mbed_official 76:aeb1df146756 230 * @param CRC_Pol: Polynomial to be used for CRC calculation.
mbed_official 76:aeb1df146756 231 * @retval None
mbed_official 76:aeb1df146756 232 */
mbed_official 76:aeb1df146756 233 void CRC_SetPolynomial(uint32_t CRC_Pol)
mbed_official 76:aeb1df146756 234 {
mbed_official 76:aeb1df146756 235 CRC->POL = CRC_Pol;
mbed_official 76:aeb1df146756 236 }
mbed_official 76:aeb1df146756 237
mbed_official 76:aeb1df146756 238 /**
mbed_official 76:aeb1df146756 239 * @}
mbed_official 76:aeb1df146756 240 */
mbed_official 76:aeb1df146756 241
mbed_official 76:aeb1df146756 242 /** @defgroup CRC_Group2 CRC computation of one/many 32-bit data functions
mbed_official 76:aeb1df146756 243 * @brief CRC computation of one/many 32-bit data functions
mbed_official 76:aeb1df146756 244 *
mbed_official 76:aeb1df146756 245 @verbatim
mbed_official 76:aeb1df146756 246 ===============================================================================
mbed_official 76:aeb1df146756 247 ##### CRC computation functions #####
mbed_official 76:aeb1df146756 248 ===============================================================================
mbed_official 76:aeb1df146756 249
mbed_official 76:aeb1df146756 250 @endverbatim
mbed_official 76:aeb1df146756 251 * @{
mbed_official 76:aeb1df146756 252 */
mbed_official 76:aeb1df146756 253
mbed_official 76:aeb1df146756 254 /**
mbed_official 76:aeb1df146756 255 * @brief Computes the 32-bit CRC of a given data word(32-bit).
mbed_official 76:aeb1df146756 256 * @param CRC_Data: data word(32-bit) to compute its CRC
mbed_official 76:aeb1df146756 257 * @retval 32-bit CRC
mbed_official 76:aeb1df146756 258 */
mbed_official 76:aeb1df146756 259 uint32_t CRC_CalcCRC(uint32_t CRC_Data)
mbed_official 76:aeb1df146756 260 {
mbed_official 76:aeb1df146756 261 CRC->DR = CRC_Data;
mbed_official 76:aeb1df146756 262
mbed_official 76:aeb1df146756 263 return (CRC->DR);
mbed_official 76:aeb1df146756 264 }
mbed_official 76:aeb1df146756 265
mbed_official 76:aeb1df146756 266 /**
mbed_official 76:aeb1df146756 267 * @brief Computes the 16-bit CRC of a given 16-bit data. This function is only
mbed_official 76:aeb1df146756 268 * applicable for STM32F072 devices.
mbed_official 76:aeb1df146756 269 * @param CRC_Data: data half-word(16-bit) to compute its CRC
mbed_official 76:aeb1df146756 270 * @retval 16-bit CRC
mbed_official 76:aeb1df146756 271 */
mbed_official 76:aeb1df146756 272 uint32_t CRC_CalcCRC16bits(uint16_t CRC_Data)
mbed_official 76:aeb1df146756 273 {
mbed_official 76:aeb1df146756 274 *(uint16_t*)(CRC_BASE) = (uint16_t) CRC_Data;
mbed_official 76:aeb1df146756 275
mbed_official 76:aeb1df146756 276 return (CRC->DR);
mbed_official 76:aeb1df146756 277 }
mbed_official 76:aeb1df146756 278
mbed_official 76:aeb1df146756 279 /**
mbed_official 76:aeb1df146756 280 * @brief Computes the 8-bit CRC of a given 8-bit data. This function is only
mbed_official 76:aeb1df146756 281 * applicable for STM32F072 devices.
mbed_official 76:aeb1df146756 282 * @param CRC_Data: 8-bit data to compute its CRC
mbed_official 76:aeb1df146756 283 * @retval 8-bit CRC
mbed_official 76:aeb1df146756 284 */
mbed_official 76:aeb1df146756 285 uint32_t CRC_CalcCRC8bits(uint8_t CRC_Data)
mbed_official 76:aeb1df146756 286 {
mbed_official 76:aeb1df146756 287 *(uint8_t*)(CRC_BASE) = (uint8_t) CRC_Data;
mbed_official 76:aeb1df146756 288
mbed_official 76:aeb1df146756 289 return (CRC->DR);
mbed_official 76:aeb1df146756 290 }
mbed_official 76:aeb1df146756 291
mbed_official 76:aeb1df146756 292 /**
mbed_official 76:aeb1df146756 293 * @brief Computes the 32-bit CRC of a given buffer of data word(32-bit).
mbed_official 76:aeb1df146756 294 * @param pBuffer: pointer to the buffer containing the data to be computed
mbed_official 76:aeb1df146756 295 * @param BufferLength: length of the buffer to be computed
mbed_official 76:aeb1df146756 296 * @retval 32-bit CRC
mbed_official 76:aeb1df146756 297 */
mbed_official 76:aeb1df146756 298 uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
mbed_official 76:aeb1df146756 299 {
mbed_official 76:aeb1df146756 300 uint32_t index = 0;
mbed_official 76:aeb1df146756 301
mbed_official 76:aeb1df146756 302 for(index = 0; index < BufferLength; index++)
mbed_official 76:aeb1df146756 303 {
mbed_official 76:aeb1df146756 304 CRC->DR = pBuffer[index];
mbed_official 76:aeb1df146756 305 }
mbed_official 76:aeb1df146756 306 return (CRC->DR);
mbed_official 76:aeb1df146756 307 }
mbed_official 76:aeb1df146756 308
mbed_official 76:aeb1df146756 309 /**
mbed_official 76:aeb1df146756 310 * @brief Returns the current CRC value.
mbed_official 76:aeb1df146756 311 * @param None
mbed_official 76:aeb1df146756 312 * @retval 32-bit CRC
mbed_official 76:aeb1df146756 313 */
mbed_official 76:aeb1df146756 314 uint32_t CRC_GetCRC(void)
mbed_official 76:aeb1df146756 315 {
mbed_official 76:aeb1df146756 316 return (CRC->DR);
mbed_official 76:aeb1df146756 317 }
mbed_official 76:aeb1df146756 318
mbed_official 76:aeb1df146756 319 /**
mbed_official 76:aeb1df146756 320 * @}
mbed_official 76:aeb1df146756 321 */
mbed_official 76:aeb1df146756 322
mbed_official 76:aeb1df146756 323 /** @defgroup CRC_Group3 CRC Independent Register (IDR) access functions
mbed_official 76:aeb1df146756 324 * @brief CRC Independent Register (IDR) access (write/read) functions
mbed_official 76:aeb1df146756 325 *
mbed_official 76:aeb1df146756 326 @verbatim
mbed_official 76:aeb1df146756 327 ===============================================================================
mbed_official 76:aeb1df146756 328 ##### CRC Independent Register (IDR) access functions #####
mbed_official 76:aeb1df146756 329 ===============================================================================
mbed_official 76:aeb1df146756 330
mbed_official 76:aeb1df146756 331 @endverbatim
mbed_official 76:aeb1df146756 332 * @{
mbed_official 76:aeb1df146756 333 */
mbed_official 76:aeb1df146756 334
mbed_official 76:aeb1df146756 335 /**
mbed_official 76:aeb1df146756 336 * @brief Stores an 8-bit data in the Independent Data(ID) register.
mbed_official 76:aeb1df146756 337 * @param CRC_IDValue: 8-bit value to be stored in the ID register
mbed_official 76:aeb1df146756 338 * @retval None
mbed_official 76:aeb1df146756 339 */
mbed_official 76:aeb1df146756 340 void CRC_SetIDRegister(uint8_t CRC_IDValue)
mbed_official 76:aeb1df146756 341 {
mbed_official 76:aeb1df146756 342 CRC->IDR = CRC_IDValue;
mbed_official 76:aeb1df146756 343 }
mbed_official 76:aeb1df146756 344
mbed_official 76:aeb1df146756 345 /**
mbed_official 76:aeb1df146756 346 * @brief Returns the 8-bit data stored in the Independent Data(ID) register
mbed_official 76:aeb1df146756 347 * @param None
mbed_official 76:aeb1df146756 348 * @retval 8-bit value of the ID register
mbed_official 76:aeb1df146756 349 */
mbed_official 76:aeb1df146756 350 uint8_t CRC_GetIDRegister(void)
mbed_official 76:aeb1df146756 351 {
mbed_official 76:aeb1df146756 352 return (CRC->IDR);
mbed_official 76:aeb1df146756 353 }
mbed_official 76:aeb1df146756 354
mbed_official 76:aeb1df146756 355 /**
mbed_official 76:aeb1df146756 356 * @}
mbed_official 76:aeb1df146756 357 */
mbed_official 76:aeb1df146756 358
mbed_official 76:aeb1df146756 359 /**
mbed_official 76:aeb1df146756 360 * @}
mbed_official 76:aeb1df146756 361 */
mbed_official 76:aeb1df146756 362
mbed_official 76:aeb1df146756 363 /**
mbed_official 76:aeb1df146756 364 * @}
mbed_official 76:aeb1df146756 365 */
mbed_official 76:aeb1df146756 366
mbed_official 76:aeb1df146756 367 /**
mbed_official 76:aeb1df146756 368 * @}
mbed_official 76:aeb1df146756 369 */
mbed_official 76:aeb1df146756 370
mbed_official 76:aeb1df146756 371 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/