TUKS MCU Introductory course / TUKS-COURSE-2-LED
Committer:
elmot
Date:
Fri Feb 24 21:13:56 2017 +0000
Revision:
1:d0dfbce63a89
Ready-to-copy

Who changed what in which revision?

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