野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12730|回复: 1

库函数中数据类型问题

[复制链接]
发表于 2015-5-21 14:17:40 | 显示全部楼层 |阅读模式
我刚接触单片机,请问在使用库函数编程中,如__IO uint32_t、uint8_t、uint16_t分别表示什么数据类型。
为什么前面有两个双下划线?有什么作用?另外在编程时可不可以直接使用  int  char  unsigned char  unsigned int   float 类型
回复

使用道具 举报

发表于 2015-5-21 14:51:25 | 显示全部楼层
按F12,可以跳转到类型的定义,在stdin.h文件有如下内容:
    /* exact-width signed integer types */
typedef   signed          char int8_t;
typedef   signed short     int int16_t;
typedef   signed           int int32_t;
typedef   signed       __int64 int64_t;

/* exact-width unsigned integer types */
typedef unsigned          char uint8_t;
typedef unsigned short     int uint16_t;
typedef unsigned           int uint32_t;


__IO 在core_cm3.文件,有如下内容:

#ifdef __cplusplus
  #define     __I     volatile                /*!< defines 'read only' permissions      */
#else
  #define     __I     volatile const          /*!< defines 'read only' permissions      */
#endif
#define     __O     volatile                  /*!< defines 'write only' permissions     */
#define     __IO    volatile                  /*!< defines 'read / write' permissions   */



typedef unsigned       __int64 uint64_t;
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-9-21 17:30 , Processed in 0.027251 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表