Skip to content

Instantly share code, notes, and snippets.

@zid
Last active January 29, 2022 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zid/c43521f2a97e84861d995a960b6fe4af to your computer and use it in GitHub Desktop.
Save zid/c43521f2a97e84861d995a960b6fe4af to your computer and use it in GitHub Desktop.
#define BASE 0x1F8000000
#define BANK_SELECT *(volatile unsigned int *)(BASE+0)
#define REGN(x) *(volatile unsigned int *)(BASE+x*4+4)
#define REG_0_0 BANK_SELECT(0); REGN(0)
#define REG_0_1 BANK_SELECT(0); REGN(1)
#define REG_1_0 BANK_SELECT(1); REGN(0)
...
{
REG_1_0 = 3904;
REG_0_0 = 12;
REG_0_1 = 38942;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment