DHT11

Committer:
jhon309
Date:
Thu Aug 13 00:21:57 2015 +0000
Revision:
0:c52df770855b
DHT11

Who changed what in which revision?

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