libws libws
WSwan hardware library for the Wonderful toolchain
Loading...
Searching...
No Matches
Timers

Macros

#define WS_TIMER_HBLANK_HZ_TO_TICKS(hz)
 Convert a frequency in hertz to horizontal blank timer ticks.
#define WS_TIMER_VBLANK_HZ_TO_TICKS(hz)
 Convert a frequency in hertz to vertical blank timer ticks.

Functions

static void ws_timer_hblank_disable (void)
static void ws_timer_vblank_disable (void)
static void ws_timer_hblank_start_once (uint16_t ticks)
 Request a one-shot horizontal blank timer.
static void ws_timer_vblank_start_once (uint16_t ticks)
 Request a one-shot vertical blank timer.
static void ws_timer_hblank_start_repeat (uint16_t ticks)
 Request a repeating horizontal blank timer.
static void ws_timer_vblank_start_repeat (uint16_t ticks)
 Request a repeating vertical blank timer.

Detailed Description

Macro Definition Documentation

◆ WS_TIMER_HBLANK_HZ_TO_TICKS

#define WS_TIMER_HBLANK_HZ_TO_TICKS ( hz)
Value:
((uint16_t) WS_HZ_TO_CLOCK_DIVIDER((hz), 12000))

Convert a frequency in hertz to horizontal blank timer ticks.

Range: 0.2 .. 12000 Hz

Parameters
hzFrequency, in hertz.

Definition at line 51 of file timer.h.

◆ WS_TIMER_VBLANK_HZ_TO_TICKS

#define WS_TIMER_VBLANK_HZ_TO_TICKS ( hz)
Value:
((uint16_t) WS_HZ_TO_CLOCK_DIVIDER((hz), 12000 / (WS_DISPLAY_VTOTAL))))
#define WS_DISPLAY_VTOTAL
Number of vertical lines in a frame.
Definition display.h:63

Convert a frequency in hertz to vertical blank timer ticks.

Range: 0.0012 .. 75.47 Hz

Parameters
hzFrequency, in hertz.

Definition at line 60 of file timer.h.

Function Documentation

◆ ws_timer_hblank_disable()

void ws_timer_hblank_disable ( void )
inlinestatic

Definition at line 64 of file timer.h.

◆ ws_timer_hblank_start_once()

void ws_timer_hblank_start_once ( uint16_t ticks)
inlinestatic

Request a one-shot horizontal blank timer.

Parameters
ticksThe number of ticks to time.

Definition at line 77 of file timer.h.

◆ ws_timer_hblank_start_repeat()

void ws_timer_hblank_start_repeat ( uint16_t ticks)
inlinestatic

Request a repeating horizontal blank timer.

Parameters
ticksThe number of ticks to time.

Definition at line 97 of file timer.h.

◆ ws_timer_vblank_disable()

void ws_timer_vblank_disable ( void )
inlinestatic

Definition at line 68 of file timer.h.

◆ ws_timer_vblank_start_once()

void ws_timer_vblank_start_once ( uint16_t ticks)
inlinestatic

Request a one-shot vertical blank timer.

Parameters
ticksThe number of ticks to time.

Definition at line 87 of file timer.h.

◆ ws_timer_vblank_start_repeat()

void ws_timer_vblank_start_repeat ( uint16_t ticks)
inlinestatic

Request a repeating vertical blank timer.

Parameters
ticksThe number of ticks to time.

Definition at line 107 of file timer.h.