libElysianVMU 1.6.0
Full-featured, accurate, cross-platform library emulating the Dreamcast's Visual Memory Unit
Loading...
Searching...
No Matches
evmu_clock.h File Reference

Go to the source code of this file.

Data Structures

struct  EvmuOscillatorSpecs
 
struct  EvmuClockStats
 
struct  EvmuClockClass
 
struct  EvmuClock
 

Macros

#define EVMU_CLOCK_NAME   "clock"
 
#define EVMU_CLOCK_OSC_QUARTZ_FREQ   32768
 
#define EVMU_CLOCK_OSC_RC_FREQ   879236
 
#define EVMU_CLOCK_OSC_CF_FREQ   6000000
 
#define EVMU_CLOCK_OSC_QUARTZ_TCYC_1_12   366210
 
#define EVMU_CLOCK_OSC_QUARTZ_TCYC_1_6   183105
 
#define EVMU_CLOCK_OSC_RC_TCYC_1_12   12568
 
#define EVMU_CLOCK_OSC_RC_TCYC_1_6   6824
 
#define EVMU_CLOCK_OSC_CF_TCYC_1_12   2000
 
#define EVMU_CLOCK_OSC_CF_TCYC_1_6   1000
 
#define EVMU_CLOCK_OSC_QUARTZ_CURRENT   2600
 
#define EVMU_CLOCK_OSC_RC_CURRENT   610
 
Type System

Type UUID and cast operators

#define EVMU_CLOCK_TYPE   (GBL_TYPEID(EvmuClock))
 
#define EVMU_CLOCK(self)   (GBL_CAST(EvmuClock, self))
 
#define EVMU_CLOCK_CLASS(klass)   (GBL_CLASS_CAST(EvmuClock, klass))
 
#define EVMU_CLOCK_GET_CLASS(self)   (GBL_CLASSOF(EvmuClock, self))
 

Typedefs

typedef GblEnum EVMU_OSCILLATOR
 
typedef GblEnum EVMU_CLOCK_SIGNAL
 
typedef GblEnum EVMU_CLOCK_SYSTEM_STATE
 
typedef GblEnum EVMU_CLOCK_DIVIDER
 

Enumerations

enum  EVMU_OSCILLATOR
 
enum  EVMU_CLOCK_SIGNAL
 
enum  EVMU_CLOCK_SYSTEM_STATE
 
enum  EVMU_CLOCK_DIVIDER
 

Functions

EVMU_RESULT EvmuClock_oscillatorSpecs (const EvmuClock *pSelf, EVMU_OSCILLATOR oscillator, EvmuOscillatorSpecs *pSpecs)
 
GblBool EvmuClock_oscillatorActive (const EvmuClock *pSelf, EVMU_OSCILLATOR oscillator)
 
EVMU_RESULT EvmuClock_setOscillatorActive (const EvmuClock *pSelf, EVMU_OSCILLATOR oscillator, GblBool active)
 
EVMU_CLOCK_SYSTEM_STATE EvmuClock_systemState (const EvmuClock *pSelf)
 
EVMU_RESULT EvmuClock_setSystemState (const EvmuClock *pSelf, EVMU_CLOCK_SYSTEM_STATE state)
 
EVMU_RESULT EvmuClock_systemConfig (const EvmuClock *pSelf, EVMU_OSCILLATOR *pSource, EVMU_CLOCK_DIVIDER *pDivider)
 
EVMU_RESULT EvmuClock_setSystemConfig (const EvmuClock *pSelf, EVMU_OSCILLATOR source, EVMU_CLOCK_DIVIDER divider)
 
EVMU_RESULT EvmuClock_signalStats (const EvmuClock *pSelf, EVMU_CLOCK_SIGNAL signal, EvmuClockStats *pStatus)
 
EvmuWave EvmuClock_signalWave (const EvmuClock *pSelf, EVMU_CLOCK_SIGNAL signal)
 
EvmuCycles EvmuClock_signalTicksToCycles (const EvmuClock *pSelf, EVMU_CLOCK_SIGNAL signal, EvmuTicks ticks)
 
EvmuTicks EvmuClock_signalCyclesToTicks (const EvmuClock *pSelf, EVMU_CLOCK_SIGNAL signal, EvmuCycles cycles)
 
uint64_t EvmuClock_systemCyclesPerSec (const EvmuClock *pSelf)
 
double EvmuClock_systemSecsPerCycle (const EvmuClock *pSelf)
 
EvmuTicks EvmuClock_systemTicksPerCycle (const EvmuClock *pSelf)
 

Detailed Description

EvmuClock peripheral modeling oscillators and timing.

Author
2023 Falco Girgis

Definition in file evmu_clock.h.

Macro Definition Documentation

◆ EVMU_CLOCK

#define EVMU_CLOCK (   self)    (GBL_CAST(EvmuClock, self))

Function-style GblInstance cast to EvmuClock.

Definition at line 20 of file evmu_clock.h.

◆ EVMU_CLOCK_CLASS

#define EVMU_CLOCK_CLASS (   klass)    (GBL_CLASS_CAST(EvmuClock, klass))

Function-style GblClass cast to EvmuClockClass.

Definition at line 21 of file evmu_clock.h.

◆ EVMU_CLOCK_GET_CLASS

#define EVMU_CLOCK_GET_CLASS (   self)    (GBL_CLASSOF(EvmuClock, self))

Get an EvmuClockClass from a GblInstance

Definition at line 22 of file evmu_clock.h.

◆ EVMU_CLOCK_NAME

#define EVMU_CLOCK_NAME   "clock"

Definition at line 25 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_CF_FREQ

#define EVMU_CLOCK_OSC_CF_FREQ   6000000

Definition at line 29 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_CF_TCYC_1_12

#define EVMU_CLOCK_OSC_CF_TCYC_1_12   2000

Definition at line 37 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_CF_TCYC_1_6

#define EVMU_CLOCK_OSC_CF_TCYC_1_6   1000

Definition at line 38 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_QUARTZ_CURRENT

#define EVMU_CLOCK_OSC_QUARTZ_CURRENT   2600

Definition at line 40 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_QUARTZ_FREQ

#define EVMU_CLOCK_OSC_QUARTZ_FREQ   32768

Definition at line 27 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_QUARTZ_TCYC_1_12

#define EVMU_CLOCK_OSC_QUARTZ_TCYC_1_12   366210

Definition at line 31 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_QUARTZ_TCYC_1_6

#define EVMU_CLOCK_OSC_QUARTZ_TCYC_1_6   183105

Definition at line 32 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_RC_CURRENT

#define EVMU_CLOCK_OSC_RC_CURRENT   610

Definition at line 41 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_RC_FREQ

#define EVMU_CLOCK_OSC_RC_FREQ   879236

Definition at line 28 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_RC_TCYC_1_12

#define EVMU_CLOCK_OSC_RC_TCYC_1_12   12568

Definition at line 34 of file evmu_clock.h.

◆ EVMU_CLOCK_OSC_RC_TCYC_1_6

#define EVMU_CLOCK_OSC_RC_TCYC_1_6   6824

Definition at line 35 of file evmu_clock.h.

◆ EVMU_CLOCK_TYPE

#define EVMU_CLOCK_TYPE   (GBL_TYPEID(EvmuClock))

Type UUID for EvmuClock.

Definition at line 19 of file evmu_clock.h.

Typedef Documentation

◆ EVMU_CLOCK_DIVIDER

typedef GblEnum EVMU_CLOCK_DIVIDER

Definition at line 72 of file evmu_clock.h.

◆ EVMU_CLOCK_SIGNAL

typedef GblEnum EVMU_CLOCK_SIGNAL

Definition at line 54 of file evmu_clock.h.

◆ EVMU_CLOCK_SYSTEM_STATE

typedef GblEnum EVMU_CLOCK_SYSTEM_STATE

Definition at line 64 of file evmu_clock.h.

◆ EVMU_OSCILLATOR

typedef GblEnum EVMU_OSCILLATOR

Definition at line 47 of file evmu_clock.h.

Enumeration Type Documentation

◆ EVMU_CLOCK_DIVIDER

enum EVMU_CLOCK_DIVIDER

Definition at line 72 of file evmu_clock.h.

72 {
73 EVMU_CLOCK_DIVIDER_1,
74 EVMU_CLOCK_DIVIDER_12,
75 EVMU_CLOCK_DIVIDER_6, //REBOOTS VMU FOR RC CLOCK
76 EVMU_CLOCK_DIVIDER_COUNT
77};

◆ EVMU_CLOCK_SIGNAL

enum EVMU_CLOCK_SIGNAL

Definition at line 54 of file evmu_clock.h.

54 {
55// EVMU_CLOCK_SIGNAL_OSCILLATOR_QUARTZ,
56// EVMU_CLOCK_SIGNAL_OSCILLATOR_RC,
57// EVMU_CLOCK_SIGNAL_OSCILLATOR_CF,
58 EVMU_CLOCK_SIGNAL_CYCLE,
59 EVMU_CLOCK_SIGNAL_SYSTEM_1 = EVMU_CLOCK_SIGNAL_CYCLE,
60 EVMU_CLOCK_SIGNAL_SYSTEM_2,
61 EVMU_CLOCK_SIGNAL_COUNT
62};

◆ EVMU_CLOCK_SYSTEM_STATE

enum EVMU_CLOCK_SYSTEM_STATE

Definition at line 64 of file evmu_clock.h.

64 {
65 EVMU_CLOCK_SYSTEM_STATE_UNKNOWN,
66 EVMU_CLOCK_SYSTEM_STATE_RUNNING,
67 EVMU_CLOCK_SYSTEM_STATE_HALT,
68 EVMU_CLOCK_SYSTEM_STATE_HOLD,
69 EVMU_CLOCK_SYSTEM_STATE_COUNT
70};

◆ EVMU_OSCILLATOR

enum EVMU_OSCILLATOR

Definition at line 47 of file evmu_clock.h.

47 {
48 EVMU_OSCILLATOR_QUARTZ,
49 EVMU_OSCILLATOR_RC, //REBOOTS VMU WITH 1/6
50 EVMU_OSCILLATOR_CF,
51 EVMU_OSCILLATOR_COUNT
52};