00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _TPUD_H
00017 #define _TPUD_H
00018
00019 #define TPU_ILEVEL 0x4
00020 #define TCR1FREQ 1000000
00021 #define TCR2FREQ 1000000
00022
00023 int TPU_init();
00024 int TPU_makepwm(unsigned char nr);
00025 int TPU_initchannel(unsigned char nr);
00026 int TPU_setpwmperiod(unsigned char nr, unsigned short period);
00027 int TPU_setpwmdc(unsigned char nr, unsigned char hightime);
00028 int TPU_makepac(unsigned char nr);
00029 int TPU_makeqd(unsigned char ch1,unsigned char ch2);
00030 unsigned short TPU_getpac(unsigned char nr);
00031 short TPU_getqd(unsigned char nr);
00032 short TPU_readqd(unsigned char nr);
00033 int TPU_setisr(unsigned char ch, void (*isr) (void));
00034 int TPU_clearisr(unsigned char ch, void (*isr) (void));
00035 int TPU_makedio(unsigned char nr);
00036 int TPU_setdio(unsigned char nr, unsigned char v);
00037
00038
00039 #endif
00040