📄 lib_lpc_ad.h
字号:
/*
***********************************************************************
Embest Info&Tech Co., Ltd. All rights reserved.
www.embedinfo.com
***********************************************************************
---------------- file information -------------------------------------
file name: lib_lpc_ad.h
version : v0
author : zhangxuquan
peter pan / panqan@hotmail.com
panqian@embedinfo.com
begin : 2006-02-10
finish : 2006-02-10
define : lpc ad convert lib head file
notes :
---------------- modify information -----------------------------------
version :
modify :
begin :
finish :
define :
-----------------------------------------------------------------------
*/
// (--------------------- compiler condition --------------------------
#ifndef lpc_lib_AD
#define lpc_lib_AD
// --------------------- compiler condition --------------------------)
/*-------------------------------------------------------------------*/
/* include files */
/*---------------------------------------------------------------- --*/
#include "..\..\..\com\type_redefine.h"
#include "..\..\..\com\register_lpc22xx.h"
#include "..\..\..\com\lib_lpc\lib_lpc_pll\lib_lpc_pll.h"
/*
#include "..\..\..\com\lib_22eb06\module_control\lib_22eb06_mc.h"
*/
/*-------------------------------------------------------------------*/
/* variable define */
/*-------------------------------------------------------------------*/
//define the control value for pinsel
#define P2_30_31_AIN_4_5_PINSEL2_V (0x01<<4)
#define P3_28_29_AIN_6_7_PINSEL2_V (0x01<<4)
#define P2_30_31_AIN_4_5_PINSEL2_M (0x3<<4)
#define P3_28_29_AIN_6_7_PINSEL2_M (0x3<<4)
//control by one data
#define P3_29_AIN_6_PINSEL2_V (0x1<<6)
#define P3_28_AIN_7_PINSEL2_V (0x1<<7)
#define P3_29_AIN_6_PINSEL2_M (0x1<<6)
#define P3_28_AIN_7_PINSEL2_M (0x1<<7)
#define P2_30_AIN_4_PINSEL2_V (0x1<<21)
#define P2_31_AIN_5_PINSEL2_V (0x1<<22)
#define P2_30_AIN_4_PINSEL2_M (0x1<<21)
#define P2_31_AIN_5_PINSEL2_M (0x1<<22)
//define the value for ad part
#define SEL_DEFAULT (0x1)
#define SEL_AIN4 (0x1<<4)
#define SEL_AIN5 (0x1<<5)
#define SEL_AIN6 (0x1<<6)
#define SEL_AIN7 (0x1<<7)
#define CHG_F 4500000
#define CLKDIV ((PCLKF/CHG_F)<<8)
#define BURST_A (0x1<<16)
#define BURST_F (0x0<<16)
#define CLKS_0 (0x0)
#define PDN_N (0x1<<21)
#define PDN_U (0x0)
#define TEST_0 (0x0)
#define START_0 (0x0)
#define START_A (0x1<<24)
#define START_CAP0_0 (0x3<<24)
#define START_CAP0_2 (0x2<<24)
#define START_MAT0_1 (0x4<<24)
#define START_MAT0_3 (0x5<<24)
#define START_MAT1_0 (0x6<<24)
#define START_MAT1_1 (0x7<<24)
#define DATA_MASK (0xFFC0)
typedef enum{
AIN0=0,
AIN1,
AIN2,
AIN3,
AIN4,
AIN5,
AIN6,
AIN7 } AD_channel;
typedef enum{ CAP0_0,
CAP0_2,
MAT0_1,
MAT0_3,
MAT1_0,
MAT1_1} AD_trigger_mode;
/*-------------------------------------------------------------------*/
/* local function declare */
/*-------------------------------------------------------------------*/
void port_toad_en(AD_channel AD_channel_v);
INT32U AD_read(void);
void AD_close();
void AD_init(INT8U Chg_mode,AD_channel ad_ch,AD_trigger_mode tri_mode,INT8U edge);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -