bits manipulation (BME)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

bits manipulation (BME)

1,195 次查看
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 回复

932 次查看
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