What is the meaning of this code(lpc1857)?

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

What is the meaning of this code(lpc1857)?

731 次查看
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 回复

654 次查看
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 项奖励
回复