📄 sam9261_touch.h
字号:
/**************************************************************
Touch Panel header file
/*************************************************************/
#ifndef SAM9261_TOUCH_H_H_H_
#define SAM9261_TOUCH_H_H_H_
//-------------------------------------------------------------
// condition compile definition
//-------------------------------------------------------------
#define TouchNeedTimer
//-------------------------------------------------------------
// constant definition
//-------------------------------------------------------------
#define IRQ_PIOIRQ AT91C_ID_PIOC
#define IRQ_TIMER0 AT91C_ID_TC0
#define SAM9261_BASE_REG_PA_MATRIX 0xFFFFEE00
#define SAM9261_BASE_REG_PA_PIOC 0xFFFFF800
#define SAM9261_BASE_REG_PA_SMC 0xFFFFEC00
#define SAM9261_BASE_REG_PA_AIC 0xFFFFF000
#define SAM9261_BASE_REG_PA_PIOB 0xFFFFF600
#define SAM9261_BASE_REG_PA_PMC 0xFFFFFC00
#define SAM9261_BASE_REG_PA_TC0 0xFFFA0000
#define AT91C_SCLK 32768
#define AT91C_TIMER0_CLOCK AT91C_SCLK
//#define AT91C_TIMER0_CLOCK (AT91C_MASTER_CLOCK/128) // MCK divide 128
#define TSP_SAMPLE_RATE_LOW 100
#define TSP_SAMPLE_RATE_HIGH 100
#define WaitOCGateLowToHigh 300
#define Cur_XY_Array XY_Array[ i ][ j ]
typedef UINT32 ROW_VAL_TYPE;
typedef UINT32 COL_VAL_TYPE;
#define LCD_DOT_WIDTH 640
#define LCD_DOT_HEIGHT 480
/* Key Addr */
#define PERIPH_BASE 0x50000000 //CPLD--NCS4
// A60T(most like)
#define KEY_WR_LT07_OFFSET 0x02
#define KEY_WR_LT15_OFFSET 0x04
#define KEY_WR_LT23_OFFSET 0x06
#define KEY_RD_LT07_OFFSET 0x08
#define KEY_RD_LT15_OFFSET 0x0A
#define KEY_RD_LT23_OFFSET 0x0C
#define KEY_RD_LT31_OFFSET 0x0E
//------------------------------------------------------------------------------
// Interrupt Priority
//------------------------------------------------------------------------------
#define INTR_TOUCH_PRIORITY 5
#define TouchKeyPanelColNum 32
#define TouchKeyPanelRowNum 24
#define TouchKeyPanelInputNum TouchKeyPanelColNum
#define TouchKeyPanelOutputNum TouchKeyPanelRowNum
//-------------------------------------------------------------
// macro fun definition
//-------------------------------------------------------------
#define LowByte( word ) ( ( BYTE ) ( word ) )
#define HighByte( word ) ( ( BYTE ) ( ( word ) >> 8 ) )
#define Byte2Word( high, low ) ( ( ( WORD ) ( high ) << 8 ) | ( WORD ) ( low ) )
#define LowWord( dword ) ( ( WORD ) ( dword ) )
#define HighWord( dword ) ( ( WORD ) ( ( dword ) >> 16 ) )
#define Word2DWord( high, low ) ( ( ( DWORD ) ( high ) << 16 ) | ( DWORD ) ( low ) )
#define Min( n1, n2 ) ( ( n1 ) < ( n2 ) ? ( n1 ) : ( n2 ) )
#define Max( n1, n2 ) ( ( n1 ) > ( n2 ) ? ( n1 ) : ( n2 ) )
//-------------------------------------------------------------
// function declare
//-------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -