stm32中的u8定义在哪里_c语言中u8和u16是啥

stm32中的u8定义在哪里_c语言中u8和u16是啥初学STM32编程时,经常见到数据类型定义的符号:u8、u16等,51都是自己定义数据类型的简写符号,STM32是哪里定义的呢?今天没事就看了看系统头文件,数据类型的定义在其中的3个头文件里:(1)stdint.h(摘取定义部分)/* *’signed’isredundantbelow,exceptfor’signedchar’andif *thetypedefis…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

初学STM32编程时,经常见到数据类型定义的符号:u8、u16等,51都是自己定义数据类型的简写符号,STM32是哪里定义的呢?今天没事就看了看系统头文件,数据类型的定义在其中的3个头文件里:

(1)stdint.h(摘取定义部分)

/*
 * 'signed' is redundant below, except for 'signed char' and if
 * the typedef is used to declare a bitfield.
 */


    /* 7.18.1.1 */


    /* 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;
typedef unsigned       __INT64 uint64_t;


    /* 7.18.1.2 */


    /* smallest type of at least n bits */
    /* minimum-width signed integer types */
typedef   signed          char int_least8_t;
typedef   signed short     int int_least16_t;
typedef   signed           int int_least32_t;
typedef   signed       __INT64 int_least64_t;


    /* minimum-width unsigned integer types */
typedef unsigned          char uint_least8_t;
typedef unsigned short     int uint_least16_t;
typedef unsigned           int uint_least32_t;
typedef unsigned       __INT64 uint_least64_t;


    /* 7.18.1.3 */


    /* fastest minimum-width signed integer types */
typedef   signed           int int_fast8_t;
typedef   signed           int int_fast16_t;
typedef   signed           int int_fast32_t;
typedef   signed       __INT64 int_fast64_t;


    /* fastest minimum-width unsigned integer types */
typedef unsigned           int uint_fast8_t;
typedef unsigned           int uint_fast16_t;
typedef unsigned           int uint_fast32_t;
typedef unsigned       __INT64 uint_fast64_t;


    /* 7.18.1.4 integer types capable of holding object pointers */
#if __sizeof_ptr == 8
typedef   signed       __INT64 intptr_t;
typedef unsigned       __INT64 uintptr_t;
#else
typedef   signed           int intptr_t;
typedef unsigned           int uintptr_t;
#endif


    /* 7.18.1.5 greatest-width integer types */
typedef   signed     __LONGLONG intmax_t;
typedef unsigned     __LONGLONG uintmax_t;

(2)STM32F10x.h(摘取定义部分)

/*!< STM32F10x Standard Peripheral Library old types (maintained for legacy purpose) */
typedef int32_t  s32;
typedef int16_t s16;
typedef int8_t  s8;


typedef const int32_t sc32;  /*!< Read Only */
typedef const int16_t sc16;  /*!< Read Only */
typedef const int8_t sc8;   /*!< Read Only */


typedef __IO int32_t  vs32;
typedef __IO int16_t  vs16;
typedef __IO int8_t   vs8;


typedef __I int32_t vsc32;  /*!< Read Only */
typedef __I int16_t vsc16;  /*!< Read Only */
typedef __I int8_t vsc8;   /*!< Read Only */


typedef uint32_t  u32;
typedef uint16_t u16;
typedef uint8_t  u8;


typedef const uint32_t uc32;  /*!< Read Only */
typedef const uint16_t uc16;  /*!< Read Only */
typedef const uint8_t uc8;   /*!< Read Only */


typedef __IO uint32_t  vu32;
typedef __IO uint16_t vu16;
typedef __IO uint8_t  vu8;


typedef __I uint32_t vuc32;  /*!< Read Only */
typedef __I uint16_t vuc16;  /*!< Read Only */
typedef __I uint8_t vuc8;   /*!< Read Only */

(3)core_cm3.h(摘取部分)

/**
 * IO definitions
 *
 * define access restrictions to peripheral registers
 */

#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   */

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/184804.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • gcc离线安装 ubuntu 不用编译_「ubuntu安装gcc」ubuntu18.04安装gcc详细步骤(附问题集) – seo实验室…[通俗易懂]

    gcc离线安装 ubuntu 不用编译_「ubuntu安装gcc」ubuntu18.04安装gcc详细步骤(附问题集) – seo实验室…[通俗易懂]ubuntu安装gcc首先是下载gcc包,可以在GCC的官方网站http://gcc.gnu.org/下载到各个版本。目前最高版本是gcc-8.2.0。一、在安装gcc前,需要先安装MPFR、GMP和MPCGCC编译需要mpfr和mpc(–>gmp、–>mpfr)库的支持,依次安装这几个库,其中mpfr可直接安装,安装mpc依赖mpfr和gmp库(对版本有要求,建议安装最…

    2022年7月24日
    33
  • 成熟的男人喜欢什么样的女性?

    成熟的男人喜欢什么样的女性?很多人以为男人不管是18还是88,都喜欢18的女孩子。其实错了,准确来说是片面了。就我自己和身边朋友的观察,大多数真正成熟的男性,更喜欢的是性格的契合,而不单是你的身高、三围、和精致的脸。具体说说吧,但仅代表我自己。1、能独立自主的女性最有吸引力。男人的征服欲仿佛是带在基因里的,特别是成熟的男人。傻白甜人设,在成熟男人那里,真的不太有优势。他们更喜欢的是“势均力敌”的较量,而不是给小迷妹当人生启蒙老师。事业独立、生活独立的女性,更受男人的欢迎。大多数成年人的世界里,感情与性,是生活的调味品,而不是必需品

    2022年7月25日
    7
  • 返回值是函数_void函数怎么用

    返回值是函数_void函数怎么用通常,希望通过函数使主调函数得到一个确定的值,这就是函数的返回值。说明:1、函数的返回值是通过函数的return语句获得的。(1)return语句将被调函数中的一个确定值带回主调函数中去。(2)

    2022年8月2日
    5
  • smartctl

    smartctl安装和开启服务检查硬盘是否开启smartctl(最后两行)

    2022年6月15日
    44
  • 静态变量与动态变量

    静态变量与动态变量0.静态存储与动态存储1)静态存储变量通常是在变量定义时就分定存储单元并一直保持不变,直至整个程序结束。静态变量,全局动态变量都是静态存储2)动态存储变量是在程序执行过程中,使用它时才分配存储单元,使用完毕立即释放3)静态存储变量是一直存在的,而动态存储变量则时而存在时而消失。通常把由于变量存储方式不同而产生的特性称为变量的生存期4)静态存储只会初始化一次 摘自于:百度百科…

    2022年5月25日
    29
  • RAID 磁盘阵列 详解[通俗易懂]

    RAID 磁盘阵列 详解[通俗易懂]RAID,Redundant Arrays of Independent Disks的简称,独立磁盘冗余阵列,简称磁盘阵列。 磁盘阵列其实也分为软阵列 (Software Raid)和硬阵列 (Hardware Raid) 两种.  软阵列:即通过软件程序并由计算机的 CPU提供运行能力所成. 由于软件程式不是一个完整系统故只能提供最基本的 RAID容错功能. 其他如热备用硬盘的设置,

    2022年6月9日
    61

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号