1 /***************************************************************************//**
\r
2 * (c) Copyright 2007-2013 Microsemi SoC Products Group. All rights reserved.
\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
9 * SVN $Revision: 5258 $
\r
10 * SVN $Date: 2013-03-21 12:41:02 +0000 (Thu, 21 Mar 2013) $
\r
12 #ifndef HW_REG_ACCESS
\r
13 #define HW_REG_ACCESS
\r
15 /***************************************************************************//**
\r
16 * HW_set_32bit_reg is used to write the content of a 32 bits wide peripheral
\r
19 * @param reg_addr Address in the processor's memory map of the register to
\r
21 * @param value Value to be written into the peripheral register.
\r
30 /***************************************************************************//**
\r
31 * HW_get_32bit_reg is used to read the content of a 32 bits wide peripheral
\r
34 * @param reg_addr Address in the processor's memory map of the register to
\r
36 * @return 32 bits value read from the peripheral register.
\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
48 * @param reg_addr Address in the processor's memory map of the register to
\r
50 * @param shift Bit offset of the register field to be read within the
\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
57 HW_set_32bit_reg_field
\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
69 * @param reg_addr Address in the processor's memory map of the register to
\r
71 * @param shift Bit offset of the register field to be written within the
\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
76 * @return 32 bits value containing the register field value specified
\r
80 HW_get_32bit_reg_field
\r
87 /***************************************************************************//**
\r
88 * HW_set_16bit_reg is used to write the content of a 16 bits wide peripheral
\r
91 * @param reg_addr Address in the processor's memory map of the register to
\r
93 * @param value Value to be written into the peripheral register.
\r
102 /***************************************************************************//**
\r
103 * HW_get_16bit_reg is used to read the content of a 16 bits wide peripheral
\r
106 * @param reg_addr Address in the processor's memory map of the register to
\r
108 * @return 16 bits value read from the peripheral register.
\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
120 * @param reg_addr Address in the processor's memory map of the register to
\r
122 * @param shift Bit offset of the register field to be read within the
\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
128 void HW_set_16bit_reg_field
\r
132 uint_fast16_t mask,
\r
133 uint_fast16_t value
\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
140 * @param reg_addr Address in the processor's memory map of the register to
\r
142 * @param shift Bit offset of the register field to be written within the
\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
147 * @return 16 bits value containing the register field value specified
\r
150 uint16_t HW_get_16bit_reg_field
\r
157 /***************************************************************************//**
\r
158 * HW_set_8bit_reg is used to write the content of a 8 bits wide peripheral
\r
161 * @param reg_addr Address in the processor's memory map of the register to
\r
163 * @param value Value to be written into the peripheral register.
\r
172 /***************************************************************************//**
\r
173 * HW_get_8bit_reg is used to read the content of a 8 bits wide peripheral
\r
176 * @param reg_addr Address in the processor's memory map of the register to
\r
178 * @return 8 bits value read from the peripheral register.
\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
190 * @param reg_addr Address in the processor's memory map of the register to
\r
192 * @param shift Bit offset of the register field to be read within the
\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
198 void HW_set_8bit_reg_field
\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
210 * @param reg_addr Address in the processor's memory map of the register to
\r
212 * @param shift Bit offset of the register field to be written within the
\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
217 * @return 16 bits value containing the register field value specified
\r
220 uint8_t HW_get_8bit_reg_field
\r
227 #endif /* HW_REG_ACCESS */
\r