What is the meaning of this code(lpc1857)?

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

What is the meaning of this code(lpc1857)?

732件の閲覧回数
kmdaivajna
Contributor I

#define CCU_CLK_CFG_RUN (1 << 0)
#define CCU_CLK_CFG_AUTO (1 << 1)
#define CCU_CLK_STAT_RUN (1 << 0)

LPC_CCU1->CLK_M3_GPIO_CFG = CCU_CLK_CFG_AUTO |
CCU_CLK_CFG_RUN;
while (!(LPC_CCU1->CLK_M3_GPIO_STAT & CCU_CLK_STAT_RUN));

ラベル(1)
0 件の賞賛
返信
1 返信

655件の閲覧回数
bernhardfink
NXP Employee
NXP Employee

A branch clock is switched on, following the procedure described in the User's Manual.

The bits RUN asnd AUTO are set in the CFG register, followed by a polling on the RUN bit in the respective STAT register.

To switch on the clock, the AUTO bit is not required, but it's a nice feature when afterwards the clock is switched off.

An endless while loop is maybe not the best way to write such a code.

Regards,

Bernhard.

0 件の賞賛
返信