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

📄 serial.i

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


 

extern __declspec(__nothrow) void clearerr(FILE *  );
   




 

extern __declspec(__nothrow) int feof(FILE *  );
   


 
extern __declspec(__nothrow) int ferror(FILE *  );
   


 
extern __declspec(__nothrow) void perror(const char *  );
   









 

extern __declspec(__nothrow) int _fisatty(FILE *   );
    
 

extern __declspec(__nothrow) void __use_no_semihosting_swi(void);
extern __declspec(__nothrow) void __use_no_semihosting(void);
    





 











#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 18 "serial.c"









void uart0_init (void) {                    

  unsigned short Fdiv;
    
    (*((volatile unsigned long *) 0xE002C000)) = ((*((volatile unsigned long *) 0xE002C000)) & 0xfffffff0) | 0x05;     

    (*((volatile unsigned char *) 0xE000C00C)) = 0x80;                               
 
    Fdiv = (((11059200 * 4) / 4) * 1 / 16) / 115200ul;                   
    (*((volatile unsigned char *) 0xE000C004)) = Fdiv / 256;							
	(*((volatile unsigned char *) 0xE000C000)) = Fdiv % 256;						
    (*((volatile unsigned char *) 0xE000C00C)) = 0x03;                               
 
                                                 
	(*((volatile unsigned char *) 0xE000C004)) = 0x00;                                
    (*((volatile unsigned char *) 0xE000C008)) = 0x00;                                

#line 69 "serial.c"
}


int uart0_putc(int ch) 
{
	(*((volatile unsigned char *) 0xE000C000))=ch;
	while(((*((volatile unsigned char *) 0xE000C014))&&0x40)==0);
	return 0;




}	

int uart0_putchar (int ch) {                       

  if (ch == '\n')  {                             
    uart0_putc( '\r' );                          
  }
  return uart0_putc( ch );                      
}

int uart0_puts ( char* s )
{
	int i = 0;
	while ( *s ) {
		uart0_putc( *s++ );
		i++;
	}
	return i;
}

int uart0_prints ( char* s )
{
	int i = 0;
	while ( *s ) {
		uart0_putchar( *s++ );
		i++;
	}
	return i;
}

int uart0_kbhit( void )  
{
#line 121 "serial.c"
return 0;
}

int uart0_getc ( void )   
{   




return 0;
}


 
int sendchar (int ch)  {                  

  if (ch == '\n')  {
    while (!((*((volatile unsigned char *) 0xE000C014)) & 0x20));
    (*((volatile unsigned char *) 0xE0010000)) = 0x0D;                           
  }
  while (!((*((volatile unsigned char *) 0xE000C014)) & 0x20));
  return ((*((volatile unsigned char *) 0xE000C000)) = ch);
}


int getkey (void)  {                      

  while (!((*((volatile unsigned char *) 0xE000C014)) & 0x01));

  return ((*((volatile unsigned char *) 0xE000C000)));
}

⌨️ 快捷键说明

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