⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd.i

📁 mp3量不要让站长把时间都花费在为您修正说明上。压缩包解压时不能有密码。系统会自动删除debug和release目录
💻 I
📖 第 1 页 / 共 2 页
字号:






#line 934 "C:\\Keil\\ARM\\RV31\\INC\\stdio.h"



 
#line 8 "global.h"
#line 1 "C:\\Keil\\ARM\\RV31\\INC\\ctype.h"
 
 
 
 





 






 







#line 32 "C:\\Keil\\ARM\\RV31\\INC\\ctype.h"






#line 46 "C:\\Keil\\ARM\\RV31\\INC\\ctype.h"

 
#line 56 "C:\\Keil\\ARM\\RV31\\INC\\ctype.h"

 
 









 
#line 78 "C:\\Keil\\ARM\\RV31\\INC\\ctype.h"





#line 130 "C:\\Keil\\ARM\\RV31\\INC\\ctype.h"

extern __declspec(__nothrow) __pure unsigned char **__rt_ctype_table(void);







    extern int (isalnum)(int  );

     





    extern int (isalpha)(int  );

     





    extern int (iscntrl)(int  );

     
     

 




    extern int (isdigit)(int  );

     

    extern int (isblank)(int  );
     
     
     





    extern int (isgraph)(int  );

     





    extern int (islower)(int  );

     





    extern int (isprint)(int  );

     
     





    extern int (ispunct)(int  );

     





    extern int (isspace)(int  );

     





    extern int (isupper)(int  );

     

 
 

__inline int __isxdigit_helper(int __t) { return (__t ^ (__t << 2)); }




    extern int (isxdigit)(int  );

     



extern int tolower(int  );
     
     

extern int toupper(int  );
     
     







#line 269 "C:\\Keil\\ARM\\RV31\\INC\\ctype.h"



 
#line 9 "global.h"
#line 1 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"
 
 
 




 
 



 












  


 








#line 45 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"


  
  typedef unsigned int size_t;










    



    typedef unsigned short wchar_t;  
#line 74 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"

typedef struct div_t { int quot, rem; } div_t;
    
typedef struct ldiv_t { long int quot, rem; } ldiv_t;
    

typedef struct lldiv_t { __int64 quot, rem; } lldiv_t;
    


#line 95 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"
   



 

   




 
#line 114 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"
   


 
extern __declspec(__nothrow) int __aeabi_MB_CUR_MAX(void);

   




 

extern __declspec(__nothrow) double atof(const char *  );
   



 
extern __declspec(__nothrow) int atoi(const char *  );
   



 
extern __declspec(__nothrow) long int atol(const char *  );
   



 

extern __declspec(__nothrow) __int64 atoll(const char *  );
   



 


extern __declspec(__nothrow) double strtod(const char * __restrict  , char ** __restrict  );
   

















 

extern __declspec(__nothrow) float strtof(const char * __restrict  , char ** __restrict  );
extern __declspec(__nothrow) long double strtold(const char * __restrict  , char ** __restrict  );
   

 

extern __declspec(__nothrow) long int strtol(const char * __restrict  ,
                        char ** __restrict  , int  );
   



























 
extern __declspec(__nothrow) unsigned long int strtoul(const char * __restrict  ,
                                       char ** __restrict  , int  );
   


























 

 
extern __declspec(__nothrow) __int64 strtoll(const char * __restrict  ,
                               char ** __restrict  , int  );
   




 
extern __declspec(__nothrow) unsigned __int64 strtoull(const char * __restrict  ,
                                         char ** __restrict  , int  );
   



 

extern __declspec(__nothrow) int rand(void);
   







 
extern __declspec(__nothrow) void srand(unsigned int  );
   






 

extern __declspec(__nothrow) void *calloc(size_t  , size_t  );
   



 
extern __declspec(__nothrow) void free(void *  );
   





 
extern __declspec(__nothrow) void *malloc(size_t  );
   



 
extern __declspec(__nothrow) void *realloc(void *  , size_t  );
   













 
typedef int (*__heapprt)(void *, char const *, ...);
extern __declspec(__nothrow) void __heapstats(int (*  )(void *  ,
                                           char const *  , ...),
                        void *  );
   










 
extern __declspec(__nothrow) int __heapvalid(int (*  )(void *  ,
                                           char const *  , ...),
                       void *  , int  );
   














 
extern __declspec(__nothrow) __declspec(__noreturn) void abort(void);
   







 

extern __declspec(__nothrow) int atexit(void (*  )(void));
   




 
#line 379 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"


extern __declspec(__nothrow) __declspec(__noreturn) void exit(int  );
   












 

extern __declspec(__nothrow) __declspec(__noreturn) void _Exit(int  );
   







      

extern __declspec(__nothrow) char *getenv(const char *  );
   









 

extern __declspec(__nothrow) int  system(const char *  );
   









 

extern  void *bsearch(const void *  , const void *  ,
              size_t  , size_t  ,
              int (*  )(const void *, const void *));
   












 
#line 463 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"


extern  void qsort(void *  , size_t  , size_t  ,
           int (*  )(const void *, const void *));
   









 

#line 489 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"

extern __declspec(__nothrow) __pure int abs(int  );
   



 

extern __declspec(__nothrow) __pure div_t div(int  , int  );
   









 
extern __declspec(__nothrow) __pure long int labs(long int  );
   



 




extern __declspec(__nothrow) __pure ldiv_t ldiv(long int  , long int  );
   











 







extern __declspec(__nothrow) __pure __int64 llabs(__int64  );
   



 




extern __declspec(__nothrow) __pure lldiv_t lldiv(__int64  , __int64  );
   











 
#line 570 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"



 
typedef struct __sdiv32by16 { int quot, rem; } __sdiv32by16;
typedef struct __udiv32by16 { unsigned int quot, rem; } __udiv32by16;
    
typedef struct __sdiv64by32 { int rem, quot; } __sdiv64by32;

__value_in_regs extern __declspec(__nothrow) __pure __sdiv32by16 __rt_sdiv32by16(
     int  ,
     short int  );
   

 
__value_in_regs extern __declspec(__nothrow) __pure __udiv32by16 __rt_udiv32by16(
     unsigned int  ,
     unsigned short  );
   

 
__value_in_regs extern __declspec(__nothrow) __pure __sdiv64by32 __rt_sdiv64by32(
     int  , unsigned int  ,
     int  );
   

 



 
extern __declspec(__nothrow) unsigned int __fp_status(unsigned int  , unsigned int  );
   







 























 
extern __declspec(__nothrow) int mblen(const char *  , size_t  );
   












 
extern __declspec(__nothrow) int mbtowc(wchar_t * __restrict  ,
                   const char * __restrict  , size_t  );
   















 
extern __declspec(__nothrow) int wctomb(char *  , wchar_t  );
   













 





 
extern __declspec(__nothrow) size_t mbstowcs(wchar_t * __restrict  ,
                      const char * __restrict  , size_t  );
   














 
extern __declspec(__nothrow) size_t wcstombs(char * __restrict  ,
                      const wchar_t * __restrict  , size_t  );
   














 

extern __declspec(__nothrow) void __use_realtime_heap(void);
extern __declspec(__nothrow) void __use_realtime_division(void);
extern __declspec(__nothrow) void __use_two_region_memory(void);
extern __declspec(__nothrow) void __use_no_heap(void);
extern __declspec(__nothrow) void __use_no_heap_region(void);

extern __declspec(__nothrow) char const *__C_library_version_string(void);
extern __declspec(__nothrow) int __C_library_version_number(void);











#line 807 "C:\\Keil\\ARM\\RV31\\INC\\stdlib.h"


 
#line 10 "global.h"
#line 1 "C:\\Keil\\ARM\\RV31\\INC\\setjmp.h"
 






 

 
 






 












#line 38 "C:\\Keil\\ARM\\RV31\\INC\\setjmp.h"




typedef __int64 jmp_buf[48];     
                             
                             

extern const int __aeabi_JMP_BUF_SIZE;
              
 
 
 
 

extern __declspec(__nothrow) int setjmp(jmp_buf  );
   




 


extern __declspec(__nothrow) __declspec(__noreturn) void longjmp(jmp_buf  , int  );
   


















 











#line 101 "C:\\Keil\\ARM\\RV31\\INC\\setjmp.h"



 
#line 11 "global.h"
#line 1 "C:\\Keil\\ARM\\RV31\\INC\\rt_misc.h"







 











 
extern void _getenv_init(void);




 
extern void _clock_init(void);





 

extern void *__user_libspace(void);









 
struct __argc_argv {
    int argc;
    char **argv;
    int r2, r3;
};
extern __value_in_regs struct __argc_argv
__rt_lib_init(unsigned  , unsigned  );









 
__value_in_regs struct __argc_argv __ARM_get_argv(void * );




 
extern void __rt_lib_shutdown(void);






 
extern void __rt_exit(int  );    













 
struct __initial_stackheap {
    unsigned heap_base;                 
    unsigned stack_base;                
    unsigned heap_limit;                
    unsigned stack_limit;               
};
extern __value_in_regs struct __initial_stackheap
__user_initial_stackheap(unsigned  , unsigned  ,
                         unsigned  , unsigned  );




 
struct __heap_extent {
    unsigned base, range;
};
extern __value_in_regs struct __heap_extent
__user_heap_extent(unsigned  , unsigned  );










 
struct __stack_slop {
    unsigned always, cleanup;
};
extern __value_in_regs struct __stack_slop
__user_stack_slop(unsigned  , unsigned  );








 
extern unsigned __user_heap_extend(int  ,
                                   void **  ,
                                   unsigned  );






 
int __raise(int  , int  );






 
int __default_signal_handler(int  , int  );





 
void __rt_raise(int  , int  );





#line 12 "global.h"






						    

						    

						    

						    


#line 37 "global.h"









extern unsigned short get16(unsigned char * addr);
extern unsigned short get16_big(unsigned char * addr);
extern unsigned short get16_little(unsigned char * addr);
extern unsigned int get32(unsigned char * addr);
extern unsigned int get32_big(unsigned char * addr);

extern unsigned int get32_little(unsigned char * addr);
extern void put16(unsigned char * addr, unsigned short val);
extern void put16_big(unsigned char * addr, unsigned short val);
extern void put16_little(unsigned char * addr, unsigned short val);
extern void put32(unsigned char * addr, unsigned int val);
extern void put32_big(unsigned char * addr, unsigned int val);
extern void put32_little(unsigned char * addr, unsigned int val);
extern unsigned short swap16(unsigned short val);
extern unsigned int swap32(unsigned int val);
void dump_memory(unsigned char * addr, unsigned int length);
void soft_delay_ms(unsigned int t);



#line 84 "LCD.h"


























#line 126 "LCD.h"

extern void lcdInit(void);		 
extern void lcdClrDisBuf(void);	 
extern void lcdUpdateDisplay(void);	 
extern void OnePixel(unsigned char x,unsigned char y,unsigned char val);	 
extern unsigned char ReadPixel(unsigned char x,unsigned char y);	 
extern void lcdTest(void);	 



 
#line 21 "LCD.c"


 
unsigned char disBuf[504];


 
void lcdSpiSpeedSet()
{
	(*((volatile unsigned char *) 0xE002000C)) = 12;										 
	
	(*((volatile unsigned char *) 0xE0020000))  = (0 << 3) |									
 	(1 << 4) |											
 	(1 << 5) |											
 	(0 << 6) |											
 	(0 << 7);											

#line 47 "LCD.c"
}
 



 
void lcdWriteByte(unsigned char val)
{
	 
	
	


	(*((volatile unsigned char *) 0xE0020008)) = val;

	while(0 == ((*((volatile unsigned char *) 0xE0020004)) & 0x80));						     
	



#line 86 "LCD.c"

}
 

 
void lcdWriteCmd(unsigned char val)
{

	
	
	(*((volatile unsigned long *) 0xE002801C)) |= (0x01 << 23);	 
	

	(*((volatile unsigned char *) 0xE0020008)) = val;

	while(0 == ((*((volatile unsigned char *) 0xE0020004)) & 0x80));						     
	

	

#line 124 "LCD.c"

	(*((volatile unsigned long *) 0xE0028014)) |= (0x01 << 23);	 

}
 


 
void lcdInit(void)
{




	{ (*((volatile unsigned long *) 0xE002C000)) &= ~(0x03 << 24); (*((volatile unsigned long *) 0xE0028008)) |= (0x01 << 12); (*((volatile unsigned long *) 0xE0028004)) |= (0x01 << 12); (*((volatile unsigned long *) 0xE002C000)) &= ~(0x03 << 22); (*((volatile unsigned long *) 0xE0028008)) |= (0x01 << 11); (*((volatile unsigned long *) 0xE0028004)) |= (0x01 << 11); (*((volatile unsigned long *) 0xE002C014)) &= ~(0x02 <<2); (*((volatile unsigned long *) 0xE0028018)) |= (0x01 << 23); (*((volatile unsigned long *) 0xE0028014)) |= (0x01 << 23); (*((volatile unsigned long *) 0xE002C000)) &= ~((0x03 << 8) + (0x03 << 10) + (0x03 << 12)); (*((volatile unsigned long *) 0xE002C000)) |= (0x01 << 8) + (0x01 << 10) + (0x01 << 12); };		 

#line 171 "LCD.c"

	lcdSpiSpeedSet();

	lcdClrDisBuf();	 

	soft_delay_ms(15);	 
	soft_delay_ms(15);

	(*((volatile unsigned long *) 0xE002800C)) |= (0x01 << 12);		 
	soft_delay_ms(1);
	(*((volatile unsigned long *) 0xE0028004)) |= (0x01 << 12);

	soft_delay_ms(1);	 

	(*((volatile unsigned long *) 0xE002800C)) |= (0x01 << 11);		 

	lcdWriteCmd(0x21);	 
	lcdWriteCmd(0xc8);	 
	lcdWriteCmd(0x06);	 
	lcdWriteCmd(0x13);	 
	lcdWriteCmd(0x20);	 
	lcdWriteCmd(0x0c);	 

	lcdUpdateDisplay();	 

	(*((volatile unsigned long *) 0xE0028004)) |= (0x01 << 11);		 
}


 
void lcdClrDisBuf(void)
{
	unsigned int n = 504;	 
	unsigned char * p = disBuf;	
	while(n--)*p++ = 0x00;	 
}

 
void lcdUpdateDisplay(void)
{
	
	unsigned char * p = disBuf;
	unsigned int i,j;


	lcdSpiSpeedSet();	 


	(*((volatile unsigned long *) 0xE002800C)) |= (0x01 << 11);		 

 
 

 	
	
  	
							 
	
	
 

 	
	for(i=0;i<6;i++)
	{
		lcdWriteCmd(0x40 | i);	 
 	 	lcdWriteCmd(0x80 | 0);	 
		for(j=0;j<84;j++)
		{
			lcdWriteByte(*p++);	 
		}
	}
	(*((volatile unsigned long *) 0xE0028004)) |= (0x01 << 11);		 
}



 
void OnePixel(unsigned char x,unsigned char y,unsigned char val)
{
	unsigned char *p = &disBuf[ (unsigned int)y/8*84 + x ]; 
	if(val)*p |= (1<<(y%8));		 
	else *p &= ~(1<<(y%8));
}
 
unsigned char ReadPixel(unsigned char x,unsigned char y)
{
	unsigned char *p = &disBuf[ (unsigned int)y/8*84 + x ]; 
	if(*p & (1<<(y%8)))return 1;	 
	else return 0;
}

 
void lcdTest(void)
{
	unsigned int i,j;
	unsigned char val = 0;
	lcdClrDisBuf();	 
	while(1)
	{
		if (val)val = 0;
		else val = 1;
		for(i=0;i<48;i++)
		{
			for(j=0;j<84;j++)
			{
				OnePixel(j,i,val);	 
				lcdUpdateDisplay();	 
				soft_delay_ms(1);	 
			}
		}
	}
}







 

 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -