version_2.0

Dependents:   cc3000_ping_demo_try_2

Fork of mbed by mbed official

Committer:
emilmont
Date:
Fri Feb 14 14:36:43 2014 +0000
Revision:
77:869cf507173a
Child:
81:7d30d6019079
Release 77 of the mbed library

Main changes:
* Add target NUCLEO_F030R8
* Add target NUCLEO_F401RE
* Add target NUCLEO_F103RB
* Add target NUCLEO_L152RE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 77:869cf507173a 1 /**
emilmont 77:869cf507173a 2 ******************************************************************************
emilmont 77:869cf507173a 3 * @file stm32f0xx_crc.h
emilmont 77:869cf507173a 4 * @author MCD Application Team
emilmont 77:869cf507173a 5 * @version V1.3.0
emilmont 77:869cf507173a 6 * @date 16-January-2014
emilmont 77:869cf507173a 7 * @brief This file contains all the functions prototypes for the CRC firmware
emilmont 77:869cf507173a 8 * library.
emilmont 77:869cf507173a 9 ******************************************************************************
emilmont 77:869cf507173a 10 * @attention
emilmont 77:869cf507173a 11 *
emilmont 77:869cf507173a 12 * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
emilmont 77:869cf507173a 13 *
emilmont 77:869cf507173a 14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
emilmont 77:869cf507173a 15 * You may not use this file except in compliance with the License.
emilmont 77:869cf507173a 16 * You may obtain a copy of the License at:
emilmont 77:869cf507173a 17 *
emilmont 77:869cf507173a 18 * http://www.st.com/software_license_agreement_liberty_v2
emilmont 77:869cf507173a 19 *
emilmont 77:869cf507173a 20 * Unless required by applicable law or agreed to in writing, software
emilmont 77:869cf507173a 21 * distributed under the License is distributed on an "AS IS" BASIS,
emilmont 77:869cf507173a 22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
emilmont 77:869cf507173a 23 * See the License for the specific language governing permissions and
emilmont 77:869cf507173a 24 * limitations under the License.
emilmont 77:869cf507173a 25 *
emilmont 77:869cf507173a 26 ******************************************************************************
emilmont 77:869cf507173a 27 */
emilmont 77:869cf507173a 28
emilmont 77:869cf507173a 29 /* Define to prevent recursive inclusion -------------------------------------*/
emilmont 77:869cf507173a 30 #ifndef __STM32F0XX_CRC_H
emilmont 77:869cf507173a 31 #define __STM32F0XX_CRC_H
emilmont 77:869cf507173a 32
emilmont 77:869cf507173a 33 #ifdef __cplusplus
emilmont 77:869cf507173a 34 extern "C" {
emilmont 77:869cf507173a 35 #endif
emilmont 77:869cf507173a 36
emilmont 77:869cf507173a 37 /*!< Includes ----------------------------------------------------------------*/
emilmont 77:869cf507173a 38 #include "stm32f0xx.h"
emilmont 77:869cf507173a 39
emilmont 77:869cf507173a 40 /** @addtogroup STM32F0xx_StdPeriph_Driver
emilmont 77:869cf507173a 41 * @{
emilmont 77:869cf507173a 42 */
emilmont 77:869cf507173a 43
emilmont 77:869cf507173a 44 /** @addtogroup CRC
emilmont 77:869cf507173a 45 * @{
emilmont 77:869cf507173a 46 */
emilmont 77:869cf507173a 47
emilmont 77:869cf507173a 48 /* Exported types ------------------------------------------------------------*/
emilmont 77:869cf507173a 49 /* Exported constants --------------------------------------------------------*/
emilmont 77:869cf507173a 50
emilmont 77:869cf507173a 51 /** @defgroup CRC_ReverseInputData
emilmont 77:869cf507173a 52 * @{
emilmont 77:869cf507173a 53 */
emilmont 77:869cf507173a 54 #define CRC_ReverseInputData_No ((uint32_t)0x00000000) /*!< No reverse operation of Input Data */
emilmont 77:869cf507173a 55 #define CRC_ReverseInputData_8bits CRC_CR_REV_IN_0 /*!< Reverse operation of Input Data on 8 bits */
emilmont 77:869cf507173a 56 #define CRC_ReverseInputData_16bits CRC_CR_REV_IN_1 /*!< Reverse operation of Input Data on 16 bits */
emilmont 77:869cf507173a 57 #define CRC_ReverseInputData_32bits CRC_CR_REV_IN /*!< Reverse operation of Input Data on 32 bits */
emilmont 77:869cf507173a 58
emilmont 77:869cf507173a 59 #define IS_CRC_REVERSE_INPUT_DATA(DATA) (((DATA) == CRC_ReverseInputData_No) || \
emilmont 77:869cf507173a 60 ((DATA) == CRC_ReverseInputData_8bits) || \
emilmont 77:869cf507173a 61 ((DATA) == CRC_ReverseInputData_16bits) || \
emilmont 77:869cf507173a 62 ((DATA) == CRC_ReverseInputData_32bits))
emilmont 77:869cf507173a 63
emilmont 77:869cf507173a 64 /**
emilmont 77:869cf507173a 65 * @}
emilmont 77:869cf507173a 66 */
emilmont 77:869cf507173a 67
emilmont 77:869cf507173a 68 /** @defgroup CRC_PolynomialSize
emilmont 77:869cf507173a 69 * @brief Only applicable for STM32F042 and STM32F072 devices
emilmont 77:869cf507173a 70 * @{
emilmont 77:869cf507173a 71 */
emilmont 77:869cf507173a 72 #define CRC_PolSize_7 CRC_CR_POLSIZE /*!< 7-bit polynomial for CRC calculation */
emilmont 77:869cf507173a 73 #define CRC_PolSize_8 CRC_CR_POLSIZE_1 /*!< 8-bit polynomial for CRC calculation */
emilmont 77:869cf507173a 74 #define CRC_PolSize_16 CRC_CR_POLSIZE_0 /*!< 16-bit polynomial for CRC calculation */
emilmont 77:869cf507173a 75 #define CRC_PolSize_32 ((uint32_t)0x00000000)/*!< 32-bit polynomial for CRC calculation */
emilmont 77:869cf507173a 76
emilmont 77:869cf507173a 77 #define IS_CRC_POL_SIZE(SIZE) (((SIZE) == CRC_PolSize_7) || \
emilmont 77:869cf507173a 78 ((SIZE) == CRC_PolSize_8) || \
emilmont 77:869cf507173a 79 ((SIZE) == CRC_PolSize_16) || \
emilmont 77:869cf507173a 80 ((SIZE) == CRC_PolSize_32))
emilmont 77:869cf507173a 81
emilmont 77:869cf507173a 82 /**
emilmont 77:869cf507173a 83 * @}
emilmont 77:869cf507173a 84 */
emilmont 77:869cf507173a 85
emilmont 77:869cf507173a 86 /* Exported macro ------------------------------------------------------------*/
emilmont 77:869cf507173a 87 /* Exported functions ------------------------------------------------------- */
emilmont 77:869cf507173a 88 /* Configuration of the CRC computation unit **********************************/
emilmont 77:869cf507173a 89 void CRC_DeInit(void);
emilmont 77:869cf507173a 90 void CRC_ResetDR(void);
emilmont 77:869cf507173a 91 void CRC_PolynomialSizeSelect(uint32_t CRC_PolSize); /*!< Only applicable for STM32F042 and STM32F072 devices */
emilmont 77:869cf507173a 92 void CRC_ReverseInputDataSelect(uint32_t CRC_ReverseInputData);
emilmont 77:869cf507173a 93 void CRC_ReverseOutputDataCmd(FunctionalState NewState);
emilmont 77:869cf507173a 94 void CRC_SetInitRegister(uint32_t CRC_InitValue);
emilmont 77:869cf507173a 95 void CRC_SetPolynomial(uint32_t CRC_Pol); /*!< Only applicable for STM32F042 and STM32F072 devices */
emilmont 77:869cf507173a 96
emilmont 77:869cf507173a 97 /* CRC computation ************************************************************/
emilmont 77:869cf507173a 98 uint32_t CRC_CalcCRC(uint32_t CRC_Data);
emilmont 77:869cf507173a 99 uint32_t CRC_CalcCRC16bits(uint16_t CRC_Data); /*!< Only applicable for STM32F042 and STM32F072 devices */
emilmont 77:869cf507173a 100 uint32_t CRC_CalcCRC8bits(uint8_t CRC_Data); /*!< Only applicable for STM32F042 and STM32F072 devices */
emilmont 77:869cf507173a 101 uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength);
emilmont 77:869cf507173a 102 uint32_t CRC_GetCRC(void);
emilmont 77:869cf507173a 103
emilmont 77:869cf507173a 104 /* Independent register (IDR) access (write/read) *****************************/
emilmont 77:869cf507173a 105 void CRC_SetIDRegister(uint8_t CRC_IDValue);
emilmont 77:869cf507173a 106 uint8_t CRC_GetIDRegister(void);
emilmont 77:869cf507173a 107
emilmont 77:869cf507173a 108 #ifdef __cplusplus
emilmont 77:869cf507173a 109 }
emilmont 77:869cf507173a 110 #endif
emilmont 77:869cf507173a 111
emilmont 77:869cf507173a 112 #endif /* __STM32F0XX_CRC_H */
emilmont 77:869cf507173a 113
emilmont 77:869cf507173a 114 /**
emilmont 77:869cf507173a 115 * @}
emilmont 77:869cf507173a 116 */
emilmont 77:869cf507173a 117
emilmont 77:869cf507173a 118 /**
emilmont 77:869cf507173a 119 * @}
emilmont 77:869cf507173a 120 */
emilmont 77:869cf507173a 121
emilmont 77:869cf507173a 122 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/