在C中做什么?

时间:2015-11-10 08:56:46

标签: c operator-keyword

我想了解C运营商|=做了什么:

// Initialize the green led
// Enable the clock for PORT D.  See Page 216 of the Datasheet
SIM_SCGC5 |= (1U<<12);

// Enable the mux as GPIO.  See Page 193 of the Datasheet
PORTD_PCR5 = 0x100;

我也不明白0x100的含义。

1 个答案:

答案 0 :(得分:4)

这是bitwise OR复合赋值,它与:

相同
SIM_SCGC5 = SIM_SCGC5 | (1U<<12);

0x100 hexadecimal中的值为100,0x前缀表示十六进制值。

相关问题