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

📄 uart.h

📁 MSP430开发过程中
💻 H
字号:
////filename: uart.h

#ifndef UART_H
#define UART_H
#include "string.h"
typedef signed   char   int8;
typedef unsigned char   uint8;
typedef signed   short  int16;
typedef unsigned short  uint16;
typedef signed   long   int32;
typedef unsigned long   uint32;
#define NO_HEX_INDICATION   0x80    // display hex numbers without trailing 'h'
#define KVP_ALIGN           24      // Default padding for printKvpInt/hex
typedef unsigned char       BOOL;
#define TRUE   1
#define FALSE 0
static char pValueToTextBuffer[12]; // Length of -2147483648 + terminator
#ifndef BV
#define BV(n)      (1 << (n))
#endif

#ifndef BM
#define BM(n)      (1 << (n))
#endif

#ifndef BF
#define BF(x,b,s)  (((x) & (b)) >> (s))
#endif

#ifndef MIN
#define MIN(n,m)   (((n) < (m)) ? (n) : (m))
#endif

#ifndef MAX
#define MAX(n,m)   (((n) < (m)) ? (m) : (n))
#endif

#ifndef ABS
#define ABS(n)     (((n) < 0) ? -(n) : (n))
#endif

//写一个数组到串口上   
uint16 halUartWrite(const uint8* buf, uint16 length);
void printStr(char* sz);
void printChar(char c);
void printStrW(char *sz, uint8 nBytes);
void printHex(uint32 v, uint8 s);
void printKvpHex(char *szKey, uint16 v);
void printInt(uint32 v);
void printKvpInt(char *szKey, uint32 v);
char* convInt32ToText(int32 value) ;
uint8 min(uint8 v1, uint8 v2);
#endif 

⌨️ 快捷键说明

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