Skip to content

Commit b3de741

Browse files
committed
docs/user_guide: Update axi adc regmap info
Signed-off-by: Stanca Pop <stanca.pop@analog.com>
1 parent 28e268c commit b3de741

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

docs/user_guide/ip_cores/axi_adc/index.rst

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Files
3333
* - :git-hdl:`library/common/up_adc_channel.v`
3434
- Verilog source for the ADC Channel regmap.
3535

36-
3736
Architecture
3837
--------------------------------------------------------------------------------
3938

@@ -219,6 +218,60 @@ see :ref:`axi_adc adc-channel` section.
219218
To find the instantiation of this module search for ``up_adc_channel`` inside
220219
the IP's directory.
221220

221+
.. _generic-adc-register-access:
222+
223+
Register access
224+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
225+
226+
The ADC IP supports **16 channels**, numbered from **0 to 15**. The **base
227+
registers** start at offset ``0x0`` and the **common (global) registers** start
228+
at address ``0x10``. Each **channel** has its own register block, starting from
229+
address ``0x100`` (for channel 0). Each subsequent channel is spaced by ``0x10``
230+
(HDL register address) or ``0x40`` (Software addressing).
231+
232+
Let's say the ADC IP base address is 0x44A0_0000. Here is how the channel offset
233+
is computed:
234+
235+
.. math::
236+
237+
\text{HDL}_{reg} = 0x100 + (n \times 0x10) \\
238+
239+
.. math::
240+
241+
\text{Software}_{addr} = IP_BaseAddr + (\text{HDL}_{reg} << 2) = 0x44A0\_0000 + 0x400 + (n \times 0x40)
242+
243+
This means the first register's address ( **``CHAN_CNTRL``**) is:
244+
245+
- For **channel 0**:
246+
247+
- ``0x0100`` (HDL register)=> ``0x44A0_0400`` (Software addressing)
248+
249+
- For **channel 3**:
250+
251+
- ``0x0130`` (HDL register) => ``0x44A0_04C0`` (Software addressing)
252+
- For **channel 15**:
253+
254+
- ``0x01F0`` (HDL register) => ``0x44A0_07C0`` (Software addressing)
255+
256+
If you want to access the **``CHAN_CNTRL_3``** register, its address is:
257+
258+
- For **channel 0**:
259+
260+
- ``0x0106`` (HDL register) => ``0x44A6_0418`` (Software addressing)
261+
262+
- For **channel 5**:
263+
264+
- ``0x0156`` (HDL register) => ``0x44A6_0558`` (Software addressing)
265+
In general, the address for the ``CHAN_CNTRL_3`` register of **channel *n*** can be calculated as:
266+
267+
.. math::
268+
269+
\text{HDL}_{reg} = 0x100 + (n \times 0x10) + 0x06 \\
270+
271+
.. math::
272+
273+
\text{Software}_{addr} = IP_base_addr + 0x400 + (n \times 0x40) + 0x18
274+
222275
Typical Register Map base addresses
223276
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
224277

0 commit comments

Comments
 (0)