1 //
2 // JERRY.H: Header file
3 //
4 
5 #ifndef __JERRY_H__
6 #define __JERRY_H__
7 
8 #include <boolean.h>
9 
10 #include "vjag_memory.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 void JERRYInit(void);
17 void JERRYReset(void);
18 void JERRYDone(void);
19 
20 uint8_t JERRYReadByte(uint32_t offset, uint32_t who);
21 uint16_t JERRYReadWord(uint32_t offset, uint32_t who);
22 void JERRYWriteByte(uint32_t offset, uint8_t data, uint32_t who);
23 void JERRYWriteWord(uint32_t offset, uint16_t data, uint32_t who);
24 
25 void JERRYExecPIT(uint32_t cycles);
26 void JERRYI2SExec(uint32_t cycles);
27 
28 int JERRYGetPIT1Frequency(void);
29 int JERRYGetPIT2Frequency(void);
30 
31 // 68000 Interrupt bit positions (enabled at $F10020)
32 
33 enum
34 {
35    IRQ2_EXTERNAL=0x01,
36    IRQ2_DSP=0x02,
37    IRQ2_TIMER1=0x04,
38    IRQ2_TIMER2=0x08,
39    IRQ2_ASI=0x10,
40    IRQ2_SSI=0x20
41 };
42 
43 bool JERRYIRQEnabled(int irq);
44 void JERRYSetPendingIRQ(int irq);
45 
46 // This should stay inside this file, but it's here for now...
47 // Need to set up an interface function so that this can go back
48 void JERRYI2SCallback(void);
49 
50 // External variables
51 
52 extern int32_t JERRYI2SInterruptTimer;
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif
59