在cw中编译9s128的程序,如何像51那样定义一个位
 
- UID
- 130217
- 性别
- 男
|
在cw中编译9s128的程序,如何像51那样定义一个位
就像在c51中那样,比如:
sbit led=p2^0;
led=1;
在cw如何可以做到这样子的位变量定义呢? |
谁有更多的9s12系列单片机资料阿,共享把,给我一份, 我的信箱wjj_emcu@163.com谢谢 |
|
|
|
|
|
 
- UID
- 135782
- 性别
- 男
|
生命就是奇迹,永远都不要放弃希望,哪怕光亮渺小如豆,我们都要坚持举着它,即使烛火灼伤了皮肤,我们也不能失手,否则我们将永远在黑暗之中。 |
|
|
|
|
|
 
- UID
- 130520
- 性别
- 男
|
9s12没有位变量定义,bool型都是用byte实现的 |
|
|
|
|
|
 
- UID
- 130217
- 性别
- 男
|
谁有更多的9s12系列单片机资料阿,共享把,给我一份, 我的信箱wjj_emcu@163.com谢谢 |
|
|
|
|
|
 
- UID
- 133679
- 性别
- 女
|
可以的
你打开相关头文件看看,每个位都可以单独定义和使用,如果是自己的变量当然还是要自己定义的 |
|
|
|
|
|
 
- UID
- 119851
- 性别
- 男
|
可以用#define bit PORTA_BIT0
把头文件中的定义再次定义成自己更习惯的方式! |
正在使用MC9S12DP256和MC9S12C32,学习MC9S12UF32...... 下一步MC9S12NE64... |
|
|
|
|
|
 
- UID
- 123796
- 性别
- 男
|
|
|
|
|
|

- UID
- 124289
- 性别
- 男
|
typedef union {
byte Byte;
struct {
byte BIT0 :1;
byte BIT1 :1;
byte BIT2 :1;
byte BIT3 :1;
byte BIT4 :1;
byte BIT5 :1;
byte BIT6 :1;
byte BIT7 :1;
}Bit;
}MC33993_switch_status;
MC33993_switch_status MC33993_switch_flag; //33993标志
#define MC33993_flag MC33993_switch_flag.Bit.BIT2 //MC33993开关检测完成标志
我是这样定义的 |
欢迎大家到汽车电子群2838085! 让我们推动中国汽车前进! |
|
|
|
|
|