打印

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

[复制链接]
2158|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

2398

主题

6950

帖子

67

粉丝