liberis
Functions
timer.h File Reference

Utilize the built-in timer. More...

#include <eris/types.h>

Go to the source code of this file.

Functions

void eris_timer_init (void)
 Initialize the timer.
void eris_timer_set_period (int period)
 Set the period of the timer.
int eris_timer_read_counter (void)
 Read the current value of the timer.
void eris_timer_ack_irq (void)
 Acknowledge a timer IRQ.
u16 eris_timer_read_control (void)
 Read the timer's control register.
void eris_timer_write_control (int cr)
 Write the timer's control register.
void eris_timer_start (int irq)
 Start the timer.
void eris_timer_stop (void)
 Stop the timer.

Detailed Description

Utilize the built-in timer.


Function Documentation

u16 eris_timer_read_control ( void  )

Read the timer's control register.

Returns:
The control register.
int eris_timer_read_counter ( void  )

Read the current value of the timer.

Returns:
The current value of the timer.
void eris_timer_set_period ( int  period)

Set the period of the timer.

Period is in ticks of CPUclk/15. New period will not load until either the timer is restarted, or expires. period The period of the timer. (1 ~ 65535)

void eris_timer_start ( int  irq)

Start the timer.

Parameters:
irqIf 1, fire an IRQ at timer expiration.
void eris_timer_write_control ( int  cr)

Write the timer's control register.

Parameters:
crThe new control register.
 All Files Functions Typedefs Enumerations Enumerator Defines