This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How Read and Write Registers

Hi everybody:

I will be developing the functionality of the ADC on dm365.

I Need to know how we can read and write in the register of microprocessor dm365.

The  function for the ADC is:

int Read_ADC(unsigned int channel){


   if (channel >= ADC_MAX_CHANNELS){
             return -1;
        }

   //select channel
   iowrite32(1 << channel,dm365_adc_base + DM365_ADC_CHSEL);

   //start coversion
   iowrite32(DM365_ADC_ADCTL_BIT_START,dm365_adc_base + DM365_ADC_ADCTL);

   // Wait for conversion to start
   while (!(ioread32(dm365_adc_base + DM365_ADC_ADCTL) & DM365_ADC_ADCTL_BIT_BUSY)){
        usleep(10);
   }

   // Wait for conversion to be complete.
   while ((ioread32(dm365_adc_base + DM365_ADC_ADCTL) & DM365_ADC_ADCTL_BIT_BUSY)){
        usleep(10);
   }

   return ioread32(dm365_adc_base + DM365_ADC_AD0DAT + 4 * channel);

}

We need to know  the equivalent functions of iowrite32() and ioread32() on the example IPNC 0.6, or the libraries to access to the registers

Thank you very much