bits manipulation (BME)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

bits manipulation (BME)

1,203件の閲覧回数
silviopistolesi
Contributor II

i must read a word of 16 bits from PORTC to load in memory buffer but the PORTC haven't bit 14 and 15 but 16 and 17. For format the word in 16 bit I make in the folloving mode:

read_data = FGPIOC_PDIR;

tmp = read_data & 0x00030000;

tmp = tmp >> 2;

read_data = read_data | tmp;

There is an other mode (less instructions and/or faster) for to do the same operations?

タグ(3)
1 返信

940件の閲覧回数
Paul_Tian
NXP Employee
NXP Employee

Hi, Silvio

After compared with our BME sample code, I think your code is OK. After convertion to assembly code, the instruction lines are same.

Hope my reply can help you.

Best Regards

Paul