FreeCalypso > hg > freecalypso-sw
comparison nuc-fw/bsp/clkm.c @ 111:5b7403f6ae93
nuc-fw/bsp: more reconciliation
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 20 Oct 2013 07:58:00 +0000 |
parents | 45911ad957fd |
children |
comparison
equal
deleted
inserted
replaced
110:325bbadc0c9c | 111:5b7403f6ae93 |
---|---|
65 /* WARNING : reverse order in comparison to ULYSSE */ | 65 /* WARNING : reverse order in comparison to ULYSSE */ |
66 /* */ | 66 /* */ |
67 /* Return : none */ | 67 /* Return : none */ |
68 /* Functionality :Initialize the ARM Clock frequency */ | 68 /* Functionality :Initialize the ARM Clock frequency */ |
69 /*--------------------------------------------------------------*/ | 69 /*--------------------------------------------------------------*/ |
70 | 70 |
71 inline void CLKM_InitARMClock(SYS_UWORD16 clk_src, SYS_UWORD16 clk_div, SYS_UWORD16 clk_xp5) | 71 void CLKM_InitARMClock(SYS_UWORD16 clk_src, SYS_UWORD16 clk_div, SYS_UWORD16 clk_xp5) |
72 { | 72 { |
73 SYS_UWORD16 cntl = * (volatile SYS_UWORD16 *) CLKM_ARM_CLK; | 73 SYS_UWORD16 cntl = * (volatile SYS_UWORD16 *) CLKM_ARM_CLK; |
74 | 74 |
75 cntl &= ~(CLKM_CLKIN0 | CLKM_CLKIN_SEL | CLKM_ARM_MCLK_XP5 | CLKM_MCLK_DIV); | 75 cntl &= ~(CLKM_CLKIN0 | CLKM_CLKIN_SEL | CLKM_ARM_MCLK_XP5 | CLKM_MCLK_DIV); |
76 | 76 |
88 /* */ | 88 /* */ |
89 /* Return : none */ | 89 /* Return : none */ |
90 /* Functionality :Initialize the ARM Clock frequency */ | 90 /* Functionality :Initialize the ARM Clock frequency */ |
91 /*--------------------------------------------------------------*/ | 91 /*--------------------------------------------------------------*/ |
92 | 92 |
93 inline void CLKM_InitARMClock(SYS_UWORD16 clk_src, SYS_UWORD16 clk_div) | 93 void CLKM_InitARMClock(SYS_UWORD16 clk_src, SYS_UWORD16 clk_div) |
94 { | 94 { |
95 SYS_UWORD16 cntl = * (volatile SYS_UWORD16 *) CLKM_ARM_CLK; | 95 SYS_UWORD16 cntl = * (volatile SYS_UWORD16 *) CLKM_ARM_CLK; |
96 | 96 |
97 cntl &= ~(CLKM_LOW_FRQ | CLKM_CLKIN_SEL | CLKM_MCLK_DIV); | 97 cntl &= ~(CLKM_LOW_FRQ | CLKM_CLKIN_SEL | CLKM_MCLK_DIV); |
98 | 98 |
116 /* convert x nanoseconds in y cycles used by the ASM loop*/ | 116 /* convert x nanoseconds in y cycles used by the ASM loop*/ |
117 /* function . Before calling this function, call the */ | 117 /* function . Before calling this function, call the */ |
118 /* initialize_wait_loop() function */ | 118 /* initialize_wait_loop() function */ |
119 /* Called when the HardWare needs time to wait */ | 119 /* Called when the HardWare needs time to wait */ |
120 /*-------------------------------------------------------*/ | 120 /*-------------------------------------------------------*/ |
121 inline SYS_UWORD32 convert_nanosec_to_cycles(SYS_UWORD32 time) | 121 SYS_UWORD32 convert_nanosec_to_cycles(SYS_UWORD32 time) |
122 { | 122 { |
123 return( time / ratio_wait_loop); | 123 return( time / ratio_wait_loop); |
124 } | 124 } |
125 | 125 |
126 | 126 |
311 asm(" CMP A1, #0"); | 311 asm(" CMP A1, #0"); |
312 asm(" BNE LOOP_LINE"); | 312 asm(" BNE LOOP_LINE"); |
313 | 313 |
314 asm("END_FUNCTION: "); | 314 asm("END_FUNCTION: "); |
315 } | 315 } |
316 | |
317 |