00001 /************************************************************************************************** 00002 Title : PIC24F Series ADC Driver 00003 Programmer : Yosuke FURUSAWA. 00004 Copyright : Copyright (C) 2008-2010 Yosuke FURUSAWA. 00005 License : 4-clause BSD License 00006 Since : 2008/12/10 00007 00008 Filename : libadc.h 00009 Last up date : 2010/08/13 00010 Kanji-Code : Shift-JIS 00011 TAB Space : 4 00012 **************************************************************************************************/ 00013 00014 00015 #ifndef _LIBADC_H_ 00016 #define _LIBADC_H_ 00017 00018 00019 /*================================================================================================ 00020 マクロ定義 00021 =================================================================================================*/ 00022 #define ADC_LOWMEM 00023 00024 #define ADC_MAX 3 00025 00026 00027 /*================================================================================================ 00028 構造体 00029 =================================================================================================*/ 00030 typedef struct ADC { 00031 int adc[ ADC_MAX]; /* PIC内蔵 ADC */ 00032 00033 #ifndef ADC_LOWMEM 00034 unsigned int last; /* 最後に実行した時刻 */ 00035 unsigned int cycle; /* 実行周期 */ 00036 #endif 00037 00038 } ADC_T; 00039 typedef ADC_T* pADC_T; 00040 00041 00042 /*================================================================================================= 00043 グローバル変数 00044 =================================================================================================*/ 00045 extern ADC_T adc; 00046 00047 00048 /*================================================================================================ 00049 プロトタイプ宣言 00050 =================================================================================================*/ 00051 extern void ADC_init(void); 00052 00053 00054 #endif