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