Post Go back to editing

No-OS SW Reference design(AD9361) for Zedboard+AD-FMCOMMS2

Hi,all:

       I got the No-OS SW reference design from website. in the function adc_capture() of "adc_core.c" file.

======================================

adc_dma_read(AXI_DMAC_REG_IRQ_PENDING, &reg_val);
adc_dma_write(AXI_DMAC_REG_IRQ_PENDING, reg_val);

==========================================

my question is:

     why it reads value from register into reg_val and then immediately write reg_val to register.

is register value  always equal to reg_val before reg_val written back to the register? if yes,why reg_val needs to be written back to the register.  if no, in what cases they are different.

thanks,

gan

Parents
  • Hi Dragos,

    Thank you for your reply, I am still confused.

    Since the bits which are set are already 0x01, why we still need the code(adc_dma_write(AXI_DMAC_REG_IRQ_PENDING, reg_val) to set them to 0x01?

    and why do you mean by “write 0x01 to clear a specific bit from the AXI_DMAC_REG_IRQ_PENDING register.”?

    yours,

    gan

Reply
  • Hi Dragos,

    Thank you for your reply, I am still confused.

    Since the bits which are set are already 0x01, why we still need the code(adc_dma_write(AXI_DMAC_REG_IRQ_PENDING, reg_val) to set them to 0x01?

    and why do you mean by “write 0x01 to clear a specific bit from the AXI_DMAC_REG_IRQ_PENDING register.”?

    yours,

    gan

Children
No Data