25 lines
853 B
C
25 lines
853 B
C
/* stdint.h - 用于 51 单片机的自定义标准整数类型定义 */
|
||
|
||
#ifndef __STDINT_H__
|
||
#define __STDINT_H__
|
||
|
||
/* 精确宽度整数类型 */
|
||
typedef unsigned char uint8_t; // 无符号 8-bit
|
||
typedef signed char int8_t; // 有符号 8-bit
|
||
|
||
typedef unsigned int uint16_t; // 无符号 16-bit (Keil C51中int是16位)
|
||
typedef signed int int16_t; // 有符号 16-bit
|
||
|
||
typedef unsigned long uint32_t; // 无符号 32-bit
|
||
typedef signed long int32_t; // 有符号 32-bit
|
||
|
||
/* 快速最小宽度类型(按编译器最优选择)*/
|
||
typedef unsigned char uint_fast8_t;
|
||
typedef unsigned int uint_fast16_t;
|
||
typedef unsigned long uint_fast32_t;
|
||
|
||
/* 指针类型(51 单片机为 8/16 位地址)*/
|
||
typedef unsigned char uintptr_t; // 数据指针(8位)
|
||
typedef unsigned int uintptr16_t; // 代码指针(16位)
|
||
|
||
#endif /* __STDINT_H__ */ |