Landtiger LPC1768 C BigLib 1
A self made, custom C library for the LandTiger board.
 
Loading...
Searching...
No Matches
timer_types.h
Go to the documentation of this file.
1#ifndef __TIMER_TYPES_H
2#define __TIMER_TYPES_H
3
4#include "types.h"
5#include <stdint.h>
6
7#define MR_COUNT 4
8
17
26
27typedef enum
28{
30 TIM_MR_INT = 1 << 0,
31 TIM_MR_RES = 1 << 1,
32 TIM_MR_STP = 1 << 2
34
41
42typedef struct
43{
46 // Future: implement Capture registers & CCR
47 // Future: implement EMR
48} TIMER;
49
50// INTERRUPTS
51
52// Refer to Table 426 in the manual for more info.
53typedef enum
54{
55 TIM_INT_SRC_MR0 = 0, // Bit 0, MR0
56 TIM_INT_SRC_MR1, // Bit 1, MR1
59
60 // Unsupported, Capture channels
61 // TIM_INT_SRC_CR0 = 0x10,
62 // TIM_INT_SRC_CR1 = 0x20
65
66// Interrupt handler function pointer
67typedef void (*TIMER_InterruptHandler)(void);
68
69#endif
u8 which
Definition timer_types.h:44
u32 prescaler
Definition timer_types.h:45
TIMER_Which
Definition timer_types.h:10
@ TIM_1
Definition timer_types.h:12
@ TIM_COUNT
Definition timer_types.h:15
@ TIM_0
Definition timer_types.h:11
@ TIM_2
Definition timer_types.h:13
@ TIM_3
Definition timer_types.h:14
void(* TIMER_InterruptHandler)(void)
Definition timer_types.h:67
TIMER_MRWhich
Definition timer_types.h:19
@ TIM_MR_COUNT
Definition timer_types.h:24
@ TIM_MR1
Definition timer_types.h:21
@ TIM_MR2
Definition timer_types.h:22
@ TIM_MR3
Definition timer_types.h:23
@ TIM_MR0
Definition timer_types.h:20
TIMER_MRAction
Definition timer_types.h:28
@ TIM_MR_INT
Definition timer_types.h:30
@ TIM_MR_RES
Definition timer_types.h:31
@ TIM_MR_NOP
Definition timer_types.h:29
@ TIM_MR_STP
Definition timer_types.h:32
TIMER_InterruptSource
Definition timer_types.h:54
@ TIM_INT_SRC_COUNT
Definition timer_types.h:63
@ TIM_INT_SRC_MR2
Definition timer_types.h:57
@ TIM_INT_SRC_MR1
Definition timer_types.h:56
@ TIM_INT_SRC_MR3
Definition timer_types.h:58
@ TIM_INT_SRC_MR0
Definition timer_types.h:55
uint8_t u8
Definition types.h:8
uint32_t u32
Definition types.h:6