my fork
Fork of mbed by
TARGET_NUCLEO_L053R8/stm32l0xx_hal_crc_ex.h@97:4298809c7c9e, 2015-04-08 (annotated)
- Committer:
- filartrix
- Date:
- Wed Apr 08 14:12:53 2015 +0000
- Revision:
- 97:4298809c7c9e
- Parent:
- 96:487b796308b0
First reale BlueNRG module for nucleo 401 board
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 84:0b3ab51c8877 | 1 | /** |
bogdanm | 84:0b3ab51c8877 | 2 | ****************************************************************************** |
bogdanm | 84:0b3ab51c8877 | 3 | * @file stm32l0xx_hal_crc_ex.h |
bogdanm | 84:0b3ab51c8877 | 4 | * @author MCD Application Team |
Kojto | 96:487b796308b0 | 5 | * @version V1.2.0 |
Kojto | 96:487b796308b0 | 6 | * @date 06-February-2015 |
Kojto | 96:487b796308b0 | 7 | * @brief Header file of CRC HAL extension module. |
bogdanm | 84:0b3ab51c8877 | 8 | ****************************************************************************** |
bogdanm | 84:0b3ab51c8877 | 9 | * @attention |
bogdanm | 84:0b3ab51c8877 | 10 | * |
Kojto | 96:487b796308b0 | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
bogdanm | 84:0b3ab51c8877 | 12 | * |
bogdanm | 84:0b3ab51c8877 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 84:0b3ab51c8877 | 14 | * are permitted provided that the following conditions are met: |
bogdanm | 84:0b3ab51c8877 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 84:0b3ab51c8877 | 16 | * this list of conditions and the following disclaimer. |
bogdanm | 84:0b3ab51c8877 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 84:0b3ab51c8877 | 18 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 84:0b3ab51c8877 | 19 | * and/or other materials provided with the distribution. |
bogdanm | 84:0b3ab51c8877 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 84:0b3ab51c8877 | 21 | * may be used to endorse or promote products derived from this software |
bogdanm | 84:0b3ab51c8877 | 22 | * without specific prior written permission. |
bogdanm | 84:0b3ab51c8877 | 23 | * |
bogdanm | 84:0b3ab51c8877 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 84:0b3ab51c8877 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 84:0b3ab51c8877 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 84:0b3ab51c8877 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 84:0b3ab51c8877 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 84:0b3ab51c8877 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 84:0b3ab51c8877 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 84:0b3ab51c8877 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 84:0b3ab51c8877 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 84:0b3ab51c8877 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 84:0b3ab51c8877 | 34 | * |
bogdanm | 84:0b3ab51c8877 | 35 | ****************************************************************************** |
bogdanm | 84:0b3ab51c8877 | 36 | */ |
bogdanm | 84:0b3ab51c8877 | 37 | |
bogdanm | 84:0b3ab51c8877 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 39 | #ifndef __STM32L0xx_HAL_CRC_EX_H |
bogdanm | 84:0b3ab51c8877 | 40 | #define __STM32L0xx_HAL_CRC_EX_H |
bogdanm | 84:0b3ab51c8877 | 41 | |
bogdanm | 84:0b3ab51c8877 | 42 | #ifdef __cplusplus |
bogdanm | 84:0b3ab51c8877 | 43 | extern "C" { |
bogdanm | 84:0b3ab51c8877 | 44 | #endif |
bogdanm | 84:0b3ab51c8877 | 45 | |
bogdanm | 84:0b3ab51c8877 | 46 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 47 | #include "stm32l0xx_hal_def.h" |
bogdanm | 84:0b3ab51c8877 | 48 | |
bogdanm | 84:0b3ab51c8877 | 49 | /** @addtogroup STM32L0xx_HAL_Driver |
bogdanm | 84:0b3ab51c8877 | 50 | * @{ |
bogdanm | 84:0b3ab51c8877 | 51 | */ |
bogdanm | 84:0b3ab51c8877 | 52 | |
Kojto | 96:487b796308b0 | 53 | /** @defgroup CRCEx CRCEx |
bogdanm | 84:0b3ab51c8877 | 54 | * @{ |
bogdanm | 84:0b3ab51c8877 | 55 | */ |
bogdanm | 84:0b3ab51c8877 | 56 | |
bogdanm | 84:0b3ab51c8877 | 57 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 58 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 96:487b796308b0 | 59 | |
Kojto | 96:487b796308b0 | 60 | /** @defgroup CRCEx_Exported_Constants CRC Extended exported constants |
Kojto | 96:487b796308b0 | 61 | * @{ |
Kojto | 96:487b796308b0 | 62 | */ |
Kojto | 96:487b796308b0 | 63 | |
Kojto | 96:487b796308b0 | 64 | /** @defgroup CRCEx_Input_Data_Inversion CRC Extended input data inversion modes |
Kojto | 96:487b796308b0 | 65 | * @{ |
Kojto | 96:487b796308b0 | 66 | */ |
Kojto | 96:487b796308b0 | 67 | #define CRC_INPUTDATA_INVERSION_NONE ((uint32_t)0x00000000) |
Kojto | 96:487b796308b0 | 68 | #define CRC_INPUTDATA_INVERSION_BYTE ((uint32_t)CRC_CR_REV_IN_0) |
Kojto | 96:487b796308b0 | 69 | #define CRC_INPUTDATA_INVERSION_HALFWORD ((uint32_t)CRC_CR_REV_IN_1) |
Kojto | 96:487b796308b0 | 70 | #define CRC_INPUTDATA_INVERSION_WORD ((uint32_t)CRC_CR_REV_IN) |
Kojto | 96:487b796308b0 | 71 | |
Kojto | 96:487b796308b0 | 72 | #define IS_CRC_INPUTDATA_INVERSION_MODE(__MODE__) (((__MODE__) == CRC_INPUTDATA_INVERSION_NONE) || \ |
Kojto | 96:487b796308b0 | 73 | ((__MODE__) == CRC_INPUTDATA_INVERSION_BYTE) || \ |
Kojto | 96:487b796308b0 | 74 | ((__MODE__) == CRC_INPUTDATA_INVERSION_HALFWORD) || \ |
Kojto | 96:487b796308b0 | 75 | ((__MODE__) == CRC_INPUTDATA_INVERSION_WORD)) |
Kojto | 96:487b796308b0 | 76 | /** |
Kojto | 96:487b796308b0 | 77 | * @} |
Kojto | 96:487b796308b0 | 78 | */ |
Kojto | 96:487b796308b0 | 79 | |
Kojto | 96:487b796308b0 | 80 | /** @defgroup CRCEx_Output_Data_Inversion CRC Extended output data inversion modes |
Kojto | 96:487b796308b0 | 81 | * @{ |
Kojto | 96:487b796308b0 | 82 | */ |
Kojto | 96:487b796308b0 | 83 | #define CRC_OUTPUTDATA_INVERSION_DISABLE ((uint32_t)0x00000000) |
Kojto | 96:487b796308b0 | 84 | #define CRC_OUTPUTDATA_INVERSION_ENABLE ((uint32_t)CRC_CR_REV_OUT) |
Kojto | 96:487b796308b0 | 85 | |
Kojto | 96:487b796308b0 | 86 | #define IS_CRC_OUTPUTDATA_INVERSION_MODE(__MODE__) (((__MODE__) == CRC_OUTPUTDATA_INVERSION_DISABLE) || \ |
Kojto | 96:487b796308b0 | 87 | ((__MODE__) == CRC_OUTPUTDATA_INVERSION_ENABLE)) |
Kojto | 96:487b796308b0 | 88 | /** |
Kojto | 96:487b796308b0 | 89 | * @} |
Kojto | 96:487b796308b0 | 90 | */ |
Kojto | 96:487b796308b0 | 91 | |
Kojto | 96:487b796308b0 | 92 | |
Kojto | 96:487b796308b0 | 93 | /** |
Kojto | 96:487b796308b0 | 94 | * @} |
Kojto | 96:487b796308b0 | 95 | */ |
bogdanm | 84:0b3ab51c8877 | 96 | /* Exported macro ------------------------------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 97 | |
Kojto | 96:487b796308b0 | 98 | /** @defgroup CRCEx_Exported_Macros CRC Extended exported macros |
bogdanm | 84:0b3ab51c8877 | 99 | * @{ |
bogdanm | 84:0b3ab51c8877 | 100 | */ |
Kojto | 96:487b796308b0 | 101 | |
Kojto | 96:487b796308b0 | 102 | /** |
Kojto | 96:487b796308b0 | 103 | * @brief Set CRC output reversal |
Kojto | 96:487b796308b0 | 104 | * @param __HANDLE__ : CRC handle |
Kojto | 96:487b796308b0 | 105 | * @retval None. |
Kojto | 96:487b796308b0 | 106 | */ |
Kojto | 96:487b796308b0 | 107 | #define __HAL_CRC_OUTPUTREVERSAL_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_REV_OUT) |
bogdanm | 84:0b3ab51c8877 | 108 | |
Kojto | 96:487b796308b0 | 109 | /** |
Kojto | 96:487b796308b0 | 110 | * @brief Unset CRC output reversal |
Kojto | 96:487b796308b0 | 111 | * @param __HANDLE__ : CRC handle |
Kojto | 96:487b796308b0 | 112 | * @retval None. |
Kojto | 96:487b796308b0 | 113 | */ |
Kojto | 96:487b796308b0 | 114 | #define __HAL_CRC_OUTPUTREVERSAL_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(CRC_CR_REV_OUT)) |
bogdanm | 84:0b3ab51c8877 | 115 | |
bogdanm | 84:0b3ab51c8877 | 116 | /** |
bogdanm | 84:0b3ab51c8877 | 117 | * @brief Set CRC non-default polynomial |
bogdanm | 84:0b3ab51c8877 | 118 | * @param __HANDLE__ : CRC handle |
bogdanm | 84:0b3ab51c8877 | 119 | * @param __POLYNOMIAL__: 7, 8, 16 or 32-bit polynomial |
bogdanm | 84:0b3ab51c8877 | 120 | * @retval None. |
bogdanm | 84:0b3ab51c8877 | 121 | */ |
bogdanm | 84:0b3ab51c8877 | 122 | #define __HAL_CRC_POLYNOMIAL_CONFIG(__HANDLE__, __POLYNOMIAL__) ((__HANDLE__)->Instance->POL = (__POLYNOMIAL__)) |
Kojto | 96:487b796308b0 | 123 | |
bogdanm | 84:0b3ab51c8877 | 124 | /** |
bogdanm | 84:0b3ab51c8877 | 125 | * @} |
bogdanm | 84:0b3ab51c8877 | 126 | */ |
bogdanm | 84:0b3ab51c8877 | 127 | |
Kojto | 96:487b796308b0 | 128 | |
Kojto | 96:487b796308b0 | 129 | /** @defgroup CRCEx_Exported_Functions CRC Extended Exported Functions |
Kojto | 96:487b796308b0 | 130 | * @{ |
Kojto | 96:487b796308b0 | 131 | */ |
Kojto | 96:487b796308b0 | 132 | |
Kojto | 96:487b796308b0 | 133 | /** @defgroup CRCEx_Exported_Functions_Group1 Extended CRC features functions |
Kojto | 96:487b796308b0 | 134 | * @{ |
Kojto | 96:487b796308b0 | 135 | */ |
bogdanm | 84:0b3ab51c8877 | 136 | /* Exported functions --------------------------------------------------------*/ |
bogdanm | 84:0b3ab51c8877 | 137 | /* Initialization and de-initialization functions ****************************/ |
bogdanm | 84:0b3ab51c8877 | 138 | HAL_StatusTypeDef HAL_CRCEx_Polynomial_Set(CRC_HandleTypeDef *hcrc, uint32_t Pol, uint32_t PolyLength); |
Kojto | 96:487b796308b0 | 139 | HAL_StatusTypeDef HAL_CRCEx_Input_Data_Reverse(CRC_HandleTypeDef *hcrc, uint32_t InputReverseMode); |
Kojto | 96:487b796308b0 | 140 | HAL_StatusTypeDef HAL_CRCEx_Output_Data_Reverse(CRC_HandleTypeDef *hcrc, uint32_t OutputReverseMode); |
bogdanm | 84:0b3ab51c8877 | 141 | |
bogdanm | 84:0b3ab51c8877 | 142 | /* Peripheral Control functions ***********************************************/ |
bogdanm | 84:0b3ab51c8877 | 143 | /* Peripheral State and Error functions ***************************************/ |
bogdanm | 84:0b3ab51c8877 | 144 | |
Kojto | 96:487b796308b0 | 145 | /** |
Kojto | 96:487b796308b0 | 146 | * @} |
Kojto | 96:487b796308b0 | 147 | */ |
Kojto | 96:487b796308b0 | 148 | |
Kojto | 96:487b796308b0 | 149 | /** |
Kojto | 96:487b796308b0 | 150 | * @} |
Kojto | 96:487b796308b0 | 151 | */ |
Kojto | 96:487b796308b0 | 152 | |
bogdanm | 84:0b3ab51c8877 | 153 | |
bogdanm | 84:0b3ab51c8877 | 154 | /** |
bogdanm | 84:0b3ab51c8877 | 155 | * @} |
bogdanm | 84:0b3ab51c8877 | 156 | */ |
bogdanm | 84:0b3ab51c8877 | 157 | |
bogdanm | 84:0b3ab51c8877 | 158 | /** |
bogdanm | 84:0b3ab51c8877 | 159 | * @} |
bogdanm | 84:0b3ab51c8877 | 160 | */ |
bogdanm | 84:0b3ab51c8877 | 161 | |
bogdanm | 84:0b3ab51c8877 | 162 | #ifdef __cplusplus |
bogdanm | 84:0b3ab51c8877 | 163 | } |
bogdanm | 84:0b3ab51c8877 | 164 | #endif |
bogdanm | 84:0b3ab51c8877 | 165 | |
bogdanm | 84:0b3ab51c8877 | 166 | #endif /* __STM32L0xx_HAL_CRC_EX_H */ |
bogdanm | 84:0b3ab51c8877 | 167 | |
bogdanm | 84:0b3ab51c8877 | 168 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
Kojto | 96:487b796308b0 | 169 |