[AT32F407] odt

[复制链接]
 楼主| mxkw0514 发表于 2022-4-6 15:48 | 显示全部楼层 |阅读模式
#21ic问答#  union
  {
    __IO uint32_t odt;
    struct
    {
      __IO uint32_t odt0                 : 1; /* [0] */
      __IO uint32_t odt1                 : 1; /* [1] */
      __IO uint32_t odt2                 : 1; /* [2] */
      __IO uint32_t odt3                 : 1; /* [3] */
      __IO uint32_t odt4                 : 1; /* [4] */
      __IO uint32_t odt5                 : 1; /* [5] */
      __IO uint32_t odt6                 : 1; /* [6] */
      __IO uint32_t odt7                 : 1; /* [7] */
      __IO uint32_t odt8                 : 1; /* [8] */
      __IO uint32_t odt9                 : 1; /* [9] */
      __IO uint32_t odt10                : 1; /* [10] */
      __IO uint32_t odt11                : 1; /* [11] */
      __IO uint32_t odt12                : 1; /* [12] */
      __IO uint32_t odt13                : 1; /* [13] */
      __IO uint32_t odt14                : 1; /* [14] */
      __IO uint32_t odt15                : 1; /* [15] */
      __IO uint32_t reserved1            : 16;/* [31:16] */
    } odt_bit;
  };

这句话的意思是变量odt和结构体odt_bit共用一个内存单元吗?
七毛钱 发表于 2022-4-6 16:41 来自手机 | 显示全部楼层
不太懂哦,帮忙顶一个
foxsbig 发表于 2022-4-8 15:12 | 显示全部楼层
c语言
union和struct章节
您需要登录后才可以回帖 登录 | 注册

本版积分规则

38

主题

736

帖子

5

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