]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_SmartFusion2_M2S050_SoftConsole/RTOSDemo_Hardware_Platform/hal/hw_reg_access.h
Add missing +TCP code.
[freertos] / FreeRTOS / Demo / CORTEX_SmartFusion2_M2S050_SoftConsole / RTOSDemo_Hardware_Platform / hal / hw_reg_access.h
1 /***************************************************************************//**\r
2  * (c) Copyright 2007-2013 Microsemi SoC Products Group. All rights reserved.\r
3  * \r
4  * Hardware registers access functions.\r
5  * The implementation of these function is platform and toolchain specific.\r
6  * The functions declared here are implemented using assembler as part of the \r
7  * processor/toolchain specific HAL.\r
8  * \r
9  * SVN $Revision: 5258 $\r
10  * SVN $Date: 2013-03-21 12:41:02 +0000 (Thu, 21 Mar 2013) $\r
11  */\r
12 #ifndef HW_REG_ACCESS\r
13 #define HW_REG_ACCESS\r
14 \r
15 /***************************************************************************//**\r
16  * HW_set_32bit_reg is used to write the content of a 32 bits wide peripheral\r
17  * register.\r
18  * \r
19  * @param reg_addr  Address in the processor's memory map of the register to\r
20  *                  write.\r
21  * @param value     Value to be written into the peripheral register.\r
22  */\r
23 void\r
24 HW_set_32bit_reg\r
25 (\r
26         addr_t reg_addr,\r
27         uint32_t value\r
28 );\r
29 \r
30 /***************************************************************************//**\r
31  * HW_get_32bit_reg is used to read the content of a 32 bits wide peripheral\r
32  * register.\r
33  * \r
34  * @param reg_addr  Address in the processor's memory map of the register to\r
35  *                  read.\r
36  * @return          32 bits value read from the peripheral register.\r
37  */\r
38 uint32_t\r
39 HW_get_32bit_reg\r
40 (\r
41         addr_t reg_addr\r
42 );\r
43 \r
44 /***************************************************************************//**\r
45  * HW_set_32bit_reg_field is used to set the content of a field in a 32 bits \r
46  * wide peripheral register.\r
47  * \r
48  * @param reg_addr  Address in the processor's memory map of the register to\r
49  *                  be written.\r
50  * @param shift     Bit offset of the register field to be read within the \r
51  *                  register.\r
52  * @param mask      Bit mask to be applied to the raw register value to filter\r
53  *                  out the other register fields values.\r
54  * @param value     Value to be written in the specified field.\r
55  */\r
56 void\r
57 HW_set_32bit_reg_field\r
58 (\r
59     addr_t reg_addr,\r
60     int_fast8_t shift,\r
61     uint32_t mask,\r
62     uint32_t value\r
63 );\r
64 \r
65 /***************************************************************************//**\r
66  * HW_get_32bit_reg_field is used to read the content of a field out of a \r
67  * 32 bits wide peripheral register.\r
68  * \r
69  * @param reg_addr  Address in the processor's memory map of the register to\r
70  *                  read.\r
71  * @param shift     Bit offset of the register field to be written within the \r
72  *                  register.\r
73  * @param mask      Bit mask to be applied to the raw register value to filter\r
74  *                  out the other register fields values.\r
75  *\r
76  * @return          32 bits value containing the register field value specified\r
77  *                  as parameter.\r
78  */\r
79 uint32_t \r
80 HW_get_32bit_reg_field\r
81 (\r
82     addr_t reg_addr,\r
83     int_fast8_t shift,\r
84     uint32_t mask\r
85 );\r
86 \r
87 /***************************************************************************//**\r
88  * HW_set_16bit_reg is used to write the content of a 16 bits wide peripheral\r
89  * register.\r
90  * \r
91  * @param reg_addr  Address in the processor's memory map of the register to\r
92  *                  write.\r
93  * @param value     Value to be written into the peripheral register.\r
94  */\r
95 void\r
96 HW_set_16bit_reg\r
97 (\r
98         addr_t reg_addr,\r
99         uint_fast16_t value\r
100 );\r
101 \r
102 /***************************************************************************//**\r
103  * HW_get_16bit_reg is used to read the content of a 16 bits wide peripheral\r
104  * register.\r
105  * \r
106  * @param reg_addr  Address in the processor's memory map of the register to\r
107  *                  read.\r
108  * @return          16 bits value read from the peripheral register.\r
109  */\r
110 uint16_t\r
111 HW_get_16bit_reg\r
112 (\r
113         addr_t reg_addr\r
114 );\r
115 \r
116 /***************************************************************************//**\r
117  * HW_set_16bit_reg_field is used to set the content of a field in a 16 bits \r
118  * wide peripheral register.\r
119  * \r
120  * @param reg_addr  Address in the processor's memory map of the register to\r
121  *                  be written.\r
122  * @param shift     Bit offset of the register field to be read within the \r
123  *                  register.\r
124  * @param mask      Bit mask to be applied to the raw register value to filter\r
125  *                  out the other register fields values.\r
126  * @param value     Value to be written in the specified field.\r
127  */\r
128 void HW_set_16bit_reg_field\r
129 (\r
130     addr_t reg_addr,\r
131     int_fast8_t shift,\r
132     uint_fast16_t mask,\r
133     uint_fast16_t value\r
134 );\r
135 \r
136 /***************************************************************************//**\r
137  * HW_get_16bit_reg_field is used to read the content of a field from a \r
138  * 16 bits wide peripheral register.\r
139  * \r
140  * @param reg_addr  Address in the processor's memory map of the register to\r
141  *                  read.\r
142  * @param shift     Bit offset of the register field to be written within the \r
143  *                  register.\r
144  * @param mask      Bit mask to be applied to the raw register value to filter\r
145  *                  out the other register fields values.\r
146  *\r
147  * @return          16 bits value containing the register field value specified\r
148  *                  as parameter.\r
149  */\r
150 uint16_t HW_get_16bit_reg_field\r
151 (\r
152     addr_t reg_addr,\r
153     int_fast8_t shift,\r
154     uint_fast16_t mask\r
155 );\r
156 \r
157 /***************************************************************************//**\r
158  * HW_set_8bit_reg is used to write the content of a 8 bits wide peripheral\r
159  * register.\r
160  * \r
161  * @param reg_addr  Address in the processor's memory map of the register to\r
162  *                  write.\r
163  * @param value     Value to be written into the peripheral register.\r
164  */\r
165 void\r
166 HW_set_8bit_reg\r
167 (\r
168         addr_t reg_addr,\r
169         uint_fast8_t value\r
170 );\r
171 \r
172 /***************************************************************************//**\r
173  * HW_get_8bit_reg is used to read the content of a 8 bits wide peripheral\r
174  * register.\r
175  * \r
176  * @param reg_addr  Address in the processor's memory map of the register to\r
177  *                  read.\r
178  * @return          8 bits value read from the peripheral register.\r
179  */\r
180 uint8_t\r
181 HW_get_8bit_reg\r
182 (\r
183     addr_t reg_addr\r
184 );\r
185 \r
186 /***************************************************************************//**\r
187  * HW_set_8bit_reg_field is used to set the content of a field in a 8 bits \r
188  * wide peripheral register.\r
189  * \r
190  * @param reg_addr  Address in the processor's memory map of the register to\r
191  *                  be written.\r
192  * @param shift     Bit offset of the register field to be read within the \r
193  *                  register.\r
194  * @param mask      Bit mask to be applied to the raw register value to filter\r
195  *                  out the other register fields values.\r
196  * @param value     Value to be written in the specified field.\r
197  */\r
198 void HW_set_8bit_reg_field\r
199 (\r
200     addr_t reg_addr,\r
201     int_fast8_t shift,\r
202     uint_fast8_t mask,\r
203     uint_fast8_t value\r
204 );\r
205 \r
206 /***************************************************************************//**\r
207  * HW_get_8bit_reg_field is used to read the content of a field from a \r
208  * 8 bits wide peripheral register.\r
209  * \r
210  * @param reg_addr  Address in the processor's memory map of the register to\r
211  *                  read.\r
212  * @param shift     Bit offset of the register field to be written within the \r
213  *                  register.\r
214  * @param mask      Bit mask to be applied to the raw register value to filter\r
215  *                  out the other register fields values.\r
216  *\r
217  * @return          16 bits value containing the register field value specified\r
218  *                  as parameter.\r
219  */\r
220 uint8_t HW_get_8bit_reg_field\r
221 (\r
222     addr_t reg_addr,\r
223     int_fast8_t shift,\r
224     uint_fast8_t mask\r
225 );\r
226 \r
227 #endif /* HW_REG_ACCESS */\r