LPC2132 read AD ports

hello, i am new here and asking for help to do this:
i use an LPC2132 and need to read the output of an analog sensor that gives 0,3v-3,2v and on other AD port read the voltage of an 12v battery, the only thing that i know is that i have to make an voltage divider for the bat.
can anyone help me with some example to result in a function like "volts=read_ad(port_x)"
thanks in advance for your help

More questions in this forum