]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad/driverlib/MSP430FR5xx_6xx/crc.h
Change some data types in heap_4.c to allow it to be used on hardware that has 16...
[freertos] / FreeRTOS / Demo / MSP430X_MSP430FR5969_LaunchPad / driverlib / MSP430FR5xx_6xx / crc.h
1 /* --COPYRIGHT--,BSD\r
2  * Copyright (c) 2014, Texas Instruments Incorporated\r
3  * All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  *\r
9  * *  Redistributions of source code must retain the above copyright\r
10  *    notice, this list of conditions and the following disclaimer.\r
11  *\r
12  * *  Redistributions in binary form must reproduce the above copyright\r
13  *    notice, this list of conditions and the following disclaimer in the\r
14  *    documentation and/or other materials provided with the distribution.\r
15  *\r
16  * *  Neither the name of Texas Instruments Incorporated nor the names of\r
17  *    its contributors may be used to endorse or promote products derived\r
18  *    from this software without specific prior written permission.\r
19  *\r
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31  * --/COPYRIGHT--*/\r
32 //*****************************************************************************\r
33 //\r
34 // crc.h - Driver for the CRC Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_CRC_H__\r
39 #define __MSP430WARE_CRC_H__\r
40 \r
41 #include "inc/hw_memmap.h"\r
42 \r
43 #ifdef __MSP430_HAS_CRC__\r
44 \r
45 //*****************************************************************************\r
46 //\r
47 // If building with a C++ compiler, make all of the definitions in this header\r
48 // have a C binding.\r
49 //\r
50 //*****************************************************************************\r
51 #ifdef __cplusplus\r
52 extern "C"\r
53 {\r
54 #endif\r
55 \r
56 //*****************************************************************************\r
57 //\r
58 // Prototypes for the APIs.\r
59 //\r
60 //*****************************************************************************\r
61 \r
62 //*****************************************************************************\r
63 //\r
64 //! \brief Sets the seed for the CRC.\r
65 //!\r
66 //! This function sets the seed for the CRC to begin generating a signature\r
67 //! with the given seed and all passed data. Using this function resets the CRC\r
68 //! signature.\r
69 //!\r
70 //! \param baseAddress is the base address of the CRC module.\r
71 //! \param seed is the seed for the CRC to start generating a signature from.\r
72 //!        \n Modified bits are \b CRCINIRES of \b CRCINIRES register.\r
73 //!\r
74 //! \return None\r
75 //\r
76 //*****************************************************************************\r
77 extern void CRC_setSeed(uint16_t baseAddress,\r
78                         uint16_t seed);\r
79 \r
80 //*****************************************************************************\r
81 //\r
82 //! \brief Sets the 16 bit data to add into the CRC module to generate a new\r
83 //! signature.\r
84 //!\r
85 //! This function sets the given data into the CRC module to generate the new\r
86 //! signature from the current signature and new data.\r
87 //!\r
88 //! \param baseAddress is the base address of the CRC module.\r
89 //! \param dataIn is the data to be added, through the CRC module, to the\r
90 //!        signature.\r
91 //!        \n Modified bits are \b CRCDI of \b CRCDI register.\r
92 //!\r
93 //! \return None\r
94 //\r
95 //*****************************************************************************\r
96 extern void CRC_set16BitData(uint16_t baseAddress,\r
97                              uint16_t dataIn);\r
98 \r
99 //*****************************************************************************\r
100 //\r
101 //! \brief Sets the 8 bit data to add into the CRC module to generate a new\r
102 //! signature.\r
103 //!\r
104 //! This function sets the given data into the CRC module to generate the new\r
105 //! signature from the current signature and new data.\r
106 //!\r
107 //! \param baseAddress is the base address of the CRC module.\r
108 //! \param dataIn is the data to be added, through the CRC module, to the\r
109 //!        signature.\r
110 //!        \n Modified bits are \b CRCDI of \b CRCDI register.\r
111 //!\r
112 //! \return None\r
113 //\r
114 //*****************************************************************************\r
115 extern void CRC_set8BitData(uint16_t baseAddress,\r
116                             uint8_t dataIn);\r
117 \r
118 //*****************************************************************************\r
119 //\r
120 //! \brief Translates the 16 bit data by reversing the bits in each byte and\r
121 //! then sets this data to add into the CRC module to generate a new signature.\r
122 //!\r
123 //! This function first reverses the bits in each byte of the data and then\r
124 //! generates the new signature from the current signature and new translated\r
125 //! data.\r
126 //!\r
127 //! \param baseAddress is the base address of the CRC module.\r
128 //! \param dataIn is the data to be added, through the CRC module, to the\r
129 //!        signature.\r
130 //!        \n Modified bits are \b CRCDIRB of \b CRCDIRB register.\r
131 //!\r
132 //! \return None\r
133 //\r
134 //*****************************************************************************\r
135 extern void CRC_set16BitDataReversed(uint16_t baseAddress,\r
136                                      uint16_t dataIn);\r
137 \r
138 //*****************************************************************************\r
139 //\r
140 //! \brief Translates the 8 bit data by reversing the bits in each byte and\r
141 //! then sets this data to add into the CRC module to generate a new signature.\r
142 //!\r
143 //! This function first reverses the bits in each byte of the data and then\r
144 //! generates the new signature from the current signature and new translated\r
145 //! data.\r
146 //!\r
147 //! \param baseAddress is the base address of the CRC module.\r
148 //! \param dataIn is the data to be added, through the CRC module, to the\r
149 //!        signature.\r
150 //!        \n Modified bits are \b CRCDIRB of \b CRCDIRB register.\r
151 //!\r
152 //! \return None\r
153 //\r
154 //*****************************************************************************\r
155 extern void CRC_set8BitDataReversed(uint16_t baseAddress,\r
156                                     uint8_t dataIn);\r
157 \r
158 //*****************************************************************************\r
159 //\r
160 //! \brief Returns the value currently in the Data register.\r
161 //!\r
162 //! This function returns the value currently in the data register. If set in\r
163 //! byte bits reversed format, then the translated data would be returned.\r
164 //!\r
165 //! \param baseAddress is the base address of the CRC module.\r
166 //!\r
167 //! \return The value currently in the data register\r
168 //\r
169 //*****************************************************************************\r
170 extern uint16_t CRC_getData(uint16_t baseAddress);\r
171 \r
172 //*****************************************************************************\r
173 //\r
174 //! \brief Returns the value pf the Signature Result.\r
175 //!\r
176 //! This function returns the value of the signature result generated by the\r
177 //! CRC.\r
178 //!\r
179 //! \param baseAddress is the base address of the CRC module.\r
180 //!\r
181 //! \return The value currently in the data register\r
182 //\r
183 //*****************************************************************************\r
184 extern uint16_t CRC_getResult(uint16_t baseAddress);\r
185 \r
186 //*****************************************************************************\r
187 //\r
188 //! \brief Returns the bit-wise reversed format of the Signature Result.\r
189 //!\r
190 //! This function returns the bit-wise reversed format of the Signature Result.\r
191 //!\r
192 //! \param baseAddress is the base address of the CRC module.\r
193 //!\r
194 //! \return The bit-wise reversed format of the Signature Result\r
195 //\r
196 //*****************************************************************************\r
197 extern uint16_t CRC_getResultBitsReversed(uint16_t baseAddress);\r
198 \r
199 //*****************************************************************************\r
200 //\r
201 // Mark the end of the C bindings section for C++ compilers.\r
202 //\r
203 //*****************************************************************************\r
204 #ifdef __cplusplus\r
205 }\r
206 #endif\r
207 \r
208 #endif\r
209 #endif // __MSP430WARE_CRC_H__\r