#ifndef _PERIPHERALS_H
#define _PERIPHERALS_H

#include "M68HC11A8.h"

#define CONT_M 0x30 //continuous conversion with multiple channels
#define CONT_S 0x20 //continuous conversion with single channel
#define LIM_M  0x10 //limited (4) conversion with multiple channels
#define LIM_S  0x00 //limited (4) conversion with single channel

#define RC     0xc0 //Use internal RC clock
#define E      0x80 //use external E clock

#define CH0    0x00 //Select Channel 0
#define CH1    0x01 //Select Channel 1
#define CH2    0x02 //Select Channel 2
#define CH3    0x03 //Select Channel 3
#define CH4    0x04 //Select Channel 4
#define CH5    0x05 //Select Channel 5
#define CH6    0x06 //Select Channel 6
#define CH7    0x07 //Select Channel 7

void initADC(uint8 m, uint8 clk, uint8 ch)
   {
    OPTION |= clk;
    ADCTL = m|ch;
    }

#endif
