# 1 "..\\src\\app\\demo\\app_tp_transfer.c"








 
# 1 "..\\src\\app\\test_cfg_global.h"








 





 



 

# 30 "..\\src\\app\\test_cfg_global.h"











































# 1 "..\\src\\app\\demo\\ap_demo.h"








 








 





# 30 "..\\src\\app\\demo\\ap_demo.h"

























 
void ap_demo(void);
void app_tp_I2C_init(void);
# 75 "..\\src\\app\\test_cfg_global.h"
# 1 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"








 
# 1 "..\\src\\app\\test_cfg_global.h"








 

# 84 "..\\src\\app\\test_cfg_global.h"

# 13 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"

# 1 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
 
 
 
 




 








 












# 38 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"


  



    typedef unsigned int size_t;    
# 54 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"




extern __declspec(__nothrow) void *memcpy(void * __restrict  ,
                    const void * __restrict  , size_t  ) __attribute__((__nonnull__(1,2)));
   




 
extern __declspec(__nothrow) void *memmove(void *  ,
                    const void *  , size_t  ) __attribute__((__nonnull__(1,2)));
   







 
extern __declspec(__nothrow) char *strcpy(char * __restrict  , const char * __restrict  ) __attribute__((__nonnull__(1,2)));
   




 
extern __declspec(__nothrow) char *strncpy(char * __restrict  , const char * __restrict  , size_t  ) __attribute__((__nonnull__(1,2)));
   





 

extern __declspec(__nothrow) char *strcat(char * __restrict  , const char * __restrict  ) __attribute__((__nonnull__(1,2)));
   




 
extern __declspec(__nothrow) char *strncat(char * __restrict  , const char * __restrict  , size_t  ) __attribute__((__nonnull__(1,2)));
   






 






 

extern __declspec(__nothrow) int memcmp(const void *  , const void *  , size_t  ) __attribute__((__nonnull__(1,2)));
   





 
extern __declspec(__nothrow) int strcmp(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   




 
extern __declspec(__nothrow) int strncmp(const char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2)));
   






 
extern __declspec(__nothrow) int strcasecmp(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   





 
extern __declspec(__nothrow) int strncasecmp(const char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2)));
   






 
extern __declspec(__nothrow) int strcoll(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   







 

extern __declspec(__nothrow) size_t strxfrm(char * __restrict  , const char * __restrict  , size_t  ) __attribute__((__nonnull__(2)));
   













 


# 193 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) void *memchr(const void *  , int  , size_t  ) __attribute__((__nonnull__(1)));

   





 

# 209 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) char *strchr(const char *  , int  ) __attribute__((__nonnull__(1)));

   




 

extern __declspec(__nothrow) size_t strcspn(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   




 

# 232 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) char *strpbrk(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));

   




 

# 247 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) char *strrchr(const char *  , int  ) __attribute__((__nonnull__(1)));

   





 

extern __declspec(__nothrow) size_t strspn(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));
   



 

# 270 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"
extern __declspec(__nothrow) char *strstr(const char *  , const char *  ) __attribute__((__nonnull__(1,2)));

   





 

extern __declspec(__nothrow) char *strtok(char * __restrict  , const char * __restrict  ) __attribute__((__nonnull__(2)));
extern __declspec(__nothrow) char *_strtok_r(char *  , const char *  , char **  ) __attribute__((__nonnull__(2,3)));

extern __declspec(__nothrow) char *strtok_r(char *  , const char *  , char **  ) __attribute__((__nonnull__(2,3)));

   

































 

extern __declspec(__nothrow) void *memset(void *  , int  , size_t  ) __attribute__((__nonnull__(1)));
   



 
extern __declspec(__nothrow) char *strerror(int  );
   





 
extern __declspec(__nothrow) size_t strlen(const char *  ) __attribute__((__nonnull__(1)));
   



 

extern __declspec(__nothrow) size_t strlcpy(char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2)));
   
















 

extern __declspec(__nothrow) size_t strlcat(char *  , const char *  , size_t  ) __attribute__((__nonnull__(1,2)));
   






















 

extern __declspec(__nothrow) void _membitcpybl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpybb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpyhl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpyhb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpywl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitcpywb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovebl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovebb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovehl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovehb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovewl(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
extern __declspec(__nothrow) void _membitmovewb(void *  , const void *  , int  , int  , size_t  ) __attribute__((__nonnull__(1,2)));
    














































 







# 502 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\string.h"



 

# 15 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"
# 1 "..\\src\\common\\tau_device_datatype.h"








 







 

# 1 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdint.h"
 
 





 









     
# 27 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdint.h"
     











# 46 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdint.h"





 

     

     
typedef   signed          char int8_t;
typedef   signed short     int int16_t;
typedef   signed           int int32_t;
typedef   signed       __int64 int64_t;

     
typedef unsigned          char uint8_t;
typedef unsigned short     int uint16_t;
typedef unsigned           int uint32_t;
typedef unsigned       __int64 uint64_t;

     

     
     
typedef   signed          char int_least8_t;
typedef   signed short     int int_least16_t;
typedef   signed           int int_least32_t;
typedef   signed       __int64 int_least64_t;

     
typedef unsigned          char uint_least8_t;
typedef unsigned short     int uint_least16_t;
typedef unsigned           int uint_least32_t;
typedef unsigned       __int64 uint_least64_t;

     

     
typedef   signed           int int_fast8_t;
typedef   signed           int int_fast16_t;
typedef   signed           int int_fast32_t;
typedef   signed       __int64 int_fast64_t;

     
typedef unsigned           int uint_fast8_t;
typedef unsigned           int uint_fast16_t;
typedef unsigned           int uint_fast32_t;
typedef unsigned       __int64 uint_fast64_t;

     




typedef   signed           int intptr_t;
typedef unsigned           int uintptr_t;


     
typedef   signed     long long intmax_t;
typedef unsigned     long long uintmax_t;




     

     





     





     





     

     





     





     





     

     





     





     





     

     






     






     






     

     


     


     


     

     
# 216 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdint.h"

     



     






     
    
 



# 241 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdint.h"

     







     










     











# 305 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdint.h"






 
# 20 "..\\src\\common\\tau_device_datatype.h"
# 1 "..\\src\\common\\tau_common.h"








 






 
# 18 "..\\src\\common\\tau_common.h"
# 1 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"




 





 












 






   









 






# 61 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"

# 75 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"







   




 















 
# 112 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"











 





extern __attribute__((__pcs__("aapcs"))) unsigned __ARM_dcmp4(double  , double  );
extern __attribute__((__pcs__("aapcs"))) unsigned __ARM_fcmp4(float  , float  );
    




 

extern __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_fpclassifyf(float  );
extern __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_fpclassify(double  );
     
     

static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isfinitef(float __x)
{
    return (((*(unsigned *)&(__x)) >> 23) & 0xff) != 0xff;
}
static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isfinite(double __x)
{
    return (((*(1 + (unsigned *)&(__x))) >> 20) & 0x7ff) != 0x7ff;
}
     
     

static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isinff(float __x)
{
    return ((*(unsigned *)&(__x)) << 1) == 0xff000000;
}
static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isinf(double __x)
{
    return (((*(1 + (unsigned *)&(__x))) << 1) == 0xffe00000) && ((*(unsigned *)&(__x)) == 0);
}
     
     

static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_islessgreaterf(float __x, float __y)
{
    unsigned __f = __ARM_fcmp4(__x, __y) >> 28;
    return (__f == 8) || (__f == 2);  
}
static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_islessgreater(double __x, double __y)
{
    unsigned __f = __ARM_dcmp4(__x, __y) >> 28;
    return (__f == 8) || (__f == 2);  
}
    


 

static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isnanf(float __x)
{
    return (0x7f800000 - ((*(unsigned *)&(__x)) & 0x7fffffff)) >> 31;
}
static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isnan(double __x)
{
    unsigned __xf = (*(1 + (unsigned *)&(__x))) | (((*(unsigned *)&(__x)) == 0) ? 0 : 1);
    return (0x7ff00000 - (__xf & 0x7fffffff)) >> 31;
}
     
     

static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isnormalf(float __x)
{
    unsigned __xe = ((*(unsigned *)&(__x)) >> 23) & 0xff;
    return (__xe != 0xff) && (__xe != 0);
}
static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isnormal(double __x)
{
    unsigned __xe = ((*(1 + (unsigned *)&(__x))) >> 20) & 0x7ff;
    return (__xe != 0x7ff) && (__xe != 0);
}
     
     

static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_signbitf(float __x)
{
    return (*(unsigned *)&(__x)) >> 31;
}
static __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_signbit(double __x)
{
    return (*(1 + (unsigned *)&(__x))) >> 31;
}
     
     








# 230 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"







   
  typedef float float_t;
  typedef double double_t;
# 251 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"



extern const int math_errhandling;
# 261 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"

extern __declspec(__nothrow) double acos(double  );
    
    
    
extern __declspec(__nothrow) double asin(double  );
    
    
    
    

extern __declspec(__nothrow) __attribute__((const)) double atan(double  );
    
    

extern __declspec(__nothrow) double atan2(double  , double  );
    
    
    
    

extern __declspec(__nothrow) double cos(double  );
    
    
    
    
extern __declspec(__nothrow) double sin(double  );
    
    
    
    

extern void __use_accurate_range_reduction(void);
    
    

extern __declspec(__nothrow) double tan(double  );
    
    
    
    

extern __declspec(__nothrow) double cosh(double  );
    
    
    
    
extern __declspec(__nothrow) double sinh(double  );
    
    
    
    
    

extern __declspec(__nothrow) __attribute__((const)) double tanh(double  );
    
    

extern __declspec(__nothrow) double exp(double  );
    
    
    
    
    

extern __declspec(__nothrow) double frexp(double  , int *  ) __attribute__((__nonnull__(2)));
    
    
    
    
    
    

extern __declspec(__nothrow) double ldexp(double  , int  );
    
    
    
    
extern __declspec(__nothrow) double log(double  );
    
    
    
    
    
extern __declspec(__nothrow) double log10(double  );
    
    
    
extern __declspec(__nothrow) double modf(double  , double *  ) __attribute__((__nonnull__(2)));
    
    
    
    

extern __declspec(__nothrow) double pow(double  , double  );
    
    
    
    
    
    
extern __declspec(__nothrow) double sqrt(double  );
    
    
    




    static __inline double _sqrt(double __x) { return sqrt(__x); }




    static __inline float _sqrtf(float __x) { return (float)sqrt(__x); }

    



 

extern __declspec(__nothrow) __attribute__((const)) double ceil(double  );
    
    
extern __declspec(__nothrow) __attribute__((const)) double fabs(double  );
    
    

extern __declspec(__nothrow) __attribute__((const)) double floor(double  );
    
    

extern __declspec(__nothrow) double fmod(double  , double  );
    
    
    
    
    

    









 



extern __declspec(__nothrow) double acosh(double  );
    

 
extern __declspec(__nothrow) double asinh(double  );
    

 
extern __declspec(__nothrow) double atanh(double  );
    

 
extern __declspec(__nothrow) double cbrt(double  );
    

 
static __inline __declspec(__nothrow) __attribute__((const)) double copysign(double __x, double __y)
    

 
{
    (*(1 + (unsigned *)&(__x))) = ((*(1 + (unsigned *)&(__x))) & 0x7fffffff) | ((*(1 + (unsigned *)&(__y))) & 0x80000000);
    return __x;
}
static __inline __declspec(__nothrow) __attribute__((const)) float copysignf(float __x, float __y)
    

 
{
    (*(unsigned *)&(__x)) = ((*(unsigned *)&(__x)) & 0x7fffffff) | ((*(unsigned *)&(__y)) & 0x80000000);
    return __x;
}
extern __declspec(__nothrow) double erf(double  );
    

 
extern __declspec(__nothrow) double erfc(double  );
    

 
extern __declspec(__nothrow) double expm1(double  );
    

 



    

 






# 479 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"


extern __declspec(__nothrow) double hypot(double  , double  );
    




 
extern __declspec(__nothrow) int ilogb(double  );
    

 
extern __declspec(__nothrow) int ilogbf(float  );
    

 
extern __declspec(__nothrow) int ilogbl(long double  );
    

 







    

 





    



 





    



 





    

 





    



 





    



 





    



 





    

 





    

 





    


 

extern __declspec(__nothrow) double lgamma (double  );
    


 
extern __declspec(__nothrow) double log1p(double  );
    

 
extern __declspec(__nothrow) double logb(double  );
    

 
extern __declspec(__nothrow) float logbf(float  );
    

 
extern __declspec(__nothrow) long double logbl(long double  );
    

 
extern __declspec(__nothrow) double nextafter(double  , double  );
    


 
extern __declspec(__nothrow) float nextafterf(float  , float  );
    


 
extern __declspec(__nothrow) long double nextafterl(long double  , long double  );
    


 
extern __declspec(__nothrow) double nexttoward(double  , long double  );
    


 
extern __declspec(__nothrow) float nexttowardf(float  , long double  );
    


 
extern __declspec(__nothrow) long double nexttowardl(long double  , long double  );
    


 
extern __declspec(__nothrow) double remainder(double  , double  );
    

 
extern __declspec(__nothrow) __attribute__((const)) double rint(double  );
    

 
extern __declspec(__nothrow) double scalbln(double  , long int  );
    

 
extern __declspec(__nothrow) float scalblnf(float  , long int  );
    

 
extern __declspec(__nothrow) long double scalblnl(long double  , long int  );
    

 
extern __declspec(__nothrow) double scalbn(double  , int  );
    

 
extern __declspec(__nothrow) float scalbnf(float  , int  );
    

 
extern __declspec(__nothrow) long double scalbnl(long double  , int  );
    

 




    

 



 
extern __declspec(__nothrow) __attribute__((const)) float _fabsf(float);  
static __inline __declspec(__nothrow) __attribute__((const)) float fabsf(float __f) { return _fabsf(__f); }
extern __declspec(__nothrow) float sinf(float  );
extern __declspec(__nothrow) float cosf(float  );
extern __declspec(__nothrow) float tanf(float  );
extern __declspec(__nothrow) float acosf(float  );
extern __declspec(__nothrow) float asinf(float  );
extern __declspec(__nothrow) float atanf(float  );
extern __declspec(__nothrow) float atan2f(float  , float  );
extern __declspec(__nothrow) float sinhf(float  );
extern __declspec(__nothrow) float coshf(float  );
extern __declspec(__nothrow) float tanhf(float  );
extern __declspec(__nothrow) float expf(float  );
extern __declspec(__nothrow) float logf(float  );
extern __declspec(__nothrow) float log10f(float  );
extern __declspec(__nothrow) float powf(float  , float  );
extern __declspec(__nothrow) float sqrtf(float  );
extern __declspec(__nothrow) float ldexpf(float  , int  );
extern __declspec(__nothrow) float frexpf(float  , int *  ) __attribute__((__nonnull__(2)));
extern __declspec(__nothrow) __attribute__((const)) float ceilf(float  );
extern __declspec(__nothrow) __attribute__((const)) float floorf(float  );
extern __declspec(__nothrow) float fmodf(float  , float  );
extern __declspec(__nothrow) float modff(float  , float *  ) __attribute__((__nonnull__(2)));

 
 













 
__declspec(__nothrow) long double acosl(long double );
__declspec(__nothrow) long double asinl(long double );
__declspec(__nothrow) long double atanl(long double );
__declspec(__nothrow) long double atan2l(long double , long double );
__declspec(__nothrow) long double ceill(long double );
__declspec(__nothrow) long double cosl(long double );
__declspec(__nothrow) long double coshl(long double );
__declspec(__nothrow) long double expl(long double );
__declspec(__nothrow) long double fabsl(long double );
__declspec(__nothrow) long double floorl(long double );
__declspec(__nothrow) long double fmodl(long double , long double );
__declspec(__nothrow) long double frexpl(long double , int* ) __attribute__((__nonnull__(2)));
__declspec(__nothrow) long double ldexpl(long double , int );
__declspec(__nothrow) long double logl(long double );
__declspec(__nothrow) long double log10l(long double );
__declspec(__nothrow) long double modfl(long double  , long double *  ) __attribute__((__nonnull__(2)));
__declspec(__nothrow) long double powl(long double , long double );
__declspec(__nothrow) long double sinl(long double );
__declspec(__nothrow) long double sinhl(long double );
__declspec(__nothrow) long double sqrtl(long double );
__declspec(__nothrow) long double tanl(long double );
__declspec(__nothrow) long double tanhl(long double );





 
extern __declspec(__nothrow) float acoshf(float  );
__declspec(__nothrow) long double acoshl(long double );
extern __declspec(__nothrow) float asinhf(float  );
__declspec(__nothrow) long double asinhl(long double );
extern __declspec(__nothrow) float atanhf(float  );
__declspec(__nothrow) long double atanhl(long double );
__declspec(__nothrow) long double copysignl(long double , long double );
extern __declspec(__nothrow) float cbrtf(float  );
__declspec(__nothrow) long double cbrtl(long double );
extern __declspec(__nothrow) float erff(float  );
__declspec(__nothrow) long double erfl(long double );
extern __declspec(__nothrow) float erfcf(float  );
__declspec(__nothrow) long double erfcl(long double );
extern __declspec(__nothrow) float expm1f(float  );
__declspec(__nothrow) long double expm1l(long double );
extern __declspec(__nothrow) float log1pf(float  );
__declspec(__nothrow) long double log1pl(long double );
extern __declspec(__nothrow) float hypotf(float  , float  );
__declspec(__nothrow) long double hypotl(long double , long double );
extern __declspec(__nothrow) float lgammaf(float  );
__declspec(__nothrow) long double lgammal(long double );
extern __declspec(__nothrow) float remainderf(float  , float  );
__declspec(__nothrow) long double remainderl(long double , long double );
extern __declspec(__nothrow) float rintf(float  );
__declspec(__nothrow) long double rintl(long double );






 
extern __declspec(__nothrow) double exp2(double  );  
extern __declspec(__nothrow) float exp2f(float  );
__declspec(__nothrow) long double exp2l(long double );
extern __declspec(__nothrow) double fdim(double  , double  );
extern __declspec(__nothrow) float fdimf(float  , float  );
__declspec(__nothrow) long double fdiml(long double , long double );
# 803 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"
extern __declspec(__nothrow) double fma(double  , double  , double  );
extern __declspec(__nothrow) float fmaf(float  , float  , float  );

static __inline __declspec(__nothrow) long double fmal(long double __x, long double __y, long double __z)     { return (long double)fma((double)__x, (double)__y, (double)__z); }


extern __declspec(__nothrow) __attribute__((const)) double fmax(double  , double  );
extern __declspec(__nothrow) __attribute__((const)) float fmaxf(float  , float  );
__declspec(__nothrow) long double fmaxl(long double , long double );
extern __declspec(__nothrow) __attribute__((const)) double fmin(double  , double  );
extern __declspec(__nothrow) __attribute__((const)) float fminf(float  , float  );
__declspec(__nothrow) long double fminl(long double , long double );
extern __declspec(__nothrow) double log2(double  );  
extern __declspec(__nothrow) float log2f(float  );
__declspec(__nothrow) long double log2l(long double );
extern __declspec(__nothrow) long lrint(double  );
extern __declspec(__nothrow) long lrintf(float  );

static __inline __declspec(__nothrow) long lrintl(long double __x)     { return lrint((double)__x); }


extern __declspec(__nothrow) long long llrint(double  );
extern __declspec(__nothrow) long long llrintf(float  );

static __inline __declspec(__nothrow) long long llrintl(long double __x)     { return llrint((double)__x); }


extern __declspec(__nothrow) long lround(double  );
extern __declspec(__nothrow) long lroundf(float  );

static __inline __declspec(__nothrow) long lroundl(long double __x)     { return lround((double)__x); }


extern __declspec(__nothrow) long long llround(double  );
extern __declspec(__nothrow) long long llroundf(float  );

static __inline __declspec(__nothrow) long long llroundl(long double __x)     { return llround((double)__x); }


extern __declspec(__nothrow) __attribute__((const)) double nan(const char * );
extern __declspec(__nothrow) __attribute__((const)) float nanf(const char * );

static __inline __declspec(__nothrow) __attribute__((const)) long double nanl(const char *__t)     { return (long double)nan(__t); }
# 856 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"
extern __declspec(__nothrow) __attribute__((const)) double nearbyint(double  );
extern __declspec(__nothrow) __attribute__((const)) float nearbyintf(float  );
__declspec(__nothrow) long double nearbyintl(long double );
extern  double remquo(double  , double  , int * );
extern  float remquof(float  , float  , int * );

static __inline long double remquol(long double __x, long double __y, int *__q)     { return (long double)remquo((double)__x, (double)__y, __q); }


extern __declspec(__nothrow) __attribute__((const)) double round(double  );
extern __declspec(__nothrow) __attribute__((const)) float roundf(float  );
__declspec(__nothrow) long double roundl(long double );
extern __declspec(__nothrow) double tgamma(double  );  
extern __declspec(__nothrow) float tgammaf(float  );
__declspec(__nothrow) long double tgammal(long double );
extern __declspec(__nothrow) __attribute__((const)) double trunc(double  );
extern __declspec(__nothrow) __attribute__((const)) float truncf(float  );
__declspec(__nothrow) long double truncl(long double );






# 896 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"

# 1087 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"











# 1317 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\math.h"





 
# 19 "..\\src\\common\\tau_common.h"



 



 

















 














 

 




 

# 75 "..\\src\\common\\tau_common.h"

























 


 


















 















 









 











 











 


 















 


 


 




 



 





 
 
typedef void (*fcb_type)(void *data);

# 21 "..\\src\\common\\tau_device_datatype.h"



 



 
 




 
 
enum _status_groups
{
    STATUS_GROUP_GENERIC    = 0,
    STATUS_GROUP_I2C        = 1,
    STATUS_GROUP_UART       = 2,
    STATUS_GROUP_SPI        = 3,
    kStatusGroup_Timer      = 4,
};

 
enum _generic_status
{
    STATUS_SUCCESS                     = ((((STATUS_GROUP_GENERIC)*100) + (0))),
    STATUS_FAIL                        = ((((STATUS_GROUP_GENERIC)*100) + (1))),
    STATUS_READ_ONLY                   = ((((STATUS_GROUP_GENERIC)*100) + (2))),
    STATUS_OUT_OF_RANGE                = ((((STATUS_GROUP_GENERIC)*100) + (3))),
    STATUS_INVALID_ARGUMENT            = ((((STATUS_GROUP_GENERIC)*100) + (4))),
    STATUS_TIME_OUT                    = ((((STATUS_GROUP_GENERIC)*100) + (5))),
    STATUS_NO_TRANSFER_IN_PROGRESS     = ((((STATUS_GROUP_GENERIC)*100) + (6))),
};



 
typedef enum
{
    TIMER_STATUS_IDLE            = ((((kStatusGroup_Timer)*100) + (0))),     
    TIMER_STATUS_RUNNING         = ((((kStatusGroup_Timer)*100) + (1))),     
    TIMER_STATUS_TIMEOUT         = ((((kStatusGroup_Timer)*100) + (2))),     
} timer_status_e;



 
typedef enum
{
    DETECT_HIGH_LVL = 0,
    DETECT_LOW_LVL,
    DETECT_RISING_EDGE,
    DETECT_FALLING_EDGE
} sys_cfg_trigger_e;



 
typedef enum
{
    TIMER_NUM0 = 0,
    TIMER_NUM1,
    TIMER_NUM2,
    TIMER_NUM3,
    TIMER_NUM_MAX
} timer_num_e;



 
typedef enum
{
    GPIO_INT_EXTI_INT0 = 0,
    GPIO_INT_EXTI_INT1,
    GPIO_INT_EXTI_INT2,
    GPIO_INT_EXTI_INT3,
    GPIO_INT_EXTI_INT4,
    GPIO_INT_EXTI_INT5,
    GPIO_INT_EXTI_INT6,
    GPIO_INT_EXTI_INT7,
    GPIO_INT_MAX
} gpio_int_e;

 
typedef enum _pwm_int_type
{
    PWM_INT_HIGH_OVERFLOW = 0,
    PWM_INT_LOW_OVERFLOW,
    PWM_INT_TOTAL_OVERFLOW,
    PWM_INT_HIGH_DONE,
    PWM_INT_LOW_DONE,
    PWM_INT_TOTAL_DONE,
    PWM_INT_MAX
} pwm_int_type_e;



 
typedef enum
{
    I2C_SELECT_0 = 0,    
    I2C_SELECT_1,        
} i2c_select_e;




 
typedef enum _i2c_rate
{
    I2C_RATE_STANDARD = 1, 
    I2C_RATE_FAST,         
    I2C_RATE_HIGH,         
} i2c_rate_e;

 
typedef enum
{
    DMA_CH0 = 0,            
    DMA_CH1 = 1,            
    DMA_CH2 = 2,            
    DMA_CH3 = 3,            
    DMA_CH4 = 4,            
    DMA_CH5 = 5,            
} dma_channel_e;


 

typedef enum
{
    DISABLE = 0,
    ENABLE = !DISABLE
} function_state_e;
 
typedef int32_t status_t;





 



# 16 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"
# 17 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"
# 1 "..\\src\\app\\demo\\app_tp_transfer.h"








 



# 14 "..\\src\\app\\demo\\app_tp_transfer.h"
# 15 "..\\src\\app\\demo\\app_tp_transfer.h"
# 16 "..\\src\\app\\demo\\app_tp_transfer.h"



	


typedef struct
{
    uint8_t tp_point_buffer[6];    
    uint8_t tp_read_point_counter;                    		 
    uint8_t tp_point_up_error_flag;                   		 
    uint32_t tp_point_error_time_counter;                 
} st_tp_scan_data;








 
void ap_tp_calibration(void);







 
void app_tp_screen_init(void);







 
void app_tp_init(void);







 
void app_tp_transfer_screen_int(void);







 
void app_tp_transfer_screen_start(void);







 
_Bool app_tp_phone_reset_on(void);







 
void app_tp_phone_clear_reset_on(void);








 
void app_tp_s_write(const uint8_t *txbuffer, size_t buffer_size);







 
_Bool app_tp_enter_sleep_on(void);



# 18 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"
# 1 "..\\src\\sdk\\include\\hal_gpio.h"








 





 
# 17 "..\\src\\sdk\\include\\hal_gpio.h"
# 18 "..\\src\\sdk\\include\\hal_gpio.h"



 


 
typedef enum
{
     
    IO_PAD_GPIO0 = 0,
    IO_PAD_GPIO1,
    IO_PAD_GPIO2,
    IO_PAD_GPIO3,
    IO_PAD_GPIO4,
    IO_PAD_GPIO5,
    IO_PAD_GPIO6,
    IO_PAD_RESV,
    IO_PAD_GPIO8,
    IO_PAD_GPIO9,
    IO_PAD_GPIO10,
    IO_PAD_GPIO11,
    IO_PAD_GPIO12,
    IO_PAD_GPIO13,
    IO_PAD_GPIO14,
    IO_PAD_RESV1,
    IO_PAD_RESV2,
    IO_PAD_GPIO17,
    IO_PAD_GPIO18,
    IO_PAD_GPIO19,
    IO_PAD_GPIO20,
    IO_PAD_GPIO21,

     
    IO_PAD_AP_SPIS_MISO = IO_PAD_GPIO0,
    IO_PAD_AP_SPIS_MOSI = IO_PAD_GPIO1,
    IO_PAD_AP_INT       = IO_PAD_GPIO2,
    IO_PAD_AP_TE        = IO_PAD_GPIO3,
    IO_PAD_AP_SWIRE     = IO_PAD_GPIO4,
    IO_PAD_TD_SPIM_MISO = IO_PAD_GPIO5,
    IO_PAD_TD_SPIM_MOSI = IO_PAD_GPIO6,
    IO_PAD_TD_RSTN      = IO_PAD_RESV,
    IO_PAD_TD_TPRSTN    = IO_PAD_GPIO8,
    IO_PAD_TD_INT       = IO_PAD_GPIO9,
    IO_PAD_TD_LEDPWM    = IO_PAD_GPIO10,
    IO_PAD_TD_FC_CLK    = IO_PAD_GPIO11,
    IO_PAD_TD_FC_CSN    = IO_PAD_GPIO12,
    IO_PAD_TD_FC_MISO   = IO_PAD_GPIO13,
    IO_PAD_TD_FC_MOSI   = IO_PAD_GPIO14,
    IO_PAD_UART_RX      = IO_PAD_GPIO17,
    IO_PAD_UART_TX      = IO_PAD_GPIO18,
    IO_PAD_PWMEN        = IO_PAD_GPIO19,
    IO_PAD_ADCIN        = IO_PAD_GPIO20,
    IO_PAD_AP_TPRSTN    = IO_PAD_GPIO21,

    IO_PAD_AP_SPIS_CLK,
    IO_PAD_AP_SPIS_CSN,
    IO_PAD_TD_SPIM_CLK,
    IO_PAD_TD_SPIM_CSN,
    IO_PAD_SFC_CLK,
    IO_PAD_SFC_CSN,
    IO_PAD_SFC_IO0,
    IO_PAD_SFC_IO1,

    IO_PAD_MAX,

     
    IO_PIN_A1           = IO_PAD_TD_TPRSTN,
    IO_PIN_A2           = IO_PAD_TD_FC_CSN,
    IO_PIN_A3           = IO_PAD_TD_SPIM_MISO,
    IO_PIN_A4           = IO_PAD_TD_SPIM_CLK,
    IO_PIN_A5           = IO_PAD_PWMEN,
    IO_PIN_A6           = IO_PAD_ADCIN,
    IO_PIN_A7           = IO_PAD_AP_INT,
    IO_PIN_A8           = IO_PAD_AP_SPIS_MOSI,
    IO_PIN_B1           = IO_PAD_TD_FC_CLK,
    IO_PIN_B2           = IO_PAD_TD_FC_MISO,
    IO_PIN_B3           = IO_PAD_TD_SPIM_MOSI,
    IO_PIN_B4           = IO_PAD_TD_SPIM_CSN,
    IO_PIN_B5           = IO_PAD_AP_SWIRE,
    IO_PIN_B7           = IO_PAD_AP_SPIS_MISO,
    IO_PIN_B8           = IO_PAD_AP_SPIS_CSN,
    IO_PIN_C1           = IO_PAD_TD_FC_MOSI,
    IO_PIN_C2           = IO_PAD_TD_LEDPWM,
    IO_PIN_C4           = IO_PAD_UART_TX,
    IO_PIN_C5           = IO_PAD_UART_RX,
    IO_PIN_C6           = IO_PAD_AP_TE,
    IO_PIN_D1           = IO_PAD_TD_RSTN,
    IO_PIN_D2           = IO_PAD_TD_INT,
    IO_PIN_D7           = IO_PAD_AP_TPRSTN,
    IO_PIN_D8           = IO_PAD_AP_SPIS_CLK,
} io_pad_e;



 
typedef enum
{
    IO_MODE_JTAG_TCK   = 0,
    IO_MODE_SPIS_SCLK  = 1,
    IO_MODE_I2C0_SCL   = 3,
} pad_ap_spis_clk_mode_e;



 
typedef enum
{
    IO_MODE_JTAG_TRSTN = 0,
    IO_MODE_SPIS_CSN   = 1,
    IO_MODE_I2C0_SDA   = 3,
} pad_ap_spis_csn_mode_e;



 
typedef enum
{
    IO_MODE_JTAG_TDO     = 0,
    IO_MODE_SPIS_MISO    = 1,
    IO_MODE_GPIO0        = 2,
    IO_MODE_UART_RX_AP   = 3,
    IO_MODE_SPIM_MISO_AP = 4,
} pad_ap_spis_miso_mode_e;



 
typedef enum
{
    IO_MODE_JTAG_TMS     = 0,
    IO_MODE_SPIS_MOSI    = 1,
    IO_MODE_GPIO1        = 2,
    IO_MODE_UART_TX_AP   = 3,
    IO_MODE_SPIM_MOSI_AP = 4,
} pad_ap_spis_mosi_mode_e;



 
typedef enum
{
    IO_MODE_JTAG_TDI = 0,
    IO_MODE_GPIO21   = 2,
} pad_ap_tprstn_mode_e;



 
typedef enum
{
    IO_MODE_GPIO2       = 2,
} pad_ap_int_mode_e;



 
typedef enum
{
    IO_MODE_TEAR  = 0,
    IO_MODE_GPIO3 = 2,
} pad_ap_te_mode_e;



 
typedef enum
{
    IO_MODE_SWIRE = 0,
    IO_MODE_PWMO  = 1,
    IO_MODE_GPIO4 = 2,
} pad_ap_swire_mode_e;



 
typedef enum
{
    IO_MODE_SPIM_SCLK  = 0,
    IO_MODE_I2C1_SCL   = 1,
} pad_td_spim_clk_mode_e;



 
typedef enum
{
    IO_MODE_SPIM_CSN   = 0,
    IO_MODE_I2C1_SDA   = 1,
} pad_td_spim_csn_mode_e;



 
typedef enum
{
    IO_MODE_SPIM_MISO = 0,

    IO_MODE_PWMO1     = 1,

    IO_MODE_GPIO5     = 2,
} pad_td_spim_miso_mode_e;



 
typedef enum
{
    IO_MODE_SPIM_MOSI = 0,
    IO_MODE_GPIO6     = 2,
} pad_td_spim_mosi_mode_e;



 
typedef enum
{
    IO_MODE_GPIO8      = 2,
} pad_td_tprstn_mode_e;



 
typedef enum
{
    IO_MODE_GPIO9_FUNC = 0,
    IO_MODE_GPIO9      = 2,
} pad_td_int_mode_e;



 
typedef enum
{
    IO_MODE_PWMI       = 0,

    IO_MODE_PWMO2      = 1,

    IO_MODE_GPIO10     = 2,
} pad_td_ledpwm_mode_e;



 
typedef enum
{
    IO_MODE_TSPIS_CLK    = 0,
    IO_MODE_GPIO11       = 2,
} pad_td_fc_clk_mode_e;



 
typedef enum
{
    IO_MODE_TSPIS_CSN    = 0,
    IO_MODE_GPIO12       = 2,
} pad_td_fc_csn_mode_e;



 
typedef enum
{
    IO_MODE_TSPIS_MISO = 0,
    IO_MODE_GPIO13     = 2,
} pad_td_fc_miso_mode_e;



 
typedef enum
{
    IO_MODE_TSPIS_MOSI = 0,
    IO_MODE_GPIO14     = 2,
} pad_td_fc_mosi_mode_e;



 
typedef enum
{
    IO_MODE_UART_RX = 0,
    IO_MODE_GPIO17  = 2,
} pad_uart_rx_mode_e;



 
typedef enum
{
    IO_MODE_UART_TX = 0,
    IO_MODE_GPIO18  = 2,
} pad_uart_tx_mode_e;



 
typedef enum
{
    IO_MODE_GPIO19     = 2,
} pad_pwmen_mode_e;



 
typedef enum
{
    IO_MODE_GPIO20      = 2,
} pad_adcin_mode_e;



 
typedef enum
{
    IO_MODE_INTER_FLS_CLK = 0,
    IO_MODE_EXT_FLS_CLK   = 1,
} pad_sfc_clk_mode_e;



 
typedef enum
{
    IO_MODE_INTER_FLS_CSN = 0,
    IO_MODE_EXT_FLS_CSN   = 1,
} pad_sfc_csn_mode_e;



 
typedef enum
{
    IO_MODE_INTER_FLS_IO0 = 0,
    IO_MODE_EXT_FLS_MISO  = 1,
} pad_sfc_io0_mode_e;



 
typedef enum
{
    IO_MODE_INTER_FLS_IO1 = 0,
    IO_MODE_EXT_FLS_MOSI  = 1,
} pad_sfc_io1_mode_e;



 
typedef enum
{
    IO_SLEW_RATE_SLOW = 0,
    IO_SLEW_RATE_FAST = 1,
} pad_slew_rate_e;



 


 
typedef enum
{
    IO_IOE_INPUT = 0,
    IO_IOE_OUTPUT
} gpio_ioe_direct_e;



 
typedef enum
{
    IO_LVL_LOW = 0,
    IO_LVL_HIGH
} gpio_level_e;



 



 



 





 
void hal_gpio_init_eint(io_pad_e pad, sys_cfg_trigger_e trig);







 
void hal_gpio_reg_eint_cb(io_pad_e pad, fcb_type cb_func);






 
void hal_gpio_ctrl_eint(io_pad_e pad, function_state_e state);





 
gpio_int_e hal_gpio_get_int_type(io_pad_e pad);






 
void hal_gpio_init_output(io_pad_e pad, gpio_level_e lvl);






 
void hal_gpio_set_output_data(io_pad_e pad, gpio_level_e lvl);








 
void hal_gpio_set_output_data_ex(io_pad_e pad1, gpio_level_e pad1_lvl, io_pad_e pad2, gpio_level_e pad2_lvl);





 
void hal_gpio_init_input(io_pad_e pad);





 
gpio_level_e hal_gpio_get_input_data(io_pad_e pad);






 
void hal_gpio_set_mode(io_pad_e pad, uint8_t mode);







 
void hal_gpio_get_pull_state(io_pad_e pad, function_state_e *up_enable, function_state_e *down_enable);







 
void hal_gpio_set_pull_state(io_pad_e pad, function_state_e up_enable, function_state_e down_enable);






 
void hal_gpio_set_schmitt_trigger(io_pad_e pad, function_state_e st_enable);






 
void hal_gpio_set_driving_strength(io_pad_e pad, uint8_t strength);






 
void hal_gpio_set_slew_rate(io_pad_e pad, pad_slew_rate_e rate);







 
void hal_gpio_set_ap_reset_int(_Bool enable, fcb_type cb_func, sys_cfg_trigger_e trig);

# 19 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"



# 38 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"





# 51 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"












# 71 "..\\src\\app\\demo\\app_tp_for_custom_s8.h"





typedef enum
{
    I2C_ADDR_BITS_7  = 7,
    I2C_ADDR_BITS_10 = 10
} en_I2C_ADDR_BITS_mdoe;

typedef struct
{
    uint8_t *buffer;                               
    size_t txbuffer_size;                          
    size_t rxbuffer_size;                          
    _Bool read_flag;                                
} st_screen_data;

typedef struct
{
    const uint8_t *buffer;                         
    size_t txbuffer_size;                          
    size_t rxbuffer_size;                          
    _Bool read_flag;                                
} st_screen_const_data;

typedef struct
{
    uint8_t reg_size;                              
    size_t write_back_size;                        
    const uint8_t *reg_data;                       
    const uint8_t *write_back;                     
} st_reg_const_data;

typedef struct
{
    uint8_t reg_size;                              
    size_t write_back_size;                        
    uint8_t *reg_data;                             
    uint8_t *write_back;                           
} st_reg_data;

extern io_pad_e g_screen_input_rst_pad;
extern io_pad_e g_screen_input_int_pad;
extern io_pad_e g_phone_input_rst_pad;
extern io_pad_e g_phone_output_int_pad;

extern uint8_t phone_start_flag;
extern uint8_t phone_touch_flag;
extern const uint8_t screen_reg_int_data_size;
extern const uint8_t screen_reg_start_data_size;
extern st_screen_data screen_reg_int_data[];
extern st_screen_const_data screen_reg_start_data[];








 
uint8_t app_tp_screen_analysis_const(uint8_t transfer_now, uint8_t *rxbuffer, size_t data_size);







 
uint8_t app_tp_screen_analysis_int(uint8_t transfer_now, uint8_t *rxbuffer, size_t data_size);







 
void app_tp_phone_analysis_data(uint8_t *rxbuffer, size_t rxbuffer_size, const uint8_t **txbuffer, size_t *txbuffer_size);




# 76 "..\\src\\app\\test_cfg_global.h"









# 11 "..\\src\\app\\demo\\app_tp_transfer.c"
# 12 "..\\src\\app\\demo\\app_tp_transfer.c"
# 1 "..\\src\\sdk\\include\\hal_i2c_master.h"








 




# 15 "..\\src\\sdk\\include\\hal_i2c_master.h"
# 16 "..\\src\\sdk\\include\\hal_i2c_master.h"
# 17 "..\\src\\sdk\\include\\hal_i2c_master.h"









 
void hal_i2c_m_dma_init(uint8_t slave_addr, uint8_t addr_bits, uint32_t i2c_speed_hz);









 
status_t hal_i2c_m_dma_write(const uint8_t *txBuffer, size_t data_size);











 
status_t hal_i2c_m_dma_read(uint32_t reg_address, size_t reg_size, uint8_t *rxBuffer, size_t data_size);








 
_Bool hal_i2c_m_transfer_complate(void);







 
void hal_i2c_m_set_high_impedance(void);



# 13 "..\\src\\app\\demo\\app_tp_transfer.c"
# 1 "..\\src\\sdk\\include\\hal_i2c_slave.h"








 




# 15 "..\\src\\sdk\\include\\hal_i2c_slave.h"
# 16 "..\\src\\sdk\\include\\hal_i2c_slave.h"
# 17 "..\\src\\sdk\\include\\hal_i2c_slave.h"

typedef enum
{
    I2C_S_INT_READ = 0,             
    I2C_S_INT_RX,                   
    I2C_S_INT_STOP                  
} e_i2c_s_int_status;

typedef void (*hal_i2c_s_callback_t)(e_i2c_s_int_status int_status, size_t receive_num);








 
void hal_i2c_s_init(uint8_t slave_addr, uint8_t addr_bits);









 
status_t hal_i2c_s_dma_write(const uint8_t *txBuffer, size_t data_size);









 
status_t hal_i2c_s_nonblocking_read(uint8_t *rxBuffer, size_t data_size);








 
_Bool hal_i2c_s_write_complate(void);







 
uint8_t hal_i2c_s_read_complate(void);







 
void hal_i2c_s_read_complate_clear(void);







 
void hal_i2c_s_set_dma_tx_cycle(_Bool enable);







 
void hal_i2c_s_set_transfer(hal_i2c_s_callback_t hal_i2c_s_callback_tmp);








 
status_t hal_i2c_s_read_data(uint8_t *rx_data);








 
status_t hal_i2c_s_write_data(const uint8_t tx_data);








 
_Bool hal_i2c_s_rxfifo_notempty(void);







 
void hal_i2c_s_set_high_impedance(void);
 





 
int hal_i2c_s_get_tx_byte_num(void);


# 14 "..\\src\\app\\demo\\app_tp_transfer.c"
# 1 "..\\src\\sdk\\include\\hal_spi_master.h"








 




# 15 "..\\src\\sdk\\include\\hal_spi_master.h"
# 16 "..\\src\\sdk\\include\\hal_spi_master.h"
# 17 "..\\src\\sdk\\include\\hal_spi_master.h"









 
void hal_spi_m_dma_init(uint32_t speed, uint8_t cpha, uint8_t cpol);









 
status_t hal_spi_m_dma_write(const uint8_t *data_buffer, size_t data_size);











 
status_t hal_spi_m_dma_read(const uint8_t *cmd, size_t cmd_size, uint8_t *data_buffer, size_t data_size);







 
_Bool hal_spi_m_get_transfer_complate(void);







 
void hal_spi_m_clear_rxfifo(void);







 
void hal_spi_m_set_high_impedance(void);




# 15 "..\\src\\app\\demo\\app_tp_transfer.c"
# 1 "..\\src\\sdk\\include\\hal_spi_slave.h"








 





 
# 1 "..\\src\\common\\tau_dsi_datatype.h"








 






 
# 18 "..\\src\\common\\tau_dsi_datatype.h"



 




 


 
typedef enum
{
    DSI_ACK_DT_ERROR                 = 0x02,
    DSI_ACK_DT_EOTP                  = 0x08,
    DSI_ACK_DT_GEN_SHORT_RESPONSE_1B = 0x11,
    DSI_ACK_DT_GEN_SHORT_RESPONSE_2B = 0x12,
    DSI_ACK_DT_GEN_LONG_RESPONSE     = 0x1A,
    DSI_ACK_DT_DSC_LONG_RESPONSE     = 0x1C,
    DSI_ACK_DT_DSC_SHORT_RESPONSE_1B = 0x21,
    DSI_ACK_DT_DSC_SHORT_RESPONSE_2B = 0x22,
    DSI_ACK_DT_MAX
} dsi_ack_data_type_e;



 
typedef enum
{
    DSI_RECV_DT_PPS                   = 0x0A,   
    DSI_RECV_DT_GEN_WRITE_1B          = 0x13,   
    DSI_RECV_DT_GEN_WRITE_2B          = 0x23,   
    DSI_RECV_DT_GEN_READ_0B           = 0x04,   
    DSI_RECV_DT_GEN_READ_1B           = 0x14,   
    DSI_RECV_DT_GEN_READ_2B           = 0x24,   
    DSI_RECV_DT_DCS_WRITE_0B          = 0x05,   
    DSI_RECV_DT_DCS_WRITE_1B          = 0x15,   
    DSI_RECV_DT_DCS_READ_0B           = 0x06,   
    DSI_RECV_DT_GEN_WRITE_LONG        = 0x29,   
    DSI_RECV_DT_DCS_WRITE_LONG        = 0x39,   
    DSI_RECV_DT_MAX
} dsi_data_type_e;

typedef enum
{
    DCS_ENTER_IDLE_MODE       = 0x39,
    DCS_ENTER_INVERT_MODE     = 0x21,
    DCS_ENTER_NORMAL_MODE     = 0x13,
    DCS_ENTER_PARTIAL_MODE    = 0x12,
    DCS_ENTER_SLEEP_MODE      = 0x10,
    DCS_EXIT_IDLE_MODE        = 0x38,
    DCS_EXIT_INVERT_MODE      = 0x20,
    DCS_EXIT_SLEEP_MODE       = 0x11,
    DCS_GET_3D_CONTROL        = 0x3F,
    DCS_GET_ADDRESS_MODE      = 0x0B,
    DCS_GET_BLUE_CHANNEL      = 0x08,
    DCS_GET_COMPRESSION_MODE  = 0x03,
    DCS_GET_DIAGNOSTIC_RESULT = 0x0F,
    DCS_GET_DISPLAY_MODE      = 0x0D,
    DCS_GET_GREEN_CHANNEL     = 0x07,
    DCS_GET_PIXEL_FORMAT      = 0x0C,
    DCS_GET_POWER_MODE        = 0x0A,
    DCS_GET_RED_CHANNEL       = 0x06,
    DCS_GET_SCANLINE          = 0x45,
    DCS_GET_SIGNAL_MODE       = 0x0E,
    DCS_NOP                   = 0x00,
    DCS_READ_DDB_CONTINUE     = 0xA8,
    DCS_READ_DDB_START        = 0xA1,
    DCS_READ_MEMORY_CONTINUE  = 0x3E,
    DCS_READ_MEMORY_START     = 0x2E,
    DCS_SET_3D_CONTROL        = 0x3D,
    DCS_SET_ADDRESS_MODE      = 0x36,
    DCS_SET_COLUMN_ADDRESS    = 0x2A,
    DCS_SET_DISPLAY_OFF       = 0x28,
    DCS_SET_DISPLAY_ON        = 0x29,
    DCS_SET_GAMMA_CURVE       = 0x26,
    DCS_SET_PAGE_ADDRESS      = 0x2B,
    DCS_SET_PARTIAL_COLUMNS   = 0x31,
    DCS_SET_PARTIAL_ROWS      = 0x30,
    DCS_SET_PIXEL_FORMAT      = 0x3A,
    DCS_SET_SCROLL_AREA       = 0x33,
    DCS_SET_SCROLL_START      = 0x37,
    DCS_SET_TEAR_OFF          = 0x34,
    DCS_SET_TEAR_ON           = 0x35,
    DCS_SET_TEAR_SCANLINE     = 0x44,
    DCS_SET_VSYNC_TIMING      = 0x40,
    DCS_SOFT_RESET            = 0x01,
    DCS_WRITE_LUT             = 0x2D,
    DCS_WRITE_MEMORY_CONTINUE = 0x3C,
    DCS_WRITE_MEMORY_START    = 0x2C
} dsi_dcs_cmd_type_e;



 
typedef enum
{
    DSI_DATA_VIDEO_MODE = 0,
    DSI_DATA_CMD_MODE   = 1,
    DSI_DATA_MODE_MAX
} dsi_video_data_mode_e;



 
typedef enum
{
    DSI_VC_0 = 0,
    DSI_VC_1 = 1,
    DSI_VC_2 = 2,
    DSI_VC_3 = 3,
    DSI_VC_MAX
} dsi_virtual_channel_e;



 
typedef enum
{
    DSI_FRAME_RATE_60HZ  = 0,
    DSI_FRAME_RATE_90HZ  = 1,
    DSI_FRAME_RATE_120HZ = 2,
    DSI_FRAME_RATE_144HZ = 3,
    DSI_FRAME_RATE_160HZ = 4,
    DSI_FRAME_RATE_MAX
} dsi_video_frame_rate_e;



 
typedef enum
{
    DSI_RGB565               = 1,
    DSI_RGB666               = 2,     
    DSI_RGB666_LOOSELY       = 3,     
    DSI_RGB888               = 4,     
    DSI_RGB10_10_10          = 5,
    DSI_RGB12_12_12          = 6,
    DSI_YCbCr422_16          = 7,
    DSI_PENTILE_16           = DSI_YCbCr422_16,
    DSI_YCbCr422_20_LOOSELY  = 8,
    DSI_YCbCr422_24          = 9,
    DSI_YCbCr420_12          = 10,
    DSI_COLOR_CODE_MAX
} dsi_color_code_e;



 
typedef enum
{
    DPI_ENDIAN_RGB = 0,
    DPI_ENDIAN_BGR
} dpi_endianness_type_e;



 
typedef enum
{
    DPI_SIG_ACTIVE_HIGH = 0,
    DPI_SIG_ACTIVE_LOW  = 1
} dpi_polarity_e;



 
typedef enum
{
    DSI_LANE_1 = 1,
    DSI_LANE_2 = 2,
    DSI_LANE_3 = 3,
    DSI_LANE_4 = 4,
    DSI_LANE_NUME_MAX
} dsi_lane_nume_e;



 
typedef enum
{
    DSI_NONBURST_PULSE = 0,
    DSI_NONBURST_EVENT = 1,
    DSI_BURST_MODE     = 2,
    DSI_VIDEO_MODE_MAX
} dsi_video_mode_type_e;



 
typedef enum
{
    DSI_CMD_TX_HS = 0,
    DSI_CMD_TX_LP = 1
} dsi_tx_cmd_tx_type_e;



 
typedef enum
{
    TX_VPG_V_COLOR = 0,
    TX_VPG_H_COLOR = 1,
    TX_VPG_V_BER   = 2,
    TX_VPG_MAX
} dsi_tx_vpg_style_e;




 
typedef enum
{
    VIDOE_ROT_ANGLE_0    = 0,  
    VIDOE_ROT_ANGLE_90   = 1,  
    VIDOE_ROT_ANGLE_180  = 2,  
    VIDOE_ROT_ANGLE_270  = 3,  
    VIDOE_ROT_ANGLE_MAX
} video_rotate_angle_e;



 
typedef enum
{
    RX_LANE_ORDER_DEFAULT = 0x0,
    RX_LANE_ORDER_3012 = RX_LANE_ORDER_DEFAULT,
    RX_LANE_ORDER_3210 = 0x1,
    RX_LANE_ORDER_MAX
} dsi_rx_lane_swap_e;



 
typedef struct
{
    _Bool     ltpo;                        
    _Bool     mirror_en;                   
    video_rotate_angle_e   rot_angle;     
    dsi_video_data_mode_e  dst_mode;      
    dsi_rx_lane_swap_e     rx_lane_swap;  
} dsi_base_extra_info_t;






 
typedef enum
{
    RX_LANE_0_PN_SWAP = 0x1,
    RX_LANE_1_PN_SWAP = 0x2,
    RX_LANE_2_PN_SWAP = 0x4,
    RX_LANE_3_PN_SWAP = 0x8,
    RX_LANE_CLK_PN_SWAP = 0x10
} dsi_rx_lane_pn_swap_e;



 
typedef enum
{
    ERR_HANDLE_NONE  = 0,
    ERR_HANDLE_L1  = 1,
    ERR_HANDLE_L2  = 2,
    ERR_HANDLE_L3  = 3,
    ERR_HANDLE_MAX
} hal_err_handle_level_e;



 
typedef struct
{
    uint32_t src_w;                      
    uint32_t src_h;                      
    uint32_t dst_w;                      
    uint32_t dst_h;                      
    dsi_video_frame_rate_e src_frate;    
    dsi_video_data_mode_e  src_mode;     
    uint16_t pn_swap;                    

    dsi_base_extra_info_t  extra_info;   

} dsi_base_trans_info_t;



 
typedef struct
{
    uint32_t coef_c00;
    uint32_t coef_c01;
    uint32_t coef_c02;
    uint32_t coef_c10;
    uint32_t coef_c11;
    uint32_t coef_c12;
    uint32_t coef_c20;
    uint32_t coef_c21;
    uint32_t coef_c22;
} ccm_coef_t;



 
typedef struct
{
    uint32_t    vsa;
    uint32_t    vbp;
    uint32_t    vact;
    uint32_t    vfp;
    uint32_t    hsa;
    uint32_t    hbp;
    uint32_t    hact;
    uint32_t    hfp;
} vid_disp_timing_t;



 
typedef struct
{
    dpi_polarity_e   vsync_active_level;    
    dpi_polarity_e   hsync_active_level;    
    dpi_polarity_e   dataen_active_level;   
    dpi_polarity_e   shutdown_active_level; 
    dpi_polarity_e   colorm_active_level;   
} dpi_polarity_t;
# 17 "..\\src\\sdk\\include\\hal_spi_slave.h"
# 18 "..\\src\\sdk\\include\\hal_spi_slave.h"



 



 




 
typedef enum
{
    SPI_EVENT_RCV_DATA            = 0,     
    SPI_EVENT_RCV_FULL,                    
    SPI_EVENT_RCV_CS_HIGH,                 
} hal_spis_event_e;

typedef struct hal_spi_packet_info_t
{
    uint8_t           *rx_buffer;           
    uint32_t           rx_buffer_size;      
    _Bool               rx_circle;           
    const uint8_t     *tx_buffer;           
    uint32_t           tx_buffer_size;      
    _Bool               tx_circle;           
    uint32_t           packet_size;         
} hal_spi_packet_info_t;

typedef void (*hal_spi_slave_cb)(hal_spis_event_e event, hal_spi_packet_info_t *packet_info);



 



 






 
_Bool hal_spi_slave_init(uint8_t cpha, uint8_t cpol, _Bool dma);





 
_Bool hal_spi_slave_deinit(void);





 
_Bool hal_spi_slave_register_callback(hal_spi_slave_cb cb);





 
_Bool hal_spi_slave_enable(void);





 
_Bool hal_spi_slave_disable(void);







 
_Bool hal_spi_slave_set_auto_rx_buffer(uint8_t *buffer, uint32_t size, _Bool circle);







 
_Bool hal_spi_slave_set_auto_tx_buffer(const uint8_t *buffer, uint32_t size, _Bool circle);





 
_Bool hal_spi_slave_auto_transfer_start(void);





 
_Bool hal_spi_slave_auto_transfer_abort(void);





 
_Bool hal_spi_slave_flush_fifo(void);







 
_Bool hal_spi_slave_reset_tx(const uint8_t *buffer, uint32_t size, _Bool circle);





 
_Bool hal_spi_slave_busy(void);





 
_Bool hal_spi_slave_get_rxfifo_notempty(void);





 
_Bool hal_spi_slave_read_data(uint32_t *data);





 
_Bool hal_spi_slave_write_data(const uint8_t data);







 
void hal_spi_s_set_high_impedance(void);



# 16 "..\\src\\app\\demo\\app_tp_transfer.c"
# 1 "..\\src\\common\\tau_log.h"








 






 
# 18 "..\\src\\common\\tau_log.h"
# 19 "..\\src\\common\\tau_log.h"
# 1 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdarg.h"
 
 
 





 










# 27 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdarg.h"








 

 
 
# 57 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdarg.h"
    typedef struct __va_list { void *__ap; } va_list;

   






 


   










 


   















 




   

 


   




 



   





 








      
     typedef  va_list __gnuc_va_list;






# 147 "C:\\Keil_v5\\ARM\\ARMCC\\Bin\\..\\include\\stdarg.h"

 

# 20 "..\\src\\common\\tau_log.h"
# 1 "..\\src\\sdk\\include\\M0\\ArmCM0.h"
 





 
















 









 

typedef enum IRQn
{
     
    NonMaskableInt_IRQn           = -14,      
    HardFault_IRQn                = -13,      
    SVCall_IRQn                   =  -5,      
    PendSV_IRQn                   =  -2,      
    SysTick_IRQn                  =  -1,      

     
    VIDC_IRQn                     =   0,
    LCDC_IRQn                     =   1,
    MIPI_RX_IRQn                  =   2,
    MIPI_TX_IRQn                  =   3,
    MEMC_IRQn                     =   4,
    VPRE_IRQn                     =   5,
    FLSCTRL_IRQn                  =   6,
    DMA_IRQn                      =   7,
    TIMER0_IRQn                   =   8,
    TIMER1_IRQn                   =   9,
    TIMER2_IRQn                   =   10,
    TIMER3_IRQn                   =   11,
    WDG_IRQn                      =   12,
    UART_IRQn                     =   13,
    I2C0_IRQn                     =   14,
    I2C1_IRQn                     =   15,
    SPIS_IRQn                     =   16,
    SPIM_IRQn                     =   17,
    ADC_IRQn                      =   18,
    PWMDET_IRQn                   =   19,
    OTP_IRQn                      =   20,
    SWIRE_IRQn                    =   21,
    PVD_IRQn                      =   22,
    AP_NRESET_IRQn                =   23,
    EXTI_INT0_IRQn                =   24,
    EXTI_INT1_IRQn                =   25,
    EXTI_INT2_IRQn                =   26,
    EXTI_INT3_IRQn                =   27,
    EXTI_INT4_IRQn                =   28,
    EXTI_INT5_IRQn                =   29,
    EXTI_INT6_IRQn                =   30,
    EXTI_INT7_IRQn                =   31
                                       
} IRQn_Type;




 
 
 

 

#pragma push
#pragma anon_unions
# 109 "..\\src\\sdk\\include\\M0\\ArmCM0.h"

 

















# 1 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\core_cm0.h"
 




 
















 










# 35 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\core_cm0.h"

















 




 



 

# 1 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_version.h"
 




 
















 










 
# 64 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\core_cm0.h"
 
 









 







# 114 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\core_cm0.h"

# 1 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_compiler.h"
 




 
















 




# 29 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_compiler.h"



 
# 1 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"
 




 
















 









 













   
   

 




 
# 107 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"

 



 





 
 






 
 





 
static __inline uint32_t __get_CONTROL(void)
{
  register uint32_t __regControl         __asm("control");
  return(__regControl);
}






 
static __inline void __set_CONTROL(uint32_t control)
{
  register uint32_t __regControl         __asm("control");
  __regControl = control;
}






 
static __inline uint32_t __get_IPSR(void)
{
  register uint32_t __regIPSR          __asm("ipsr");
  return(__regIPSR);
}






 
static __inline uint32_t __get_APSR(void)
{
  register uint32_t __regAPSR          __asm("apsr");
  return(__regAPSR);
}






 
static __inline uint32_t __get_xPSR(void)
{
  register uint32_t __regXPSR          __asm("xpsr");
  return(__regXPSR);
}






 
static __inline uint32_t __get_PSP(void)
{
  register uint32_t __regProcessStackPointer  __asm("psp");
  return(__regProcessStackPointer);
}






 
static __inline void __set_PSP(uint32_t topOfProcStack)
{
  register uint32_t __regProcessStackPointer  __asm("psp");
  __regProcessStackPointer = topOfProcStack;
}






 
static __inline uint32_t __get_MSP(void)
{
  register uint32_t __regMainStackPointer     __asm("msp");
  return(__regMainStackPointer);
}






 
static __inline void __set_MSP(uint32_t topOfMainStack)
{
  register uint32_t __regMainStackPointer     __asm("msp");
  __regMainStackPointer = topOfMainStack;
}






 
static __inline uint32_t __get_PRIMASK(void)
{
  register uint32_t __regPriMask         __asm("primask");
  return(__regPriMask);
}






 
static __inline void __set_PRIMASK(uint32_t priMask)
{
  register uint32_t __regPriMask         __asm("primask");
  __regPriMask = (priMask);
}


# 342 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"






 
static __inline uint32_t __get_FPSCR(void)
{





   return(0U);

}






 
static __inline void __set_FPSCR(uint32_t fpscr)
{





  (void)fpscr;

}


 


 



 




 






 







 






 








 










 










 






                  





 








 

__attribute__((section(".rev16_text"))) static __inline __asm uint32_t __REV16(uint32_t value)
{
  rev16 r0, r0
  bx lr
}








 

__attribute__((section(".revsh_text"))) static __inline __asm int16_t __REVSH(int16_t value)
{
  revsh r0, r0
  bx lr
}









 









 








 




__attribute__((always_inline)) static __inline uint32_t __RBIT(uint32_t value)
{
  uint32_t result;
  uint32_t s = (4U   * 8U) - 1U;  

  result = value;                       
  for (value >>= 1U; value != 0U; value >>= 1U)
  {
    result <<= 1U;
    result |= value & 1U;
    s--;
  }
  result <<= s;                         
  return result;
}








 



# 732 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"







 
__attribute__((always_inline)) static __inline int32_t __SSAT(int32_t val, uint32_t sat)
{
  if ((sat >= 1U) && (sat <= 32U))
  {
    const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
    const int32_t min = -1 - max ;
    if (val > max)
    {
      return max;
    }
    else if (val < min)
    {
      return min;
    }
  }
  return val;
}







 
__attribute__((always_inline)) static __inline uint32_t __USAT(int32_t val, uint32_t sat)
{
  if (sat <= 31U)
  {
    const uint32_t max = ((1U << sat) - 1U);
    if (val > (int32_t)max)
    {
      return max;
    }
    else if (val < 0)
    {
      return 0U;
    }
  }
  return (uint32_t)val;
}




   


 



 

# 866 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_armcc.h"
 


# 35 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_compiler.h"




 
# 268 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\cmsis_compiler.h"




# 116 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\core_cm0.h"

















 
# 150 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\core_cm0.h"

 






 
# 166 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\core_cm0.h"

 




 










 



 






 



 
typedef union
{
  struct
  {
    uint32_t _reserved0:28;               
    uint32_t V:1;                         
    uint32_t C:1;                         
    uint32_t Z:1;                         
    uint32_t N:1;                         
  } b;                                    
  uint32_t w;                             
} APSR_Type;

 















 
typedef union
{
  struct
  {
    uint32_t ISR:9;                       
    uint32_t _reserved0:23;               
  } b;                                    
  uint32_t w;                             
} IPSR_Type;

 






 
typedef union
{
  struct
  {
    uint32_t ISR:9;                       
    uint32_t _reserved0:15;               
    uint32_t T:1;                         
    uint32_t _reserved1:3;                
    uint32_t V:1;                         
    uint32_t C:1;                         
    uint32_t Z:1;                         
    uint32_t N:1;                         
  } b;                                    
  uint32_t w;                             
} xPSR_Type;

 





















 
typedef union
{
  struct
  {
    uint32_t _reserved0:1;                
    uint32_t SPSEL:1;                     
    uint32_t _reserved1:30;               
  } b;                                    
  uint32_t w;                             
} CONTROL_Type;

 



 







 



 
typedef struct
{
  volatile uint32_t ISER[1U];                
        uint32_t RESERVED0[31U];
  volatile uint32_t ICER[1U];                
        uint32_t RESERVED1[31U];
  volatile uint32_t ISPR[1U];                
        uint32_t RESERVED2[31U];
  volatile uint32_t ICPR[1U];                
        uint32_t RESERVED3[31U];
        uint32_t RESERVED4[64U];
  volatile uint32_t IP[8U];                  
}  NVIC_Type;

 







 



 
typedef struct
{
  volatile const  uint32_t CPUID;                   
  volatile uint32_t ICSR;                    
        uint32_t RESERVED0;
  volatile uint32_t AIRCR;                   
  volatile uint32_t SCR;                     
  volatile uint32_t CCR;                     
        uint32_t RESERVED1;
  volatile uint32_t SHP[2U];                 
  volatile uint32_t SHCSR;                   
} SCB_Type;

 















 



























 















 









 






 



 







 



 
typedef struct
{
  volatile uint32_t CTRL;                    
  volatile uint32_t LOAD;                    
  volatile uint32_t VAL;                     
  volatile const  uint32_t CALIB;                   
} SysTick_Type;

 












 



 



 









 








 
 







 






 







 


 







 

 










 









 


 



 





 

# 583 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\core_cm0.h"
 





# 598 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\CMSIS\\Core\\Include\\core_cm0.h"




 





 
 












 
static __inline void __NVIC_EnableIRQ(IRQn_Type IRQn)
{
  if ((int32_t)(IRQn) >= 0)
  {
    ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  }
}









 
static __inline uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
{
  if ((int32_t)(IRQn) >= 0)
  {
    return((uint32_t)(((((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  }
  else
  {
    return(0U);
  }
}







 
static __inline void __NVIC_DisableIRQ(IRQn_Type IRQn)
{
  if ((int32_t)(IRQn) >= 0)
  {
    ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
    do { __schedule_barrier(); __dsb(0xF); __schedule_barrier(); } while (0U);
    do { __schedule_barrier(); __isb(0xF); __schedule_barrier(); } while (0U);
  }
}









 
static __inline uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
{
  if ((int32_t)(IRQn) >= 0)
  {
    return((uint32_t)(((((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
  }
  else
  {
    return(0U);
  }
}







 
static __inline void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
{
  if ((int32_t)(IRQn) >= 0)
  {
    ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  }
}







 
static __inline void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
{
  if ((int32_t)(IRQn) >= 0)
  {
    ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
  }
}










 
static __inline void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
{
  if ((int32_t)(IRQn) >= 0)
  {
    ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->IP[( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )]  = ((uint32_t)(((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->IP[( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )]  & ~(0xFFUL << ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL))) |
       (((priority << (8U - 2U)) & (uint32_t)0xFFUL) << ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL)));
  }
  else
  {
    ((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->SHP[( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )] = ((uint32_t)(((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->SHP[( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )] & ~(0xFFUL << ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL))) |
       (((priority << (8U - 2U)) & (uint32_t)0xFFUL) << ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL)));
  }
}










 
static __inline uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
{

  if ((int32_t)(IRQn) >= 0)
  {
    return((uint32_t)(((((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->IP[ ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )] >> ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) ) & (uint32_t)0xFFUL) >> (8U - 2U)));
  }
  else
  {
    return((uint32_t)(((((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->SHP[( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )] >> ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) ) & (uint32_t)0xFFUL) >> (8U - 2U)));
  }
}












 
static __inline uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
{
  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);    
  uint32_t PreemptPriorityBits;
  uint32_t SubPriorityBits;

  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(2U)) ? (uint32_t)(2U) : (uint32_t)(7UL - PriorityGroupTmp);
  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(2U)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(2U));

  return (
           ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
           ((SubPriority     & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL)))
         );
}












 
static __inline void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
{
  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);    
  uint32_t PreemptPriorityBits;
  uint32_t SubPriorityBits;

  PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(2U)) ? (uint32_t)(2U) : (uint32_t)(7UL - PriorityGroupTmp);
  SubPriorityBits     = ((PriorityGroupTmp + (uint32_t)(2U)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(2U));

  *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);
}











 
static __inline void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
{
  uint32_t vectors = 0x0U;
  (* (int *) (vectors + ((int32_t)IRQn + 16) * 4)) = vector;
}









 
static __inline uint32_t __NVIC_GetVector(IRQn_Type IRQn)
{
  uint32_t vectors = 0x0U;
  return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + 16) * 4));
}





 
__declspec(noreturn) static __inline void __NVIC_SystemReset(void)
{
  do { __schedule_barrier(); __dsb(0xF); __schedule_barrier(); } while (0U);                                                          
 
  ((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->AIRCR  = ((0x5FAUL << 16U) |
                 (1UL << 2U));
  do { __schedule_barrier(); __dsb(0xF); __schedule_barrier(); } while (0U);                                                           

  for(;;)                                                            
  {
    __nop();
  }
}

 


 





 








 
static __inline uint32_t SCB_GetFPUType(void)
{
    return 0U;            
}


 



 





 













 
static __inline uint32_t SysTick_Config(uint32_t ticks)
{
  if ((ticks - 1UL) > (0xFFFFFFUL ))
  {
    return (1UL);                                                    
  }

  ((SysTick_Type *) ((0xE000E000UL) + 0x0010UL) )->LOAD  = (uint32_t)(ticks - 1UL);                          
  __NVIC_SetPriority (SysTick_IRQn, (1UL << 2U) - 1UL);  
  ((SysTick_Type *) ((0xE000E000UL) + 0x0010UL) )->VAL   = 0UL;                                              
  ((SysTick_Type *) ((0xE000E000UL) + 0x0010UL) )->CTRL  = (1UL << 2U) |
                   (1UL << 1U)   |
                   (1UL );                          
  return (0UL);                                                      
}



 










# 129 "..\\src\\sdk\\include\\M0\\ArmCM0.h"
# 1 "C:\\Users\\Markin\\AppData\\Local\\Arm\\Packs\\ARM\\CMSIS\\5.5.1\\Device\\ARM\\ARMCM0\\Include\\system_ARMCM0.h"
 





 
















 








extern uint32_t SystemCoreClock;      






 
extern void SystemInit (void);






 
extern void SystemCoreClockUpdate (void);





# 130 "..\\src\\sdk\\include\\M0\\ArmCM0.h"



 





 
# 150 "..\\src\\sdk\\include\\M0\\ArmCM0.h"

 

#pragma pop
# 169 "..\\src\\sdk\\include\\M0\\ArmCM0.h"


 
# 194 "..\\src\\sdk\\include\\M0\\ArmCM0.h"

 
# 206 "..\\src\\sdk\\include\\M0\\ArmCM0.h"





# 21 "..\\src\\common\\tau_log.h"



 









 
# 46 "..\\src\\common\\tau_log.h"


# 54 "..\\src\\common\\tau_log.h"

# 62 "..\\src\\common\\tau_log.h"



 
typedef enum
{
    kLOG_LEVEL_DBG = 0,
    kLOG_LEVEL_INF,
    kLOG_LEVEL_ERR,
    kLOG_LEVEL_NONE       
} log_level_t;



 



 
void LOG_printf(const char *fmt, ...);

# 17 "..\\src\\app\\demo\\app_tp_transfer.c"
# 1 "..\\src\\common\\tau_delay.h"














 
# 19 "..\\src\\common\\tau_delay.h"





 
void delayMs(uint32_t ms);





 
void delayUs(uint32_t us);

# 18 "..\\src\\app\\demo\\app_tp_transfer.c"


uint8_t read_point;							
uint8_t s_screen_number[2];
uint8_t s_screen_temp[2];

static uint8_t s_screen_read_buffer[200];
static uint8_t s_phone_read_buffer[200];

static _Bool    s_spim_write = 0;                   
static _Bool    s_screen_int_flag = 0;              
static _Bool    s_phone_reset_flag = 0;             
static _Bool    s_screen_int_transfer_status = 0;   
_Bool    s_screen_init_complate = 0;                
static uint8_t s_screen_const_transfer_count = 0xff;   

st_tp_scan_data  tp_scan_data;





static uint8_t g_clk_cnt = 0;

static void app_tp_transfer_phone(size_t recieve_num);


    static void app_tp_i2cs_callback(e_i2c_s_int_status int_status, size_t recieve_num);






uint8_t MI10_PRO_screen_init_data0[3] = {0xA0,0x00,0x00}; 
uint8_t MI10_PRO_screen_init_data1[3] = {0xA0,0x00,0x01}; 
uint8_t MI10_PRO_screen_init_data2[6] = {0xA2,0x03,0x00,0x00,0x00,0x03};
uint8_t MI10_PRO_screen_init_data3[3] = {0xA2,0x02,0x00};
uint8_t MI10_PRO_screen_init_data4[3] = {0xC0,0x07,0x01};

uint8_t MI10_PRO_screen_init_data5[3] = {0xA4,0x06,0x70};
uint8_t MI10_PRO_screen_init_data6[3] = {0xA6,0x00,0x00};
uint8_t MI10_PRO_screen_init_data7[5] = {0xFA,0x20,0x00,0x00,0x78};

uint8_t MI10_PRO_screen_init_data8[6] = {0xA2,0x03,0x20,0x00,0x00,0x00};
uint8_t MI10_PRO_screen_init_data9[2] = {0xA0,0x01};
uint8_t MI10_PRO_screen_init_data10[3] = {0xA0,0x00,0x00};
uint8_t MI10_PRO_screen_init_data11[3] = {0xA4,0x00,0x05};



uint8_t MI10_PRO_TP_Tuning_data1[3] = {0xA4,0x00,0x00};		  
uint8_t MI10_PRO_TP_Tuning_data2[3] = {0xA4,0x00,0x03}; 		  
uint8_t MI10_PRO_TP_Tuning_data3[3] = {0xA4,0x00,0x02}; 		  
uint8_t MI10_PRO_TP_Tuning_data4[4] = {0xA4,0x03,0x13,0x00};  
uint8_t MI10_PRO_TP_Tuning_data5[4] = {0xA4,0x03,0x0C,0x00};	 
uint8_t MI10_PRO_TP_Tuning_data6[3] = {0xA4,0x05,0x01}; 		 
uint8_t MI10_PRO_TP_Tuning_data7[3] = {0xA4,0x05,0x02}; 		 
uint8_t MI10_PRO_TP_Tuning_data8[3] = {0xA4,0x05,0x04}; 		 
uint8_t MI10_PRO_TP_Tuning_data9[3] = {0xA4,0x00,0x01};		  








 
static void app_tp_screen_int_callback(void *data)
{
    s_screen_int_flag = 1;
}







 
static _Bool app_tp_screen_int_lvl_low(void)
{
	uint8_t i = 1;
	uint8_t j = 1;	











    return !hal_gpio_get_input_data(g_screen_input_int_pad);





}







 
static void app_tp_screen_int_init(void)
{
    hal_gpio_set_pull_state(g_screen_input_int_pad, ENABLE, DISABLE);         
    hal_gpio_ctrl_eint(g_screen_input_int_pad, DISABLE);                      
    hal_gpio_init_eint(g_screen_input_int_pad, DETECT_FALLING_EDGE);          
    hal_gpio_reg_eint_cb(g_screen_input_int_pad, app_tp_screen_int_callback); 
    hal_gpio_ctrl_eint(g_screen_input_int_pad, ENABLE);                       
}

# 161 "..\\src\\app\\demo\\app_tp_transfer.c"







 
void app_tp_screen_init(void)
{
    hal_gpio_init_output(g_screen_input_rst_pad, IO_LVL_HIGH);
    delayUs(200);
    hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_LOW);
    delayUs(200);
    hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_HIGH);
}

void app_tp_I2C_init(void)
{
    hal_i2c_s_init(0x48, I2C_ADDR_BITS_7);
    hal_i2c_s_set_transfer(app_tp_i2cs_callback);
    hal_i2c_s_nonblocking_read(s_phone_read_buffer, 200); 
}










 
void app_tp_init(void)
{
# 206 "..\\src\\app\\demo\\app_tp_transfer.c"
	hal_gpio_set_pull_state(IO_PAD_TD_SPIM_CLK, ENABLE, DISABLE);
	hal_gpio_set_pull_state(IO_PAD_TD_SPIM_CSN, ENABLE, DISABLE);	


    app_tp_screen_init();                                        


	hal_gpio_init_output(g_phone_output_int_pad, IO_LVL_LOW);	  



    hal_gpio_init_input(g_screen_input_int_pad);



    hal_i2c_m_dma_init(0x49, I2C_ADDR_BITS_7, 400000);








# 243 "..\\src\\app\\demo\\app_tp_transfer.c"
}








 
_Bool app_tp_m_transfer_complate(void)
{

    return hal_i2c_m_transfer_complate();





}







 
_Bool app_tp_s_transfer_complate(void)
{

    return hal_i2c_s_write_complate() && hal_i2c_s_read_complate();





}








 
static void app_tp_m_write(const uint8_t *txbuffer, size_t buffer_size)
{

    hal_i2c_m_dma_write(txbuffer, buffer_size);




}










 
static void app_tp_m_read(const uint8_t *cmd, size_t cmd_size, uint8_t *data_buffer, size_t data_size)
{

    uint8_t i = 0;
    uint32_t address = 0;

    for (i = 0; i < cmd_size; i++)                          
    {
        address |= (uint32_t)cmd[i] << i * 8;
    }
    hal_i2c_m_dma_read(address, cmd_size, data_buffer, data_size);



}








 
void app_tp_s_write(const uint8_t *txbuffer, size_t buffer_size)
{

    hal_i2c_s_dma_write(txbuffer, buffer_size);
# 345 "..\\src\\app\\demo\\app_tp_transfer.c"
}








 
void app_tp_s_read(void *rxBuffer, size_t data_size)
{

    hal_i2c_s_nonblocking_read(rxBuffer, data_size);

}







 



static void app_tp_i2cs_callback(e_i2c_s_int_status int_status, size_t recieve_num)
{
# 382 "..\\src\\app\\demo\\app_tp_transfer.c"
    app_tp_transfer_phone(recieve_num);
}








 
# 399 "..\\src\\app\\demo\\app_tp_transfer.c"

# 418 "..\\src\\app\\demo\\app_tp_transfer.c"


void S20_Start_init(void)
{
	uint8_t len=0;
	uint8_t temp=0;
	uint8_t temp_start_flag=0;	
	
	{
		app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
		while(!hal_i2c_m_transfer_complate());		
		delayMs(2);			
		while(!hal_gpio_get_input_data(g_screen_input_int_pad))
		{
			app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
			while(!hal_i2c_m_transfer_complate());		
			delayMs(2);
		}
		temp=s_screen_read_buffer[0]&0xf0;
    if((temp==0x10)||(temp==0x20)||(temp==0x30))
		{
		 temp_start_flag=1;
		}
		if(temp_start_flag==0)
		{
		app_tp_m_write(MI10_PRO_screen_init_data1, sizeof(MI10_PRO_screen_init_data1));
		while(!hal_i2c_m_transfer_complate());
		delayMs(1);
		app_tp_m_write(MI10_PRO_screen_init_data2, sizeof(MI10_PRO_screen_init_data2));
		while(!hal_i2c_m_transfer_complate());
		delayMs(1);		
		app_tp_m_write(MI10_PRO_screen_init_data3, sizeof(MI10_PRO_screen_init_data3));
		while(!hal_i2c_m_transfer_complate());
		delayMs(1);	
		app_tp_m_write(MI10_PRO_screen_init_data4, sizeof(MI10_PRO_screen_init_data4));
		while(!hal_i2c_m_transfer_complate());
		delayMs(1);		
		app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
		while(!hal_i2c_m_transfer_complate());
		if(s_screen_read_buffer[7]>0)
		{
			len=s_screen_read_buffer[7]*8;
			app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, len);
			while(!hal_i2c_m_transfer_complate());		
		}
	  }

		if(hal_gpio_get_input_data(g_screen_input_int_pad))
		{
			s_screen_init_complate = 1;
			app_tp_screen_int_init();
			phone_start_flag=0;
		}
	}
}











 
static void app_tp_transfer_screen_const(void)
{

	uint8_t ii;

     
# 507 "..\\src\\app\\demo\\app_tp_transfer.c"


    if (app_tp_m_transfer_complate() && (s_screen_const_transfer_count < screen_reg_start_data_size))
    {
        if (s_spim_write)                                                
        {
            hal_spi_m_clear_rxfifo();
            s_spim_write = 0;
        }


		
















		

	
		if(phone_start_flag==1)
		{
			S20_Start_init();
		}

	
# 552 "..\\src\\app\\demo\\app_tp_transfer.c"
		
# 582 "..\\src\\app\\demo\\app_tp_transfer.c"
    }
}







 

void ap_tp_calibration(void)
{
	
	
	
	app_tp_m_write(MI10_PRO_TP_Tuning_data2, sizeof(MI10_PRO_TP_Tuning_data2));     
	while(!hal_i2c_m_transfer_complate());
	delayMs(1);
	app_tp_m_write(MI10_PRO_TP_Tuning_data3, sizeof(MI10_PRO_TP_Tuning_data3));     
	while(!hal_i2c_m_transfer_complate());
	delayMs(1);
	app_tp_m_write(MI10_PRO_TP_Tuning_data4, sizeof(MI10_PRO_TP_Tuning_data4));    
	while(!hal_i2c_m_transfer_complate());
	delayMs(1);
	app_tp_m_write(MI10_PRO_TP_Tuning_data5, sizeof(MI10_PRO_TP_Tuning_data5));    
	while(!hal_i2c_m_transfer_complate());
	delayMs(1);
	app_tp_m_write(MI10_PRO_TP_Tuning_data6, sizeof(MI10_PRO_TP_Tuning_data6));    
	while(!hal_i2c_m_transfer_complate());
	delayMs(1);
	app_tp_m_write(MI10_PRO_TP_Tuning_data7, sizeof(MI10_PRO_TP_Tuning_data7));    
	while(!hal_i2c_m_transfer_complate());
	delayMs(1);
	app_tp_m_write(MI10_PRO_TP_Tuning_data8, sizeof(MI10_PRO_TP_Tuning_data8));    
	while(!hal_i2c_m_transfer_complate());
	delayMs(1);
}


void ap_tp_scan_point_init(void)
{
	uint8_t i=0;
	
	for(i=0;i<6;i++)
	tp_scan_data.tp_point_buffer[i] = 0;
	tp_scan_data.tp_point_up_error_flag = 0;
	tp_scan_data.tp_read_point_counter = 0;
	tp_scan_data.tp_point_error_time_counter = 0;
}


void ap_tp_simulate_finger_release_event(void)
{
	uint8_t i,temp=0,ap_tp_release_buf[8] = {0x33,0x01,0x00,0x00,0x00,0x00,0x00,0x00};

	for(i=0;i<5;i++)
	{
		temp = i;
		ap_tp_release_buf[1] = (temp<<4)|0x01;
		
		app_tp_screen_analysis_int(0, ap_tp_release_buf,8);

		delayMs(6);
	}
}


void ap_tp_system_softReset(void)
{
	
	do { if (kLOG_LEVEL_DBG <= kLOG_LEVEL_DBG) { LOG_printf("[%s] (%04d) " "ap_tp_system_softReset \n", "tau_log", 653); }; } while (0);
	ap_tp_simulate_finger_release_event();
	ap_tp_scan_point_init();
	
	



	app_tp_m_write(MI10_PRO_TP_Tuning_data9, sizeof(MI10_PRO_TP_Tuning_data9));
	while(!hal_i2c_m_transfer_complate());
	delayMs(10);	
	
	app_tp_m_write(MI10_PRO_screen_init_data1, sizeof(MI10_PRO_screen_init_data1));
	while(!hal_i2c_m_transfer_complate());
	delayMs(10);
	

}








 
void app_tp_transfer_screen_start(void)
{
    s_screen_init_complate = 0;
    s_screen_const_transfer_count = 0;
    

    app_tp_transfer_screen_const();

	s_screen_int_flag = 0;
}








 
void app_tp_screen_reset(void)
{
	
	
 
		ap_tp_simulate_finger_release_event();
	  ap_tp_scan_point_init();
	  hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_HIGH);
    delayMs(5);
    hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_LOW);
    delayMs(10);
    hal_gpio_set_output_data(g_screen_input_rst_pad, IO_LVL_HIGH);
		delayMs(5);

		app_tp_m_write(MI10_PRO_screen_init_data11, sizeof(MI10_PRO_screen_init_data11));
		while(!hal_i2c_m_transfer_complate());
		delayMs(10);

		app_tp_m_write(MI10_PRO_TP_Tuning_data9, sizeof(MI10_PRO_TP_Tuning_data9));
		while(!hal_i2c_m_transfer_complate());
		delayMs(5);		
		app_tp_m_write(MI10_PRO_screen_init_data0, sizeof(MI10_PRO_screen_init_data0));
		while(!hal_i2c_m_transfer_complate());
		delayMs(5);
	  app_tp_m_write(MI10_PRO_screen_init_data1, sizeof(MI10_PRO_screen_init_data1));
		while(!hal_i2c_m_transfer_complate());
		delayMs(5);

	
	
	



	
	
	
	
}









 
void app_tp_transfer_screen_int(void)
{
	uint8_t len=0;
	uint8_t temp_len=0;
	_Bool screen_gpio_int = 0;
	static uint8_t screen_int_transfer_count = 0;            
	static _Bool    screen_int_transfer_buffer_ready = 1;  
	
	
    if (!s_screen_init_complate)                             
    {

        app_tp_transfer_screen_const();
			
        return;
    }


     
    
    
    screen_gpio_int = s_screen_int_flag || app_tp_screen_int_lvl_low();
    if (screen_gpio_int)
    {
      s_screen_int_flag = 0;
		
		app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 5*8);
		while(!hal_i2c_m_transfer_complate());
	






 
# 793 "..\\src\\app\\demo\\app_tp_transfer.c"
		delayMs(2);
				
		if(s_screen_read_buffer[0] == 0xF3)  
		{


			 			app_tp_screen_reset();		




  
		 
		  	delayMs(5);    
	
			do { if (kLOG_LEVEL_DBG <= kLOG_LEVEL_DBG) { LOG_printf("[%s] (%04d) " "TP system reset 0\n", "tau_log", 808); }; } while (0);
			return;
		}
		else if(s_screen_read_buffer[1] == 0xFF && s_screen_read_buffer[2] == 0xFF&& s_screen_read_buffer[3] == 0xFF&&s_screen_read_buffer[4] == 0xFF)
		{
		 app_tp_screen_reset();	
	
			delayMs(10);
		
			do { if (kLOG_LEVEL_DBG <= kLOG_LEVEL_DBG) { LOG_printf("[%s] (%04d) " "TP system reset ff 0\n", "tau_log", 817); }; } while (0);
			return;
		}
		
		while(!hal_gpio_get_input_data(g_screen_input_int_pad))
		{
		app_tp_m_read(screen_reg_int_data[0].buffer, 1, s_screen_read_buffer, 8);
		while(!hal_i2c_m_transfer_complate());		
		delayUs(100);
		if(s_screen_read_buffer[7]>0)
		{
		 len=s_screen_read_buffer[7]*8;
		  app_tp_m_read(screen_reg_int_data[0].buffer, 1, &s_screen_read_buffer[8], len);
		  while(!hal_i2c_m_transfer_complate());
    delayUs(100);			
		}		

			if(s_screen_read_buffer[0] == 0xF3 )  
			{
			
			app_tp_screen_reset();
			 	delayMs(10);
				do { if (kLOG_LEVEL_DBG <= kLOG_LEVEL_DBG) { LOG_printf("[%s] (%04d) " "TP system reset 1\n", "tau_log", 839); }; } while (0);
				return;
			}		
		}

			
			if(s_screen_read_buffer[0] == 0xF3 && s_screen_read_buffer[1] == 0x02 && s_screen_read_buffer[2] == 0x00)  
			{
			
				app_tp_screen_reset();
				do { if (kLOG_LEVEL_DBG <= kLOG_LEVEL_DBG) { LOG_printf("[%s] (%04d) " "TP system reset 2\n", "tau_log", 849); }; } while (0);
				return;
			}
			else
			{	
	
			}		
			screen_int_transfer_buffer_ready = 1;
			screen_int_transfer_count = app_tp_screen_analysis_int(screen_int_transfer_count, s_screen_read_buffer,screen_reg_int_data[2].rxbuffer_size);
			screen_int_transfer_count = 0;
			s_screen_int_transfer_status = 0;
    }
}









 
static void app_tp_transfer_phone(size_t recieve_num)
{
    const uint8_t *phone_write_buffer;
    size_t phone_write_buffer_size = 0;
     
    if (recieve_num > 0)
    {




        app_tp_phone_analysis_data(s_phone_read_buffer, recieve_num, &phone_write_buffer, &phone_write_buffer_size);
    }

    app_tp_s_read(s_phone_read_buffer, 200);
    if (phone_write_buffer_size)                                      
    {
        app_tp_s_write(phone_write_buffer, phone_write_buffer_size);
    }
}







 
_Bool app_tp_phone_reset_on(void)
{
    return s_phone_reset_flag;
}







 
void app_tp_phone_clear_reset_on(void)
{
    s_phone_reset_flag = 0;
}

# 960 "..\\src\\app\\demo\\app_tp_transfer.c"

