* This function will init lumit4510 board */
| 114 | * This function will init lumit4510 board |
| 115 | */ |
| 116 | void 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 | |
| 148 | void rt_hw_led_set(rt_uint32_t led) |
| 149 | { |
no test coverage detected