屏幕布对面的高手看过来ST公司的数据结构是什么意思

[复制链接]
2921|3
 楼主| ddllxxrr 发表于 2009-9-19 14:03 | 显示全部楼层 |阅读模式
typedef union
{
  u16 whole;
  struct
  {
    unsigned IMPLEMENTED : 1; /**< Indicates that the key is implemented (from Customer Code to TSL only) */
    unsigned ENABLED     : 1; /**< Indicates that the key is enabled (from Customer Code to TSL only) */
    unsigned DETECTED    : 1; /**< Indicates that the key is detected (from TSL to Customer Code only) */
    unsigned CHANGED     : 1; /**< Indicates that the key state has changed (from TSL to Customer Code only) */
    unsigned POSCHANGED  : 1; /**< Indicates that the MC key position has changed (from TSL to Customer Code only) */
    unsigned ERROR       : 1; /**< Indicates that the key has an error (from TSL to Customer Code only) */
    unsigned NOISE       : 1; /**< Indicates that the key measurement has noise (from TSL to Customer Code only) */
    unsigned LOCKED      : 1; /**< Reserved (TSL internal usage) */
    unsigned DIRECTION   : 1; /**< Reserved (TSL internal usage) */
    unsigned MCKEY_TYPE  : 1; /**< Indicates the type of MCkey: Wheel(0) or Slider(1) (from Customer Code to TSL only) */
    unsigned RESERVED0   : 1; /**< Reserved for future use */
    unsigned RESERVED1   : 1; /**< Reserved for future use */
    unsigned RESERVED2   : 1; /**< Reserved for future use */
    unsigned RESERVED3   : 1; /**< Reserved for future use */
    unsigned RESERVED4   : 1; /**< Reserved for future use */
    unsigned RESERVED5   : 1; /**< Reserved for future use */
  } b;
} KeyFlag_T;


我不明白的是那个:号是什么意思
aozima 发表于 2009-9-19 15:29 | 显示全部楼层
位域
联合体

作用是:
用whole来索引整个寄存器
也可以直接访问这个寄存中的每一位
午夜霓虹 发表于 2009-9-19 15:48 | 显示全部楼层
呵呵,C语言还是要经常温习一下的。
 楼主| ddllxxrr 发表于 2009-9-25 12:46 | 显示全部楼层
谢二楼,是位域主要是省地
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:http://shop34182318.taobao.com/ http://shop562064536.taobao.com

2404

主题

7001

帖子

68

粉丝
快速回复 在线客服 返回列表 返回顶部