Move telemetry displayport init and cms device registering
[betaflight.git] / lib / main / STM32F3 / Drivers / STM32F30x_StdPeriph_Driver / inc / stm32f30x_crc.h
blob1b4d4b692dd49f3594b274e47dc5d9a192bbf3cb
1 /**
2 ******************************************************************************
3 * @file stm32f30x_crc.h
4 * @author MCD Application Team
5 * @version V1.1.1
6 * @date 04-April-2014
7 * @brief This file contains all the functions prototypes for the CRC firmware
8 * library.
9 ******************************************************************************
10 * @attention
12 * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
15 * You may not use this file except in compliance with the License.
16 * You may obtain a copy of the License at:
18 * http://www.st.com/software_license_agreement_liberty_v2
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
26 ******************************************************************************
27 */
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F30x_CRC_H
31 #define __STM32F30x_CRC_H
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
37 /*!< Includes ----------------------------------------------------------------*/
38 #include "stm32f30x.h"
40 /** @addtogroup STM32F30x_StdPeriph_Driver
41 * @{
44 /** @addtogroup CRC
45 * @{
48 /* Exported types ------------------------------------------------------------*/
49 /* Exported constants --------------------------------------------------------*/
51 /** @defgroup CRC_ReverseInputData
52 * @{
54 #define CRC_ReverseInputData_No ((uint32_t)0x00000000) /*!< No reverse operation of Input Data */
55 #define CRC_ReverseInputData_8bits CRC_CR_REV_IN_0 /*!< Reverse operation of Input Data on 8 bits */
56 #define CRC_ReverseInputData_16bits CRC_CR_REV_IN_1 /*!< Reverse operation of Input Data on 16 bits */
57 #define CRC_ReverseInputData_32bits CRC_CR_REV_IN /*!< Reverse operation of Input Data on 32 bits */
59 #define IS_CRC_REVERSE_INPUT_DATA(DATA) (((DATA) == CRC_ReverseInputData_No) || \
60 ((DATA) == CRC_ReverseInputData_8bits) || \
61 ((DATA) == CRC_ReverseInputData_16bits) || \
62 ((DATA) == CRC_ReverseInputData_32bits))
64 /**
65 * @}
68 /** @defgroup CRC_PolynomialSize
69 * @{
71 #define CRC_PolSize_7 CRC_CR_POLSIZE /*!< 7-bit polynomial for CRC calculation */
72 #define CRC_PolSize_8 CRC_CR_POLSIZE_1 /*!< 8-bit polynomial for CRC calculation */
73 #define CRC_PolSize_16 CRC_CR_POLSIZE_0 /*!< 16-bit polynomial for CRC calculation */
74 #define CRC_PolSize_32 ((uint32_t)0x00000000)/*!< 32-bit polynomial for CRC calculation */
76 #define IS_CRC_POL_SIZE(SIZE) (((SIZE) == CRC_PolSize_7) || \
77 ((SIZE) == CRC_PolSize_8) || \
78 ((SIZE) == CRC_PolSize_16) || \
79 ((SIZE) == CRC_PolSize_32))
81 /**
82 * @}
85 /* Exported macro ------------------------------------------------------------*/
86 /* Exported functions ------------------------------------------------------- */
87 /* Configuration of the CRC computation unit **********************************/
88 void CRC_DeInit(void);
89 void CRC_ResetDR(void);
90 void CRC_PolynomialSizeSelect(uint32_t CRC_PolSize);
91 void CRC_ReverseInputDataSelect(uint32_t CRC_ReverseInputData);
92 void CRC_ReverseOutputDataCmd(FunctionalState NewState);
93 void CRC_SetInitRegister(uint32_t CRC_InitValue);
94 void CRC_SetPolynomial(uint32_t CRC_Pol);
96 /* CRC computation ************************************************************/
97 uint32_t CRC_CalcCRC(uint32_t CRC_Data);
98 uint32_t CRC_CalcCRC16bits(uint16_t CRC_Data);
99 uint32_t CRC_CalcCRC8bits(uint8_t CRC_Data);
100 uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength);
101 uint32_t CRC_GetCRC(void);
103 /* Independent register (IDR) access (write/read) *****************************/
104 void CRC_SetIDRegister(uint8_t CRC_IDValue);
105 uint8_t CRC_GetIDRegister(void);
107 #ifdef __cplusplus
109 #endif
111 #endif /* __STM32F30x_CRC_H */
114 * @}
118 * @}
121 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/