|
65 | 65 | // 30 = Shared RAM 0x80nnnn00 |
66 | 66 | // 31 = mDDR/DDR2 Data 0xC0nnnn00 |
67 | 67 |
|
| 68 | +// GPIO peripheral |
| 69 | +typedef struct hw_gpio { |
| 70 | + uint32_t revid; |
| 71 | + uint32_t _pad0; |
| 72 | + uint32_t binten; |
| 73 | + uint32_t _pad1; |
| 74 | + |
| 75 | + uint32_t dir01; |
| 76 | + uint32_t out_data01; |
| 77 | + uint32_t set_data01; |
| 78 | + uint32_t clr_data01; |
| 79 | + uint32_t in_data01; |
| 80 | + uint32_t set_ris_trig01; |
| 81 | + uint32_t clr_ris_trig01; |
| 82 | + uint32_t set_fal_trig01; |
| 83 | + uint32_t clr_fal_trig01; |
| 84 | + uint32_t intstat01; |
| 85 | + |
| 86 | + uint32_t dir23; |
| 87 | + uint32_t out_data23; |
| 88 | + uint32_t set_data23; |
| 89 | + uint32_t clr_data23; |
| 90 | + uint32_t in_data23; |
| 91 | + uint32_t set_ris_trig23; |
| 92 | + uint32_t clr_ris_trig23; |
| 93 | + uint32_t set_fal_trig23; |
| 94 | + uint32_t clr_fal_trig23; |
| 95 | + uint32_t intstat23; |
| 96 | + |
| 97 | + uint32_t dir45; |
| 98 | + uint32_t out_data45; |
| 99 | + uint32_t set_data45; |
| 100 | + uint32_t clr_data45; |
| 101 | + uint32_t in_data45; |
| 102 | + uint32_t set_ris_trig45; |
| 103 | + uint32_t clr_ris_trig45; |
| 104 | + uint32_t set_fal_trig45; |
| 105 | + uint32_t clr_fal_trig45; |
| 106 | + uint32_t intstat45; |
| 107 | + |
| 108 | + uint32_t dir67; |
| 109 | + uint32_t out_data67; |
| 110 | + uint32_t set_data67; |
| 111 | + uint32_t clr_data67; |
| 112 | + uint32_t in_data67; |
| 113 | + uint32_t set_ris_trig67; |
| 114 | + uint32_t clr_ris_trig67; |
| 115 | + uint32_t set_fal_trig67; |
| 116 | + uint32_t clr_fal_trig67; |
| 117 | + uint32_t intstat67; |
| 118 | + |
| 119 | + uint32_t dir8; |
| 120 | + uint32_t out_data8; |
| 121 | + uint32_t set_data8; |
| 122 | + uint32_t clr_data8; |
| 123 | + uint32_t in_data8; |
| 124 | + uint32_t set_ris_trig8; |
| 125 | + uint32_t clr_ris_trig8; |
| 126 | + uint32_t set_fal_trig8; |
| 127 | + uint32_t clr_fal_trig8; |
| 128 | + uint32_t intstat8; |
| 129 | +} hw_gpio; |
| 130 | +_Static_assert(sizeof(hw_gpio) == 0xd8); |
| 131 | +static volatile hw_gpio * const GPIO = (volatile hw_gpio *)0x01E26000; |
| 132 | + |
| 133 | +// Timer0 peripheral (only what we need) |
| 134 | +static volatile uint32_t * const TIMER0_TIM34 = (volatile uint32_t *)0x01C20014; |
| 135 | + |
68 | 136 | #endif |
0 commit comments