MonkOS  v0.1
A simple 64-bit operating system (x86_64)
timer.h
Go to the documentation of this file.
1 //============================================================================
2 /// @file timer.h
3 /// @brief Programmable interval timer (8253/8254) controller.
4 //
5 // Copyright 2016 Brett Vickers.
6 // Use of this source code is governed by a BSD-style license
7 // that can be found in the MonkOS LICENSE file.
8 //============================================================================
9 
10 #pragma once
11 
12 #include <core.h>
13 
14 //----------------------------------------------------------------------------
15 // @function timer_init
16 /// @brief Initialize the timer controller so that it interrupts the
17 /// kernel at the requested frequency.
18 ///
19 /// @details Interrupts are enabled at the end of the function, so
20 /// timer_enable does not need to be called after timer_init.
21 ///
22 /// Due to the clock granularity (1193181Hz), the requested
23 /// frequency may not be perfectly met.
24 ///
25 /// @param[in] frequency The interrupt frequency in Hz. Clamped to the
26 /// range [19:1193181].
27 //----------------------------------------------------------------------------
28 void
29 timer_init(uint32_t frequency);
30 
31 //----------------------------------------------------------------------------
32 // @function timer_enable
33 /// @brief Enable timer interrupts.
34 //----------------------------------------------------------------------------
35 void
36 timer_enable();
37 
38 //----------------------------------------------------------------------------
39 // @function timer_disable
40 /// @brief Disable timer interrupts.
41 //----------------------------------------------------------------------------
42 void
void timer_disable()
Disable timer interrupts.
Definition: timer.c:72
Core include file.
void timer_init(uint32_t frequency)
Initialize the timer controller so that it interrupts the kernel at the requested frequency...
Definition: timer.c:37
void timer_enable()
Enable timer interrupts.
Definition: timer.c:65