Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 6 | ||
---|---|---|---|
Line 59... | Line 59... | ||
59 | typedef struct |
59 | typedef struct |
60 | { |
60 | { |
61 | #if defined(CRC_POL_POL) |
61 | #if defined(CRC_POL_POL) |
62 | uint8_t DefaultPolynomialUse; /*!< This parameter is a value of @ref CRC_Default_Polynomial and indicates if default polynomial is used. |
62 | uint8_t DefaultPolynomialUse; /*!< This parameter is a value of @ref CRC_Default_Polynomial and indicates if default polynomial is used. |
63 | If set to DEFAULT_POLYNOMIAL_ENABLE, resort to default |
63 | If set to DEFAULT_POLYNOMIAL_ENABLE, resort to default |
64 | X^32 + X^26 + X^23 + X^22 + X^16 + X^12 + X^11 + X^10 +X^8 + X^7 + X^5 + X^4 + X^2+ X +1. |
64 | X^32 + X^26 + X^23 + X^22 + X^16 + X^12 + X^11 + X^10 +X^8 + X^7 + X^5 + |
- | 65 | X^4 + X^2+ X +1. |
|
65 | In that case, there is no need to set GeneratingPolynomial field. |
66 | In that case, there is no need to set GeneratingPolynomial field. |
66 | If otherwise set to DEFAULT_POLYNOMIAL_DISABLE, GeneratingPolynomial and CRCLength fields must be set. */ |
67 | If otherwise set to DEFAULT_POLYNOMIAL_DISABLE, GeneratingPolynomial and |
- | 68 | CRCLength fields must be set. */ |
|
67 | #endif /* CRC_POL_POL */ |
69 | #endif /* CRC_POL_POL */ |
68 | 70 | ||
69 | uint8_t DefaultInitValueUse; /*!< This parameter is a value of @ref CRC_Default_InitValue_Use and indicates if default init value is used. |
71 | uint8_t DefaultInitValueUse; /*!< This parameter is a value of @ref CRC_Default_InitValue_Use and indicates if default init value is used. |
70 | If set to DEFAULT_INIT_VALUE_ENABLE, resort to default |
72 | If set to DEFAULT_INIT_VALUE_ENABLE, resort to default |
71 | 0xFFFFFFFF value. In that case, there is no need to set InitValue field. |
73 | 0xFFFFFFFF value. In that case, there is no need to set InitValue field. If |
72 | If otherwise set to DEFAULT_INIT_VALUE_DISABLE, InitValue field must be set. */ |
74 | otherwise set to DEFAULT_INIT_VALUE_DISABLE, InitValue field must be set. */ |
73 | 75 | ||
74 | #if defined(CRC_POL_POL) |
76 | #if defined(CRC_POL_POL) |
75 | uint32_t GeneratingPolynomial; /*!< Set CRC generating polynomial as a 7, 8, 16 or 32-bit long value for a polynomial degree |
77 | uint32_t GeneratingPolynomial; /*!< Set CRC generating polynomial as a 7, 8, 16 or 32-bit long value for a polynomial degree |
76 | respectively equal to 7, 8, 16 or 32. This field is written in normal representation, |
78 | respectively equal to 7, 8, 16 or 32. This field is written in normal, |
77 | e.g., for a polynomial of degree 7, X^7 + X^6 + X^5 + X^2 + 1 is written 0x65. |
79 | representation e.g., for a polynomial of degree 7, X^7 + X^6 + X^5 + X^2 + 1 |
78 | No need to specify it if DefaultPolynomialUse is set to DEFAULT_POLYNOMIAL_ENABLE. */ |
80 | is written 0x65. No need to specify it if DefaultPolynomialUse is set to |
- | 81 | DEFAULT_POLYNOMIAL_ENABLE. */ |
|
79 | 82 | ||
80 | uint32_t CRCLength; /*!< This parameter is a value of @ref CRC_Polynomial_Sizes and indicates CRC length. |
83 | uint32_t CRCLength; /*!< This parameter is a value of @ref CRC_Polynomial_Sizes and indicates CRC length. |
81 | Value can be either one of |
84 | Value can be either one of |
82 | @arg @ref CRC_POLYLENGTH_32B (32-bit CRC), |
85 | @arg @ref CRC_POLYLENGTH_32B (32-bit CRC), |
83 | @arg @ref CRC_POLYLENGTH_16B (16-bit CRC), |
86 | @arg @ref CRC_POLYLENGTH_16B (16-bit CRC), |
Line 89... | Line 92... | ||
89 | is set to DEFAULT_INIT_VALUE_ENABLE. */ |
92 | is set to DEFAULT_INIT_VALUE_ENABLE. */ |
90 | 93 | ||
91 | uint32_t InputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Input_Data_Inversion and specifies input data inversion mode. |
94 | uint32_t InputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Input_Data_Inversion and specifies input data inversion mode. |
92 | Can be either one of the following values |
95 | Can be either one of the following values |
93 | @arg @ref CRC_INPUTDATA_INVERSION_NONE no input data inversion |
96 | @arg @ref CRC_INPUTDATA_INVERSION_NONE no input data inversion |
94 | @arg @ref CRC_INPUTDATA_INVERSION_BYTE byte-wise inversion, 0x1A2B3C4D becomes 0x58D43CB2 |
97 | @arg @ref CRC_INPUTDATA_INVERSION_BYTE byte-wise inversion, 0x1A2B3C4D |
- | 98 | becomes 0x58D43CB2 |
|
95 | @arg @ref CRC_INPUTDATA_INVERSION_HALFWORD halfword-wise inversion, 0x1A2B3C4D becomes 0xD458B23C |
99 | @arg @ref CRC_INPUTDATA_INVERSION_HALFWORD halfword-wise inversion, |
- | 100 | 0x1A2B3C4D becomes 0xD458B23C |
|
96 | @arg @ref CRC_INPUTDATA_INVERSION_WORD word-wise inversion, 0x1A2B3C4D becomes 0xB23CD458 */ |
101 | @arg @ref CRC_INPUTDATA_INVERSION_WORD word-wise inversion, 0x1A2B3C4D |
- | 102 | becomes 0xB23CD458 */ |
|
97 | 103 | ||
98 | uint32_t OutputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Output_Data_Inversion and specifies output data (i.e. CRC) inversion mode. |
104 | uint32_t OutputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Output_Data_Inversion and specifies output data (i.e. CRC) inversion mode. |
99 | Can be either |
105 | Can be either |
100 | @arg @ref CRC_OUTPUTDATA_INVERSION_DISABLE no CRC inversion, |
106 | @arg @ref CRC_OUTPUTDATA_INVERSION_DISABLE no CRC inversion, |
101 | @arg @ref CRC_OUTPUTDATA_INVERSION_ENABLE CRC 0x11223344 is converted into 0x22CC4488 */ |
107 | @arg @ref CRC_OUTPUTDATA_INVERSION_ENABLE CRC 0x11223344 is converted |
- | 108 | into 0x22CC4488 */ |
|
102 | } CRC_InitTypeDef; |
109 | } CRC_InitTypeDef; |
103 | 110 | ||
104 | /** |
111 | /** |
105 | * @brief CRC Handle Structure definition |
112 | * @brief CRC Handle Structure definition |
106 | */ |
113 | */ |
Line 114... | Line 121... | ||
114 | 121 | ||
115 | __IO HAL_CRC_StateTypeDef State; /*!< CRC communication state */ |
122 | __IO HAL_CRC_StateTypeDef State; /*!< CRC communication state */ |
116 | 123 | ||
117 | uint32_t InputDataFormat; /*!< This parameter is a value of @ref CRC_Input_Buffer_Format and specifies input data format. |
124 | uint32_t InputDataFormat; /*!< This parameter is a value of @ref CRC_Input_Buffer_Format and specifies input data format. |
118 | Can be either |
125 | Can be either |
119 | @arg @ref CRC_INPUTDATA_FORMAT_BYTES input data is a stream of bytes (8-bit data) |
126 | @arg @ref CRC_INPUTDATA_FORMAT_BYTES input data is a stream of bytes |
- | 127 | (8-bit data) |
|
120 | @arg @ref CRC_INPUTDATA_FORMAT_HALFWORDS input data is a stream of half-words (16-bit data) |
128 | @arg @ref CRC_INPUTDATA_FORMAT_HALFWORDS input data is a stream of |
- | 129 | half-words (16-bit data) |
|
121 | @arg @ref CRC_INPUTDATA_FORMAT_WORDS input data is a stream of words (32-bit data) |
130 | @arg @ref CRC_INPUTDATA_FORMAT_WORDS input data is a stream of words |
- | 131 | (32-bit data) |
|
122 | 132 | ||
123 | Note that constant CRC_INPUT_FORMAT_UNDEFINED is defined but an initialization error |
133 | Note that constant CRC_INPUT_FORMAT_UNDEFINED is defined but an initialization |
124 | must occur if InputBufferFormat is not one of the three values listed above */ |
134 | error must occur if InputBufferFormat is not one of the three values listed |
- | 135 | above */ |
|
125 | } CRC_HandleTypeDef; |
136 | } CRC_HandleTypeDef; |
126 | /** |
137 | /** |
127 | * @} |
138 | * @} |
128 | */ |
139 | */ |
129 | 140 | ||
Line 207... | Line 218... | ||
207 | #define CRC_INPUTDATA_FORMAT_WORDS 0x00000003U /*!< Input data in word format */ |
218 | #define CRC_INPUTDATA_FORMAT_WORDS 0x00000003U /*!< Input data in word format */ |
208 | /** |
219 | /** |
209 | * @} |
220 | * @} |
210 | */ |
221 | */ |
211 | 222 | ||
212 | /** @defgroup CRC_Aliases CRC API aliases |
- | |
213 | * @{ |
- | |
214 | */ |
- | |
215 | #define HAL_CRC_Input_Data_Reverse HAL_CRCEx_Input_Data_Reverse /*!< Aliased to HAL_CRCEx_Input_Data_Reverse for inter STM32 series compatibility */ |
- | |
216 | #define HAL_CRC_Output_Data_Reverse HAL_CRCEx_Output_Data_Reverse /*!< Aliased to HAL_CRCEx_Output_Data_Reverse for inter STM32 series compatibility */ |
- | |
217 | /** |
- | |
218 | * @} |
- | |
219 | */ |
- | |
220 | - | ||
221 | /** |
223 | /** |
222 | * @} |
224 | * @} |
223 | */ |
225 | */ |
224 | 226 | ||
225 | /* Exported macros -----------------------------------------------------------*/ |
227 | /* Exported macros -----------------------------------------------------------*/ |