00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _AD_H_
00009 #define _AD_H_
00010 #include "GNU_defs.h"
00011
00012
00013 #define HI_RES 1
00014 #define LO_RES 0
00015
00016
00017 #define ONCE 0
00018
00019
00020 #define NUMCHANNELS 8
00021
00022
00023 #define ADSELECT 0x02
00024
00025
00026
00027 #define MSBF 0x04
00028 #define UNIP 0x08
00029 #define BIT8 0
00030 #define POFF 1
00031 #define BIT12 2
00032 #define BIT16 3
00033
00034 #define LTC_CONTROL PORTK
00035 #define LTC_CONFIG DDRK
00036
00037 #define LTC_CS 0x08
00038
00039 #define LTCCS_OFF() LTC_CONTROL|=LTC_CS
00040 #define LTCCS_ON() LTC_CONTROL&=(~LTC_CS)
00041
00042 #define LTC_INIT_LINES() {LTC_CONFIG|=LTC_CS;LTCCS_OFF();}
00043
00044
00045 typedef struct AtoDsample{
00046 unsigned int channel[NUMCHANNELS];
00047 }AtoDsample;
00048
00049
00050
00051 int __attribute__((far))LTC1290Init(void);
00052 void __attribute__((far))Select1290(u8 status);
00053 int __attribute__((far))LTC1290_Read(AtoDsample *sample);
00054
00055 #endif
00056