Skip to content

Commit f82b43f

Browse files
iot-lab_M3: definitions for implementation of peripheral timer driver
1 parent 4a15f8b commit f82b43f

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

iot-lab_M3/include/board.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77

88
typedef uint8_t radio_packet_length_t;
99

10+
#define HW_TIMER TIMER_0
11+
1012
#endif /* BOARD_H_ */

iot-lab_M3/include/periph_conf.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#ifndef __PERIPH_CONF_H
2+
#define __PERIPH_CONF_H
3+
4+
5+
/**
6+
* @brief Timer configuration
7+
*/
8+
#define TIMER_NUMOF (2U)
9+
#define TIMER_0_EN 1
10+
#define TIMER_1_EN 0
11+
12+
/* Timer 0 configuration */
13+
#define TIMER_0_DEV TIM2
14+
#define TIMER_0_CHANNELS 4
15+
#define TIMER_0_PRESCALER (2303U)
16+
#define TIMER_0_MAX_VALUE (0xffff)
17+
#define TIMER_0_CLKEN() RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE)
18+
#define TIMER_0_ISR TIM2_IRQHandler
19+
#define TIMER_0_IRQCHAN TIM2_IRQn
20+
#define TIMER_0_IRQ_PRIO 1
21+
22+
/* Timer 1 configuration */
23+
#define TIMER_1_DEV TIM3
24+
#define TIMER_1_CHANNELS 2
25+
#define TIMER_1_PRESCALER (71U)
26+
#define TIMER_1_MAX_VALUE (0xffff)
27+
#define TIMER_1_CLKEN() RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE)
28+
#define TIMER_1_ISR TIM3_IRQHandler
29+
#define TIMER_1_IRQCHAN TIM3_IRQn
30+
#define TIMER_1_IRQ_PRIO 1
31+
32+
#endif /* __PERIPH_CONF_H */

0 commit comments

Comments
 (0)