Skip to content

Commit 33055cb

Browse files
committed
docs/axi_adc: Add regmap addressing examples
Signed-off-by: Stanca Pop <stanca.pop@analog.com>
1 parent 28e268c commit 33055cb

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

docs/user_guide/ip_cores/axi_adc/index.rst

Lines changed: 45 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,51 @@ 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+
Register access
222+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
223+
224+
The ADC IP supports **16 channels**, numbered from **0 to 15**. The **base
225+
registers** start at offset ``0x0`` and the **common (global) registers** start
226+
at offset ``0x10``. Each **channel** has its own register block, starting from
227+
offset ``0x100`` (for channel 0). Each subsequent channel is spaced by ``0x10``
228+
(HDL addressing) or ``0x40`` (WORD aligned).
229+
230+
Let's say the ADC IP base address is 0x44A0_0000. Here is how the channel offset
231+
is computed:
232+
233+
.. math::
234+
235+
\text{Address}_{HDL} = 0x44A0\_0000 + 0x100 + (n \times 0x10) \\
236+
\text{Address}_{WORD} = 0x44A0\_0000 + 0x400 + (n \times 0x40)
237+
238+
This means the first register's address ( **``CHAN_CNTRL``**) is:
239+
240+
- For **channel 0**:
241+
- ``0x44A0_0100`` (HDL addressing)
242+
- ``0x44A0_0400`` (WORD aligned addressing)
243+
- For **channel 3**:
244+
- ``0x44A0_0140`` (HDL addressing)
245+
- ``0x44A0_0500`` (WORD aligned addressing)
246+
- For **channel 15**:
247+
- ``0x44A0_01F0`` (HDL addressing)
248+
- ``0x44A0_07C0`` (WORD aligned addressing)
249+
250+
If you want to access the **``CHAN_CNTRL_3``** register, its address is:
251+
252+
- For **channel 0**:
253+
- ``0x44A6_0106`` (HDL addressing)
254+
- ``0x44A6_0418`` (WORD aligned addressing)
255+
- For **channel 5**:
256+
- ``0x44A6_0156`` (HDL addressing)
257+
- ``0x44A6_0558`` (WORD aligned addressing)
258+
259+
In general, the address for the ``CHAN_CNTRL_3`` register of **channel *n*** can be calculated as:
260+
261+
.. math::
262+
263+
\text{Address}_{HDL} = 0x44A6\_0000 + 0x100 + (n \times 0x10) + 0x06 \\
264+
\text{Address}_{WORD} = 0x44A6\_0000 + 0x400 + (n \times 0x40) + 0x18
265+
222266
Typical Register Map base addresses
223267
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
224268

0 commit comments

Comments
 (0)