/* Init ADC module This function can be used to configure ADC peripherals clock frequecy.  */
void ADCInit(unsigned long ulBase, unsigned long ulRate)
/* Init ADC module This function can be used to configure ADC peripherals clock frequecy.  */
void ADCInit(unsigned long ulBase, unsigned long ulRate)
{
    unsigned long temp    = 0;
    unsigned long ulClk   = 0;
    xHWREG(ulBase + AD_CR) = 0;
    ulClk = SysCtlPeripheralClockGet(SYSCTL_PERIPH_ADC);
    temp = ulRate * 65;
    temp = (ulClk * 2 + temp)/(2 * temp) - 1;
    xHWREG(ulBase + AD_CR) = (temp<<CR_CLKDIV_S) | BIT_32_0;
}