Re: 請教C18的寫法
|
||||
---|---|---|---|---|
高級會員
|
typedef unsigned char BYTE;
發表於: 2006/11/13 11:53
|
|||
|
Re: 請教C18的寫法
|
||||
---|---|---|---|---|
資深會員
|
C18沒辦法直接那樣定義, 只能換個方式達到你要的
ex. #define DB0 PORTDbits.RD0 #define DB1 PORTDbits.RD1
發表於: 2006/11/13 10:48
|
|||
|
Re: 請教C18的寫法
|
||||
---|---|---|---|---|
版主
|
Hi-Tech C & CCS 都可以用特定的指令bit來定義單一位元或I/O 腳位,但C18只能用位元結構的方式定義位元,詳細用法請參考W410 workshop教材或C18裏的H檔裡的宣告
發表於: 2006/11/13 10:40
|
|||
|
請教C18的寫法
|
||||
---|---|---|---|---|
高級會員
|
這是截取CC5X 部份的程式碼,宣告pin腳的部份還ok, 不知道c18能不能寫到那麼簡明?
#pragma bit CS @ PORTC.2 // output for chip select CS
發表於: 2006/11/13 10:19
|
|||
|