Anonymous user
Raspberry Pi Bare Bones: Difference between revisions
m
→Writing a kernel in C
[unchecked revision] | [unchecked revision] |
Line 220:
#include <stddef.h>
#include <stdint.h>
// board type, raspi2
int raspi = 2;
// Memory-Mapped I/O output
Line 243 ⟶ 246:
{
// The GPIO registers base address.
switch (raspi) {
GPIO_BASE = 0x3F200000, // for raspi2 & 3, 0x20200000 for raspi1▼
case 2:
case 4: GPIO_BASE = 0xFE200000; break; // for raspi4
default: GPIO_BASE = 0x20200000; break; // for raspi1, raspi zero etc.
}
// The offsets for reach register.
|