mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
186:707f6e361f3e
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 158:b23ee177fd68 1 /**
Kojto 158:b23ee177fd68 2 ******************************************************************************
Kojto 158:b23ee177fd68 3 * @file stm32l0xx_ll_crc.c
Kojto 158:b23ee177fd68 4 * @author MCD Application Team
Kojto 158:b23ee177fd68 5 * @brief CRC LL module driver.
Kojto 158:b23ee177fd68 6 ******************************************************************************
Kojto 158:b23ee177fd68 7 * @attention
Kojto 158:b23ee177fd68 8 *
Kojto 158:b23ee177fd68 9 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 158:b23ee177fd68 10 *
Kojto 158:b23ee177fd68 11 * Redistribution and use in source and binary forms, with or without modification,
Kojto 158:b23ee177fd68 12 * are permitted provided that the following conditions are met:
Kojto 158:b23ee177fd68 13 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 158:b23ee177fd68 14 * this list of conditions and the following disclaimer.
Kojto 158:b23ee177fd68 15 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 158:b23ee177fd68 16 * this list of conditions and the following disclaimer in the documentation
Kojto 158:b23ee177fd68 17 * and/or other materials provided with the distribution.
Kojto 158:b23ee177fd68 18 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 158:b23ee177fd68 19 * may be used to endorse or promote products derived from this software
Kojto 158:b23ee177fd68 20 * without specific prior written permission.
Kojto 158:b23ee177fd68 21 *
Kojto 158:b23ee177fd68 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 158:b23ee177fd68 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 158:b23ee177fd68 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 158:b23ee177fd68 25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 158:b23ee177fd68 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 158:b23ee177fd68 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 158:b23ee177fd68 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 158:b23ee177fd68 29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 158:b23ee177fd68 30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 158:b23ee177fd68 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 158:b23ee177fd68 32 *
Kojto 158:b23ee177fd68 33 ******************************************************************************
Kojto 158:b23ee177fd68 34 */
Kojto 158:b23ee177fd68 35 #if defined(USE_FULL_LL_DRIVER)
Kojto 158:b23ee177fd68 36
Kojto 158:b23ee177fd68 37 /* Includes ------------------------------------------------------------------*/
Kojto 158:b23ee177fd68 38 #include "stm32l0xx_ll_crc.h"
Kojto 158:b23ee177fd68 39 #include "stm32l0xx_ll_bus.h"
Kojto 158:b23ee177fd68 40
Kojto 158:b23ee177fd68 41 #ifdef USE_FULL_ASSERT
Kojto 158:b23ee177fd68 42 #include "stm32_assert.h"
Kojto 158:b23ee177fd68 43 #else
Kojto 158:b23ee177fd68 44 #define assert_param(expr) ((void)0U)
Kojto 158:b23ee177fd68 45 #endif
Kojto 158:b23ee177fd68 46
Kojto 158:b23ee177fd68 47 /** @addtogroup STM32L0xx_LL_Driver
Kojto 158:b23ee177fd68 48 * @{
Kojto 158:b23ee177fd68 49 */
Kojto 158:b23ee177fd68 50
Kojto 158:b23ee177fd68 51 #if defined (CRC)
Kojto 158:b23ee177fd68 52
Kojto 158:b23ee177fd68 53 /** @addtogroup CRC_LL
Kojto 158:b23ee177fd68 54 * @{
Kojto 158:b23ee177fd68 55 */
Kojto 158:b23ee177fd68 56
Kojto 158:b23ee177fd68 57 /* Private types -------------------------------------------------------------*/
Kojto 158:b23ee177fd68 58 /* Private variables ---------------------------------------------------------*/
Kojto 158:b23ee177fd68 59 /* Private constants ---------------------------------------------------------*/
Kojto 158:b23ee177fd68 60 /* Private macros ------------------------------------------------------------*/
Kojto 158:b23ee177fd68 61 /* Private function prototypes -----------------------------------------------*/
Kojto 158:b23ee177fd68 62
Kojto 158:b23ee177fd68 63 /* Exported functions --------------------------------------------------------*/
Kojto 158:b23ee177fd68 64 /** @addtogroup CRC_LL_Exported_Functions
Kojto 158:b23ee177fd68 65 * @{
Kojto 158:b23ee177fd68 66 */
Kojto 158:b23ee177fd68 67
Kojto 158:b23ee177fd68 68 /** @addtogroup CRC_LL_EF_Init
Kojto 158:b23ee177fd68 69 * @{
Kojto 158:b23ee177fd68 70 */
Kojto 158:b23ee177fd68 71
Kojto 158:b23ee177fd68 72 /**
Kojto 158:b23ee177fd68 73 * @brief De-initialize CRC registers (Registers restored to their default values).
Kojto 158:b23ee177fd68 74 * @param CRCx CRC Instance
Kojto 158:b23ee177fd68 75 * @retval An ErrorStatus enumeration value:
Kojto 158:b23ee177fd68 76 * - SUCCESS: CRC registers are de-initialized
Kojto 158:b23ee177fd68 77 * - ERROR: CRC registers are not de-initialized
Kojto 158:b23ee177fd68 78 */
Kojto 158:b23ee177fd68 79 ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx)
Kojto 158:b23ee177fd68 80 {
Kojto 158:b23ee177fd68 81 ErrorStatus status = SUCCESS;
Kojto 158:b23ee177fd68 82
Kojto 158:b23ee177fd68 83 /* Check the parameters */
Kojto 158:b23ee177fd68 84 assert_param(IS_CRC_ALL_INSTANCE(CRCx));
Kojto 158:b23ee177fd68 85
Kojto 158:b23ee177fd68 86 if (CRCx == CRC)
Kojto 158:b23ee177fd68 87 {
Kojto 158:b23ee177fd68 88 /* Force CRC reset */
Kojto 158:b23ee177fd68 89 LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC);
Kojto 158:b23ee177fd68 90
Kojto 158:b23ee177fd68 91 /* Release CRC reset */
Kojto 158:b23ee177fd68 92 LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC);
Kojto 158:b23ee177fd68 93 }
Kojto 158:b23ee177fd68 94 else
Kojto 158:b23ee177fd68 95 {
Kojto 158:b23ee177fd68 96 status = ERROR;
Kojto 158:b23ee177fd68 97 }
Kojto 158:b23ee177fd68 98
Kojto 158:b23ee177fd68 99 return (status);
Kojto 158:b23ee177fd68 100 }
Kojto 158:b23ee177fd68 101
Kojto 158:b23ee177fd68 102 /**
Kojto 158:b23ee177fd68 103 * @}
Kojto 158:b23ee177fd68 104 */
Kojto 158:b23ee177fd68 105
Kojto 158:b23ee177fd68 106 /**
Kojto 158:b23ee177fd68 107 * @}
Kojto 158:b23ee177fd68 108 */
Kojto 158:b23ee177fd68 109
Kojto 158:b23ee177fd68 110 /**
Kojto 158:b23ee177fd68 111 * @}
Kojto 158:b23ee177fd68 112 */
Kojto 158:b23ee177fd68 113
Kojto 158:b23ee177fd68 114 #endif /* defined (CRC) */
Kojto 158:b23ee177fd68 115
Kojto 158:b23ee177fd68 116 /**
Kojto 158:b23ee177fd68 117 * @}
Kojto 158:b23ee177fd68 118 */
Kojto 158:b23ee177fd68 119
Kojto 158:b23ee177fd68 120 #endif /* USE_FULL_LL_DRIVER */
Kojto 158:b23ee177fd68 121
Kojto 158:b23ee177fd68 122 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Kojto 158:b23ee177fd68 123