3 * adcsetch - select convertion channel
5 * written by Vangelis Rokas, 2004 <vrokas AT otenet.gr>
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 #include <pic18fregs.h>
33 void adc_setchannel(unsigned char channel) __naked
36 #if defined(__SDCC_ADC_STYLE2455)
37 ADCON0 &= ~(0xf << 2);
38 ADCON0 |= channel << 2;
39 #else /* all other devices */
40 ADCON0 &= ~(0x7 << 3);
41 ADCON0 |= channel << 3;
47 #if defined(__SDCC_ADC_STYLE2455)
49 #else /* all other devices */
56 #if defined(__SDCC_ADC_STYLE2455)
57 #else /* all other devices */