FreeNOS
|
#include <ARMTimer.h>
Public Member Functions | |
ARMTimer () | |
Constructor. More... | |
virtual Result | setFrequency (const Size hertz) |
Set timer frequency. More... | |
virtual Result | tick () |
Process timer tick. More... | |
Public Member Functions inherited from Timer | |
struct Timer::Info | ALIGN (8) Info |
Timer information structure. More... | |
Timer () | |
Constructor. More... | |
Size | getInterrupt () const |
Get timer interrupt number. More... | |
Size | getFrequency () const |
Get timer frequency. More... | |
virtual Result | getCurrent (Info *info, const Size msecOffset=0) |
Get current timer info. More... | |
virtual Result | initialize () |
Initialize the timer. More... | |
virtual Result | start () |
Start the timer. More... | |
virtual Result | stop () |
Stop the timer. More... | |
virtual Result | wait (u32 microseconds) const |
Busy wait a number of microseconds. More... | |
bool | isExpired (const Info &info) const |
Check if a timer value is expired. More... | |
Private Member Functions | |
u32 | getSystemFrequency (void) const |
Retrieve system timer frequency. More... | |
void | setPL1PhysicalTimerValue (const u32 value) |
Set Physical Timer 1 value. More... | |
void | setPL1PhysicalTimerControl (const u32 value) |
Set Physical Timer 1 control value. More... | |
Private Attributes | |
Size | m_initialTimerCounter |
Currently configured initial timer counter. More... | |
Static Private Attributes | |
static const u32 | TimerControlEnable = 1 |
Set this bit in the PL1 control register to enable it. More... | |
Additional Inherited Members | |
Public Types inherited from Timer | |
enum | Result { Success, NotFound, IOError, InvalidFrequency } |
Result codes. More... | |
Data Fields inherited from Timer | |
enum Timer::Result | ALIGN |
Protected Attributes inherited from Timer | |
Size | m_ticks |
The current timer ticks. More... | |
Size | m_frequency |
Frequency of the Timer. More... | |
Size | m_int |
Timer interrupt number. More... | |
ARM Generic Timer.
Definition at line 39 of file ARMTimer.h.
ARMTimer::ARMTimer | ( | ) |
|
private |
Retrieve system timer frequency.
Definition at line 28 of file ARMTimer.cpp.
References mrc.
Referenced by setFrequency().
|
virtual |
Set timer frequency.
hertz | Frequency of the timer in hertz. |
Reimplemented from Timer.
Definition at line 52 of file ARMTimer.cpp.
References getSystemFrequency(), m_initialTimerCounter, Timer::setFrequency(), and tick().
Referenced by SunxiKernel::SunxiKernel().
|
private |
Set Physical Timer 1 control value.
value | New timer control value |
Definition at line 47 of file ARMTimer.cpp.
References mcr.
Referenced by tick().
|
private |
Set Physical Timer 1 value.
value | New timer value |
Definition at line 42 of file ARMTimer.cpp.
References mcr.
Referenced by tick().
|
virtual |
Process timer tick.
Should be called on each timer interrupt to restart the timer by applying the initial timer counter value.
Reimplemented from Timer.
Definition at line 60 of file ARMTimer.cpp.
References m_initialTimerCounter, setPL1PhysicalTimerControl(), setPL1PhysicalTimerValue(), Timer::tick(), and TimerControlEnable.
Referenced by setFrequency().
|
private |
Currently configured initial timer counter.
Definition at line 98 of file ARMTimer.h.
Referenced by setFrequency(), and tick().
|
staticprivate |
Set this bit in the PL1 control register to enable it.
Definition at line 44 of file ARMTimer.h.
Referenced by tick().