comparison nuc-fw/nucleus/tmcal.c @ 79:947b1f473960

beginning of nuc-fw
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 11 Aug 2013 07:17:25 +0000
parents
children
comparison
equal deleted inserted replaced
78:2c266d4339ff 79:947b1f473960
1 /*
2 * FreeNucleus port by Spacefalcon the Outlaw
3 *
4 * This module implements the INT_Timer_Initialize() function
5 * for the proof-of-concept Calypso port.
6 *
7 * TIMER2 configuration is based on that used by OsmocomBB.
8 */
9
10 #include "calirq.h"
11 #include "caltimer.h"
12
13 void
14 INT_Timer_Initialize()
15 {
16 /* program the timer */
17 TIMER2_REGS.cntl = CNTL_CLOCK_ENABLE;
18 TIMER2_REGS.load = 4062;
19 TIMER2_REGS.cntl = CNTL_CLOCK_ENABLE | CNTL_AUTO_RELOAD | CNTL_START;
20 /* now let it interrupt */
21 INTH_REGS.ilr_irq[IRQ_TIMER2] = 0x7E;
22 INTH_REGS.mask_it_reg1 &= ~(1 << IRQ_TIMER2);
23 }