libdragon
Loading...
Searching...
No Matches
mi.h
Go to the documentation of this file.
1
8#ifndef __LIBDRAGON_MI_H
9#define __LIBDRAGON_MI_H
10
11#include <stdint.h>
12
13#define MI_MODE ((volatile uint32_t*)0xA4300000)
14#define MI_VERSION ((volatile uint32_t*)0xA4300004)
15#define MI_INTERRUPT ((volatile uint32_t*)0xA4300008)
16#define MI_MASK ((volatile uint32_t*)0xA430000C)
17#define MI_BB_SECURE_EXCETPION ((volatile uint32_t*)0xA4300014)
18#define MI_BB_RANDOM ((volatile uint32_t*)0xA430002C)
19#define MI_BB_INTERRUPT ((volatile uint32_t*)0xA4300038)
20#define MI_BB_MASK ((volatile uint32_t*)0xA430003C)
21
22#define MI_MODE_UPPER 0x00000200
23#define MI_MODE_EBUS 0x00000100
24#define MI_MODE_REPEAT 0x00000080
25#define MI_MODE_REPEAT_COUNT 0x0000007F
26
27#define MI_WMODE_SET_UPPER 0x00002000
28#define MI_WMODE_CLR_UPPER 0x00001000
29#define MI_WMODE_CLR_DPINT 0x00000800
30#define MI_WMODE_SET_EBUS 0x00000400
31#define MI_WMODE_CLR_EBUS 0x00000200
32#define MI_WMODE_SET_REPEAT 0x00000100
33#define MI_WMODE_CLR_REPEAT 0x00000080
34
35#define MI_BB_INTERRUPT_MD_STATE 0x02000000
36#define MI_BB_INTERRUPT_BTN_STATE 0x01000000
37#define MI_BB_INTERRUPT_MD 0x00002000
38#define MI_BB_INTERRUPT_BTN 0x00001000
39#define MI_BB_INTERRUPT_USB1 0x00000800
40#define MI_BB_INTERRUPT_USB0 0x00000400
41#define MI_BB_INTERRUPT_PI_ERR 0x00000200
42#define MI_BB_INTERRUPT_IDE 0x00000100
43#define MI_BB_INTERRUPT_AES 0x00000080
44#define MI_BB_INTERRUPT_FLASH 0x00000040
45#define MI_INTERRUPT_DP 0x00000020
46#define MI_INTERRUPT_PI 0x00000010
47#define MI_INTERRUPT_VI 0x00000008
48#define MI_INTERRUPT_AI 0x00000004
49#define MI_INTERRUPT_SI 0x00000002
50#define MI_INTERRUPT_SP 0x00000001
51
52#define MI_BB_MASK_MD 0x2000
53#define MI_BB_MASK_BTN 0x1000
54#define MI_BB_MASK_USB1 0x0800
55#define MI_BB_MASK_USB0 0x0400
56#define MI_BB_MASK_PI_ERR 0x0200
57#define MI_BB_MASK_IDE 0x0100
58#define MI_BB_MASK_AES 0x0080
59#define MI_BB_MASK_FLASH 0x0040
60#define MI_MASK_DP 0x0020
61#define MI_MASK_PI 0x0010
62#define MI_MASK_VI 0x0008
63#define MI_MASK_AI 0x0004
64#define MI_MASK_SI 0x0002
65#define MI_MASK_SP 0x0001
66
67#define MI_BB_WMASK_SET_MD 0x08000000
68#define MI_BB_WMASK_CLR_MD 0x04000000
69#define MI_BB_WMASK_SET_BTN 0x02000000
70#define MI_BB_WMASK_CLR_BTN 0x01000000
71#define MI_BB_WMASK_SET_USB1 0x00800000
72#define MI_BB_WMASK_CLR_USB1 0x00400000
73#define MI_BB_WMASK_SET_USB0 0x00200000
74#define MI_BB_WMASK_CLR_USB0 0x00100000
75#define MI_BB_WMASK_SET_PI_ERR 0x00080000
76#define MI_BB_WMASK_CLR_PI_ERR 0x00040000
77#define MI_BB_WMASK_SET_IDE 0x00020000
78#define MI_BB_WMASK_CLR_IDE 0x00010000
79#define MI_BB_WMASK_SET_AES 0x00008000
80#define MI_BB_WMASK_CLR_AES 0x00004000
81#define MI_BB_WMASK_SET_FLASH 0x00002000
82#define MI_BB_WMASK_CLR_FLASH 0x00001000
83#define MI_WMASK_SET_DP 0x00000800
84#define MI_WMASK_CLR_DP 0x00000400
85#define MI_WMASK_SET_PI 0x00000200
86#define MI_WMASK_CLR_PI 0x00000100
87#define MI_WMASK_SET_VI 0x00000080
88#define MI_WMASK_CLR_VI 0x00000040
89#define MI_WMASK_SET_AI 0x00000020
90#define MI_WMASK_CLR_AI 0x00000010
91#define MI_WMASK_SET_SI 0x00000008
92#define MI_WMASK_CLR_SI 0x00000004
93#define MI_WMASK_SET_SP 0x00000002
94#define MI_WMASK_CLR_SP 0x00000001
95
96#endif