📄 function.h
字号:
#ifndef __FUNCTION_H__
#define __FUNCTION_H__
/* Type redefinition */
typedef unsigned char U8;
typedef unsigned short int U16;
typedef unsigned int U32;
typedef char S8;
typedef short int S16;
typedef int S32;
/* Baud rate definition */
#define BAUD_9600 9600
#define BAUD_19200 19200
#define BAUD_38400 38400
#define BAUD_115200 115200
#define BAUD_230400 230400
typedef enum
{
UART_NOPARITY,
UART_PARITY
}UART_Parity;
typedef enum
{
UART_ONESTOPBIT,
UART_TWOSTOPBITS
}UART_StopBit;
typedef enum
{
UART_5BITS,
UART_6BITS,
UART_7BITS,
UART_8BITS
}UART_Bits;
void UartInitializeEx(unsigned int Baudrate, UART_Bits Bits, UART_Parity Parity, UART_StopBit Stop, int FlowControl);
void Byte2String (char *buf, unsigned char hex);
/***** buf at least has more than 9bytes size **/
void HexWord2String (char *buf, int hex);
void HalfWord2String (char *buf, unsigned short int hex);
void UartInitialize(void);
void UartXmitData (unsigned int volatile *pUart, char *buf, int len);
void print_string(char * str);
void print_string_uart(char * buf);
void print_mesg_hex(char *msg, unsigned int hex);
void print_mesg_hex_uart(char *msg, unsigned int hex);
void Dump_Bin(unsigned int base_address,int size);
//void *memset(void *dst0,register int c0,register int length);
void zeromem(void *dst0,register unsigned int length);
/*
char* strcpy(register char *to,register const char * from);
int strcmp(register const char *s1,register const char * s2);
char* strcat(register char *s,register const char * append);
unsigned int strlen(const char *str);
*/
void DelayUs(unsigned int count);
void DelayMs(unsigned int count);
void DelayS(unsigned int count);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -