Hi everybody:

Ie will be developing the functionality of the ADC on LeopardBoard 365.

Need to know how we can read and write in the register of 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

Thank you very much