Landtiger LPC1768 C BigLib 1
A self made, custom C library for the LandTiger board.
 
Loading...
Searching...
No Matches
timer.h
Go to the documentation of this file.
1#ifndef __TIMER_H
2#define __TIMER_H
3
4#include "timer_types.h"
5#include "types.h"
6#include <stdbool.h>
7#include <stdint.h>
8
15void TIMER_Init(TIMER *timer, u8 which, u32 prescaler, u8 int_priority);
16
19void TIMER_Deinit(TIMER timer);
20
23void TIMER_SetMatch(TIMER timer, TIMER_MatchRegister match_reg);
24
27void TIMER_UnsetMatch(TIMER timer, TIMER_MatchRegister match_reg);
28
31void TIMER_Enable(TIMER timer);
32
35void TIMER_Disable(TIMER timer);
36
40bool TIMER_IsEnabled(TIMER timer);
41
46
49void TIMER_Reset(TIMER timer);
50
51// INTERRUPTS
52
58void TIMER_SetInterruptHandler(TIMER timer, u8 source, TIMER_InterruptHandler handler);
59
64void TIMER_UnsetInterruptHandler(TIMER timer, u8 source);
65
66#endif
void TIMER_UnsetMatch(TIMER timer, TIMER_MatchRegister match_reg)
Unsets a match register of a TIMER peripheral.
Definition timer.c:184
void TIMER_Reset(TIMER timer)
Resets a TIMER peripheral without deconfiguring it.
Definition timer.c:265
u32 TIMER_ReadValue(TIMER timer)
Reads the current value of a TIMER peripheral.
Definition timer.c:285
void TIMER_Init(TIMER *timer, u8 which, u32 prescaler, u8 int_priority)
Initializes a TIMER peripheral.
Definition timer.c:62
void TIMER_Disable(TIMER timer)
Disables a TIMER peripheral.
Definition timer.c:229
void TIMER_Enable(TIMER timer)
Enables a TIMER peripheral.
Definition timer.c:203
bool TIMER_IsEnabled(TIMER timer)
Checks if a TIMER peripheral is enabled.
Definition timer.c:248
void TIMER_UnsetInterruptHandler(TIMER timer, u8 source)
Unsets the interrupt handler for a TIMER peripheral, on a specific source between the 4 match registe...
Definition timer_irq.c:65
void TIMER_Deinit(TIMER timer)
Deconfigures a TIMER peripheral (also match registers).
Definition timer.c:124
void TIMER_SetMatch(TIMER timer, TIMER_MatchRegister match_reg)
Sets the match value for a match register of a TIMER peripheral.
Definition timer.c:162
void TIMER_SetInterruptHandler(TIMER timer, u8 source, TIMER_InterruptHandler handler)
Sets the interrupt handler for a TIMER peripheral, on a specific source between the 4 match registers...
Definition timer_irq.c:60
void(* TIMER_InterruptHandler)(void)
Definition timer_types.h:67
uint8_t u8
Definition types.h:8
uint32_t u32
Definition types.h:6