mbed(SerialHalfDuplex入り)
Fork of mbed by
TARGET_NUCLEO_F103RB/stm32f1xx_hal_crc.h@98:01a414ca7d6d, 2015-04-08 (annotated)
- Committer:
- yusuke_kyo
- Date:
- Wed Apr 08 08:04:18 2015 +0000
- Revision:
- 98:01a414ca7d6d
- Parent:
- 96:487b796308b0
remove SerialHalfDuplex.h
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 96:487b796308b0 | 1 | /** |
Kojto | 96:487b796308b0 | 2 | ****************************************************************************** |
Kojto | 96:487b796308b0 | 3 | * @file stm32f1xx_hal_crc.h |
Kojto | 96:487b796308b0 | 4 | * @author MCD Application Team |
Kojto | 96:487b796308b0 | 5 | * @version V1.0.0 |
Kojto | 96:487b796308b0 | 6 | * @date 15-December-2014 |
Kojto | 96:487b796308b0 | 7 | * @brief Header file of CRC HAL module. |
Kojto | 96:487b796308b0 | 8 | ****************************************************************************** |
Kojto | 96:487b796308b0 | 9 | * @attention |
Kojto | 96:487b796308b0 | 10 | * |
Kojto | 96:487b796308b0 | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
Kojto | 96:487b796308b0 | 12 | * |
Kojto | 96:487b796308b0 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 96:487b796308b0 | 14 | * are permitted provided that the following conditions are met: |
Kojto | 96:487b796308b0 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 96:487b796308b0 | 16 | * this list of conditions and the following disclaimer. |
Kojto | 96:487b796308b0 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 96:487b796308b0 | 18 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 96:487b796308b0 | 19 | * and/or other materials provided with the distribution. |
Kojto | 96:487b796308b0 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 96:487b796308b0 | 21 | * may be used to endorse or promote products derived from this software |
Kojto | 96:487b796308b0 | 22 | * without specific prior written permission. |
Kojto | 96:487b796308b0 | 23 | * |
Kojto | 96:487b796308b0 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 96:487b796308b0 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 96:487b796308b0 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 96:487b796308b0 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 96:487b796308b0 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 96:487b796308b0 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 96:487b796308b0 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 96:487b796308b0 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 96:487b796308b0 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 96:487b796308b0 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 96:487b796308b0 | 34 | * |
Kojto | 96:487b796308b0 | 35 | ****************************************************************************** |
Kojto | 96:487b796308b0 | 36 | */ |
Kojto | 96:487b796308b0 | 37 | |
Kojto | 96:487b796308b0 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Kojto | 96:487b796308b0 | 39 | #ifndef __STM32F1xx_HAL_CRC_H |
Kojto | 96:487b796308b0 | 40 | #define __STM32F1xx_HAL_CRC_H |
Kojto | 96:487b796308b0 | 41 | |
Kojto | 96:487b796308b0 | 42 | #ifdef __cplusplus |
Kojto | 96:487b796308b0 | 43 | extern "C" { |
Kojto | 96:487b796308b0 | 44 | #endif |
Kojto | 96:487b796308b0 | 45 | |
Kojto | 96:487b796308b0 | 46 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 96:487b796308b0 | 47 | #include "stm32f1xx_hal_def.h" |
Kojto | 96:487b796308b0 | 48 | |
Kojto | 96:487b796308b0 | 49 | /** @addtogroup STM32F1xx_HAL_Driver |
Kojto | 96:487b796308b0 | 50 | * @{ |
Kojto | 96:487b796308b0 | 51 | */ |
Kojto | 96:487b796308b0 | 52 | |
Kojto | 96:487b796308b0 | 53 | /** @addtogroup CRC |
Kojto | 96:487b796308b0 | 54 | * @{ |
Kojto | 96:487b796308b0 | 55 | */ |
Kojto | 96:487b796308b0 | 56 | |
Kojto | 96:487b796308b0 | 57 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 96:487b796308b0 | 58 | |
Kojto | 96:487b796308b0 | 59 | /** @defgroup CRC_Exported_Types CRC Exported Types |
Kojto | 96:487b796308b0 | 60 | * @{ |
Kojto | 96:487b796308b0 | 61 | */ |
Kojto | 96:487b796308b0 | 62 | |
Kojto | 96:487b796308b0 | 63 | /** |
Kojto | 96:487b796308b0 | 64 | * @brief CRC HAL State Structure definition |
Kojto | 96:487b796308b0 | 65 | */ |
Kojto | 96:487b796308b0 | 66 | typedef enum |
Kojto | 96:487b796308b0 | 67 | { |
Kojto | 96:487b796308b0 | 68 | HAL_CRC_STATE_RESET = 0x00, /*!< CRC not yet initialized or disabled */ |
Kojto | 96:487b796308b0 | 69 | HAL_CRC_STATE_READY = 0x01, /*!< CRC initialized and ready for use */ |
Kojto | 96:487b796308b0 | 70 | HAL_CRC_STATE_BUSY = 0x02, /*!< CRC internal process is ongoing */ |
Kojto | 96:487b796308b0 | 71 | HAL_CRC_STATE_TIMEOUT = 0x03, /*!< CRC timeout state */ |
Kojto | 96:487b796308b0 | 72 | HAL_CRC_STATE_ERROR = 0x04 /*!< CRC error state */ |
Kojto | 96:487b796308b0 | 73 | |
Kojto | 96:487b796308b0 | 74 | }HAL_CRC_StateTypeDef; |
Kojto | 96:487b796308b0 | 75 | |
Kojto | 96:487b796308b0 | 76 | /** |
Kojto | 96:487b796308b0 | 77 | * @brief CRC handle Structure definition |
Kojto | 96:487b796308b0 | 78 | */ |
Kojto | 96:487b796308b0 | 79 | typedef struct |
Kojto | 96:487b796308b0 | 80 | { |
Kojto | 96:487b796308b0 | 81 | CRC_TypeDef *Instance; /*!< Register base address */ |
Kojto | 96:487b796308b0 | 82 | |
Kojto | 96:487b796308b0 | 83 | HAL_LockTypeDef Lock; /*!< CRC locking object */ |
Kojto | 96:487b796308b0 | 84 | |
Kojto | 96:487b796308b0 | 85 | __IO HAL_CRC_StateTypeDef State; /*!< CRC communication state */ |
Kojto | 96:487b796308b0 | 86 | |
Kojto | 96:487b796308b0 | 87 | }CRC_HandleTypeDef; |
Kojto | 96:487b796308b0 | 88 | |
Kojto | 96:487b796308b0 | 89 | /** |
Kojto | 96:487b796308b0 | 90 | * @} |
Kojto | 96:487b796308b0 | 91 | */ |
Kojto | 96:487b796308b0 | 92 | |
Kojto | 96:487b796308b0 | 93 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 96:487b796308b0 | 94 | /* Exported macro ------------------------------------------------------------*/ |
Kojto | 96:487b796308b0 | 95 | |
Kojto | 96:487b796308b0 | 96 | /** @defgroup CRC_Exported_Macros CRC Exported Macros |
Kojto | 96:487b796308b0 | 97 | * @{ |
Kojto | 96:487b796308b0 | 98 | */ |
Kojto | 96:487b796308b0 | 99 | |
Kojto | 96:487b796308b0 | 100 | /** @brief Reset CRC handle state |
Kojto | 96:487b796308b0 | 101 | * @param __HANDLE__: CRC handle |
Kojto | 96:487b796308b0 | 102 | * @retval None |
Kojto | 96:487b796308b0 | 103 | */ |
Kojto | 96:487b796308b0 | 104 | #define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET) |
Kojto | 96:487b796308b0 | 105 | |
Kojto | 96:487b796308b0 | 106 | /** |
Kojto | 96:487b796308b0 | 107 | * @brief Resets CRC Data Register. |
Kojto | 96:487b796308b0 | 108 | * @param __HANDLE__: CRC handle |
Kojto | 96:487b796308b0 | 109 | * @retval None |
Kojto | 96:487b796308b0 | 110 | */ |
Kojto | 96:487b796308b0 | 111 | #define __HAL_CRC_DR_RESET(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->CR,CRC_CR_RESET)) |
Kojto | 96:487b796308b0 | 112 | |
Kojto | 96:487b796308b0 | 113 | /** |
Kojto | 96:487b796308b0 | 114 | * @brief Stores a 8-bit data in the Independent Data(ID) register. |
Kojto | 96:487b796308b0 | 115 | * @param __HANDLE__: CRC handle |
Kojto | 96:487b796308b0 | 116 | * @param __VALUE__: 8-bit value to be stored in the ID register |
Kojto | 96:487b796308b0 | 117 | * @retval None |
Kojto | 96:487b796308b0 | 118 | */ |
Kojto | 96:487b796308b0 | 119 | #define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (MODIFY_REG((__HANDLE__)->Instance->IDR, CRC_IDR_IDR, (__VALUE__)) |
Kojto | 96:487b796308b0 | 120 | |
Kojto | 96:487b796308b0 | 121 | /** |
Kojto | 96:487b796308b0 | 122 | * @brief Returns the 8-bit data stored in the Independent Data(ID) register. |
Kojto | 96:487b796308b0 | 123 | * @param __HANDLE__: CRC handle |
Kojto | 96:487b796308b0 | 124 | * @retval 8-bit value of the ID register |
Kojto | 96:487b796308b0 | 125 | */ |
Kojto | 96:487b796308b0 | 126 | #define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR) |
Kojto | 96:487b796308b0 | 127 | |
Kojto | 96:487b796308b0 | 128 | /** |
Kojto | 96:487b796308b0 | 129 | * @} |
Kojto | 96:487b796308b0 | 130 | */ |
Kojto | 96:487b796308b0 | 131 | |
Kojto | 96:487b796308b0 | 132 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 96:487b796308b0 | 133 | |
Kojto | 96:487b796308b0 | 134 | /** @addtogroup CRC_Exported_Functions |
Kojto | 96:487b796308b0 | 135 | * @{ |
Kojto | 96:487b796308b0 | 136 | */ |
Kojto | 96:487b796308b0 | 137 | |
Kojto | 96:487b796308b0 | 138 | /** @addtogroup CRC_Exported_Functions_Group1 |
Kojto | 96:487b796308b0 | 139 | * @{ |
Kojto | 96:487b796308b0 | 140 | */ |
Kojto | 96:487b796308b0 | 141 | |
Kojto | 96:487b796308b0 | 142 | /* Initialization/de-initialization functions **********************************/ |
Kojto | 96:487b796308b0 | 143 | HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc); |
Kojto | 96:487b796308b0 | 144 | HAL_StatusTypeDef HAL_CRC_DeInit (CRC_HandleTypeDef *hcrc); |
Kojto | 96:487b796308b0 | 145 | void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc); |
Kojto | 96:487b796308b0 | 146 | void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc); |
Kojto | 96:487b796308b0 | 147 | |
Kojto | 96:487b796308b0 | 148 | /** |
Kojto | 96:487b796308b0 | 149 | * @} |
Kojto | 96:487b796308b0 | 150 | */ |
Kojto | 96:487b796308b0 | 151 | |
Kojto | 96:487b796308b0 | 152 | /** @addtogroup CRC_Exported_Functions_Group2 |
Kojto | 96:487b796308b0 | 153 | * @{ |
Kojto | 96:487b796308b0 | 154 | */ |
Kojto | 96:487b796308b0 | 155 | |
Kojto | 96:487b796308b0 | 156 | /* Peripheral Control functions ************************************************/ |
Kojto | 96:487b796308b0 | 157 | uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); |
Kojto | 96:487b796308b0 | 158 | uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); |
Kojto | 96:487b796308b0 | 159 | |
Kojto | 96:487b796308b0 | 160 | |
Kojto | 96:487b796308b0 | 161 | /** |
Kojto | 96:487b796308b0 | 162 | * @} |
Kojto | 96:487b796308b0 | 163 | */ |
Kojto | 96:487b796308b0 | 164 | |
Kojto | 96:487b796308b0 | 165 | /** @addtogroup CRC_Exported_Functions_Group3 |
Kojto | 96:487b796308b0 | 166 | ** @{ |
Kojto | 96:487b796308b0 | 167 | */ |
Kojto | 96:487b796308b0 | 168 | |
Kojto | 96:487b796308b0 | 169 | /* Peripheral State functions **************************************************/ |
Kojto | 96:487b796308b0 | 170 | HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc); |
Kojto | 96:487b796308b0 | 171 | |
Kojto | 96:487b796308b0 | 172 | /** |
Kojto | 96:487b796308b0 | 173 | * @} |
Kojto | 96:487b796308b0 | 174 | */ |
Kojto | 96:487b796308b0 | 175 | |
Kojto | 96:487b796308b0 | 176 | |
Kojto | 96:487b796308b0 | 177 | /** |
Kojto | 96:487b796308b0 | 178 | * @} |
Kojto | 96:487b796308b0 | 179 | */ |
Kojto | 96:487b796308b0 | 180 | |
Kojto | 96:487b796308b0 | 181 | /** |
Kojto | 96:487b796308b0 | 182 | * @} |
Kojto | 96:487b796308b0 | 183 | */ |
Kojto | 96:487b796308b0 | 184 | |
Kojto | 96:487b796308b0 | 185 | /** |
Kojto | 96:487b796308b0 | 186 | * @} |
Kojto | 96:487b796308b0 | 187 | */ |
Kojto | 96:487b796308b0 | 188 | |
Kojto | 96:487b796308b0 | 189 | #ifdef __cplusplus |
Kojto | 96:487b796308b0 | 190 | } |
Kojto | 96:487b796308b0 | 191 | #endif |
Kojto | 96:487b796308b0 | 192 | |
Kojto | 96:487b796308b0 | 193 | #endif /* __STM32F1xx_HAL_CRC_H */ |
Kojto | 96:487b796308b0 | 194 | |
Kojto | 96:487b796308b0 | 195 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |