📄 s12_atd.h
字号:
//=============================================================================
// File: S12_ATD.H - V1.00
// Rem.: The ACPRD Project Page on the Web -> http://hc12web.de/acprd
//=============================================================================
#ifndef __S12_ATD_H
#define __S12_ATD_H
//-- ATD Bit Mask Definitions -------------------------------------------------
// Bits in ATDxCTL2:
#define BM_ADPU 0x80
#define BM_AFFC 0x40
#define BM_AWAI 0x20
#define BM_ETRIGLE 0x10
#define BM_ETRIGP 0x08
#define BM_ETRIGE 0x04
#define BM_ASCIE 0x02
#define BM_ASCIF 0x01
// Bits in ATDxCTL3:
//#define reserved 0x80
#define BM_S8C 0x40
#define BM_S4C 0x20
#define BM_S2C 0x10
#define BM_S1C 0x08
#define BM_FIFO 0x04
#define BM_FRZ1 0x02
#define BM_FRZ0 0x01
// Bits in ATDxCTL4:
#define BM_SRES8 0x80
#define BM_SMP1 0x40
#define BM_SMP0 0x20
#define BM_PRS4 0x10
#define BM_PRS3 0x08
#define BM_PRS2 0x04
#define BM_PRS1 0x02
#define BM_PRS0 0x01
// Bits in ATDxCTL5:
#define BM_DJM 0x80
#define BM_DSGM 0x40
#define BM_SCAN 0x20
#define BM_MULT 0x10
//#define reserved 0x08
#define BM_CC 0x04
#define BM_CB 0x02
#define BM_CA 0x01
// Bits in ATDxSTAT0:
#define BM_SCF 0x80
//#define reserved 0x40
#define BM_ETORF 0x20
#define BM_FIFOR 0x10
//#define reserved 0x08
#define BM_CC2 0x04
#define BM_CC1 0x02
#define BM_CC0 0x01
//-- Defines ------------------------------------------------------------------
// number of ATD channels used (starting with channel 0)
#define ATD_MAX_CHANNELS 8
// number of values for average calculation
#define ATD_AVERAGE_COUNT 10
//-- Function Prototypes ------------------------------------------------------
void initATD0(void);
UINT16 getATD0(UINT8 channel);
void startATD0(void);
BOOL readATD0(UINT16 *results);
void handleATD0(UINT16 *buf);
#endif //__S12_ATD_H ==========================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -