init
This commit is contained in:
+165
@@ -0,0 +1,165 @@
|
||||
C51 COMPILER V9.60.7.0 DEBUG 07/03/2025 11:27:51 PAGE 1
|
||||
|
||||
|
||||
C51 COMPILER V9.60.7.0, COMPILATION OF MODULE DEBUG
|
||||
OBJECT MODULE PLACED IN .\hex\debug.obj
|
||||
COMPILER INVOKED BY: D:\Program Files\Keil_v5\C51\BIN\C51.EXE TS_Lib\Sources\debug.c OMF2 OPTIMIZE(9,SIZE) BROWSE DEBUG
|
||||
-PRINT(.\lst\debug.lst) TABS(2) OBJECT(.\hex\debug.obj)
|
||||
|
||||
line level source
|
||||
|
||||
1 #ifndef _I2C_C_
|
||||
2 #define _I2C_C_
|
||||
3
|
||||
4 /*********************************************************************************************************
|
||||
-************/
|
||||
5 #include "ca51f5_config.h"
|
||||
6 #include "includes\ca51f5sfr.h"
|
||||
7 #include "includes\ca51f5xsfr.h"
|
||||
8 #include "includes\gpiodef_f5.h"
|
||||
9 #include "Library\Includes\system_clock.h"
|
||||
10 #include "Library\Includes\i2c.h"
|
||||
11 /*********************************************************************************************************
|
||||
-************/
|
||||
12 #include "TS_Lib\Includes\ts_configuration.h"
|
||||
*** WARNING C329 IN LINE 117 OF TS_Lib\Includes\ts_configuration.h: single-line comment contains line-continuation
|
||||
*** WARNING C329 IN LINE 118 OF TS_Lib\Includes\ts_configuration.h: single-line comment contains line-continuation
|
||||
*** WARNING C329 IN LINE 119 OF TS_Lib\Includes\ts_configuration.h: single-line comment contains line-continuation
|
||||
*** WARNING C329 IN LINE 120 OF TS_Lib\Includes\ts_configuration.h: single-line comment contains line-continuation
|
||||
*** WARNING C329 IN LINE 121 OF TS_Lib\Includes\ts_configuration.h: single-line comment contains line-continuation
|
||||
*** WARNING C329 IN LINE 122 OF TS_Lib\Includes\ts_configuration.h: single-line comment contains line-continuation
|
||||
*** WARNING C329 IN LINE 123 OF TS_Lib\Includes\ts_configuration.h: single-line comment contains line-continuation
|
||||
*** WARNING C329 IN LINE 124 OF TS_Lib\Includes\ts_configuration.h: single-line comment contains line-continuation
|
||||
13 #include "TS_Lib\Includes\ts_def.h"
|
||||
14 #include "TS_Lib\Includes\ts_api.h"
|
||||
15 #include "TS_Lib\Includes\ts_service.h"
|
||||
16 /*********************************************************************************************************
|
||||
-************/
|
||||
17 #if DEBUG
|
||||
#define I2C_ADDR 0xCA
|
||||
unsigned char xdata TouchDebugID = '5';
|
||||
unsigned char rxOffset;
|
||||
unsigned char regAddr;
|
||||
bit iicReadMode;
|
||||
extern TSState_T xdata TS_State_Debug;
|
||||
extern unsigned char xdata Key_Cnt_Debug;
|
||||
extern unsigned char xdata TS_CH_Debug[OPENED_TS_COUNT];
|
||||
extern unsigned int xdata TS_RefChBaseLineData;
|
||||
extern unsigned int xdata TS_RefPostData;
|
||||
extern unsigned int xdata KeysFlagSN_Debug;
|
||||
code unsigned char *TS_INFO[]=
|
||||
{
|
||||
&TouchDebugID,
|
||||
&TS_State_Debug,
|
||||
&Key_Cnt_Debug,
|
||||
&TS_RefChBaseLineData,
|
||||
&TS_RefPostData,
|
||||
&KeysFlagSN_Debug,
|
||||
&TS_BaseLineData[0],
|
||||
&TS_PostData[0],
|
||||
&TSKey_FingerThd[0],
|
||||
&TS_CH_Debug[0],
|
||||
};
|
||||
unsigned char *pTS_Info;
|
||||
void I2C_ISR(void)
|
||||
C51 COMPILER V9.60.7.0 DEBUG 07/03/2025 11:27:51 PAGE 2
|
||||
|
||||
{
|
||||
unsigned char Sta_Temp;
|
||||
TouchDebugID = '5';
|
||||
Sta_Temp = I2CSTA;
|
||||
|
||||
if(Sta_Temp == 0x60) //接收到从机地址+写位
|
||||
{
|
||||
rxOffset = 0xff;
|
||||
iicReadMode = 0;
|
||||
I2CCON |= AAK(1);
|
||||
}
|
||||
else if(Sta_Temp == 0x80)
|
||||
{
|
||||
if(iicReadMode) //发送一字节数据
|
||||
{
|
||||
rxOffset++;
|
||||
I2CDAT = *(pTS_Info+rxOffset);
|
||||
}
|
||||
else //接收到一字节数据
|
||||
{
|
||||
if(rxOffset == 0xff) //地址
|
||||
{
|
||||
regAddr=I2CDAT;
|
||||
pTS_Info = TS_INFO[regAddr];
|
||||
rxOffset=0;
|
||||
I2CCON |= AAK(1);
|
||||
}
|
||||
else //数据
|
||||
{
|
||||
*(pTS_Info+rxOffset) = I2CDAT;
|
||||
rxOffset++;
|
||||
I2CCON |= AAK(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(Sta_Temp==0xA8) //接收到从机地址+读位,发送ACK信号
|
||||
{
|
||||
I2CDAT = *(pTS_Info+rxOffset);
|
||||
iicReadMode = 1;
|
||||
}
|
||||
else if(Sta_Temp == 0x88)
|
||||
{
|
||||
}
|
||||
I2CFLG |= I2CF;
|
||||
}
|
||||
void Debug_init(void)
|
||||
{
|
||||
#ifdef I2C_SELECT_P30_P31
|
||||
I2CIOS = 0;
|
||||
GPIO_Init(P30F,P30_I2C_SDA_SETTING);
|
||||
GPIO_Init(P31F,P31_I2C_SCL_SETTING);
|
||||
#elif defined I2C_SELECT_P02_P03
|
||||
I2CIOS = 1;
|
||||
GPIO_Init(P03F,P03_I2C_SDA_SETTING);
|
||||
GPIO_Init(P02F,P02_I2C_SCL_SETTING);
|
||||
#endif
|
||||
|
||||
I2CCON = I2CE(1) | I2CIE(1) | STA(0) | STP(0)| CKHD(0) | AAK(1)| CBSE(0) | STFE(0);
|
||||
I2CADR = (I2C_ADDR>>1);
|
||||
|
||||
INT4EN = 1;
|
||||
PS1 = 1;
|
||||
C51 COMPILER V9.60.7.0 DEBUG 07/03/2025 11:27:51 PAGE 3
|
||||
|
||||
}
|
||||
void Debug_ParamLoad(void)
|
||||
{
|
||||
unsigned char i;
|
||||
KeysFlagSN_Debug = (unsigned int)KeysFlagSN;
|
||||
TS_State_Debug = TS_State;
|
||||
Key_Cnt_Debug = KEY_CH_COUNT;
|
||||
for(i = 0; i < KEY_CH_COUNT; i++)
|
||||
{
|
||||
TS_CH_Debug[i] = TS_CH[i];
|
||||
}
|
||||
TS_RefPostData = TS_PostData[OPENED_TS_COUNT];
|
||||
TS_RefChBaseLineData = TS_RefPostData;
|
||||
}
|
||||
|
||||
#endif
|
||||
122 #endif
|
||||
|
||||
|
||||
MODULE INFORMATION: STATIC OVERLAYABLE
|
||||
CODE SIZE = ---- ----
|
||||
CONSTANT SIZE = ---- ----
|
||||
XDATA SIZE = ---- ----
|
||||
PDATA SIZE = ---- ----
|
||||
DATA SIZE = ---- ----
|
||||
IDATA SIZE = ---- ----
|
||||
BIT SIZE = ---- ----
|
||||
EDATA SIZE = ---- ----
|
||||
HDATA SIZE = ---- ----
|
||||
XDATA CONST SIZE = ---- ----
|
||||
FAR CONST SIZE = ---- ----
|
||||
END OF MODULE INFORMATION.
|
||||
|
||||
|
||||
C51 COMPILATION COMPLETE. 8 WARNING(S), 0 ERROR(S)
|
||||
Reference in New Issue
Block a user