[求助]:如何在codewarrior中定义端口?

- UID
- 107265
- 性别
- 男
|
codewarrior里面都给你定义好了的,方便得很哦
C:\Program Files\Metrowerks\CW08 V3.1\lib\hc08c\include里面直接找你要用到芯片型号:比如MC68HC908GZ32.H
/*** PTC - Port C Data Register; 0x00000002 ***/
typedef union {
byte Byte;
struct {
byte PTC0 :1; /* Port C Data Bit 0 */
byte PTC1 :1; /* Port C Data Bit 1 */
byte PTC2 :1; /* Port C Data Bit 2 */
byte PTC3 :1; /* Port C Data Bit 3 */
byte PTC4 :1; /* Port C Data Bit 4 */
byte PTC5 :1; /* Port C Data Bit 5 */
byte PTC6 :1; /* Port C Data Bit 6 */
byte :1;
} Bits;
struct {
byte grpPTC :7;
byte :1;
} MergedBits;
} PTCSTR;
extern volatile PTCSTR _PTC @0x00000002;
#define PTC _PTC.Byte
#define PTC_PTC0 _PTC.Bits.PTC0
#define PTC_PTC1 _PTC.Bits.PTC1
#define PTC_PTC2 _PTC.Bits.PTC2
#define PTC_PTC3 _PTC.Bits.PTC3
#define PTC_PTC4 _PTC.Bits.PTC4
#define PTC_PTC5 _PTC.Bits.PTC5
#define PTC_PTC6 _PTC.Bits.PTC6
#define PTC_PTC _PTC.MergedBits.grpPTC |
|
|
|
|
|