MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_board_init

Function rt_hw_board_init

bsp/wh44b0/board.c:116–146  ·  view source on GitHub ↗

* This function will init lumit4510 board */

Source from the content-addressed store, hash-verified

114 * This function will init lumit4510 board
115 */
116void rt_hw_board_init()
117{
118 /* init port setting */
119 rt_hw_port_init();
120
121 /* set timer0 register */
122 /* stop timer */
123 TCON &= ~(0x00000001);
124
125 /* dead zone = 0, pre = 150 */
126 TCFG0 = 0x00000095;
127 /* all are interrupt mode */
128 TCFG1 = 0x00000003;
129
130 TCNTB0 = DATA_COUNT;
131 TCMPB0 = 0;
132
133 /* manual update */
134 TCON |= 0x00000002;
135
136 /* auto reload on,output inverter off */
137 TCON &= ~(0x0000000f);
138 TCON |= (0x00000008);
139
140 /* install timer handler */
141 rt_hw_interrupt_install(INT_TIMER0, rt_timer_handler, RT_NULL);
142 rt_hw_interrupt_umask(INT_TIMER0);
143
144 /* start timer */
145 TCON |=(0x00000001);
146}
147
148void rt_hw_led_set(rt_uint32_t led)
149{

Callers 1

rtthread_startupFunction · 0.70

Calls 3

rt_hw_port_initFunction · 0.85
rt_hw_interrupt_installFunction · 0.50
rt_hw_interrupt_umaskFunction · 0.50

Tested by

no test coverage detected