What is the meaning of this code(lpc1857)?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What is the meaning of this code(lpc1857)?

354 Views
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));

Labels (1)
0 Kudos
1 Reply

277 Views
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 Kudos