Skip to content

Instantly share code, notes, and snippets.

@jankowskib
Created September 15, 2014 10:34
Show Gist options
  • Save jankowskib/173fd118177e6e25b1fd to your computer and use it in GitHub Desktop.
Save jankowskib/173fd118177e6e25b1fd to your computer and use it in GitHub Desktop.
Convert A31/A31s gpio number -> ID
#define PA_NR 28
#define PB_NR 8
#define PC_NR 28
#define PD_NR 28
#define PE_NR 17
#define PF_NR 6
#define PG_NR 19
#define PH_NR 31
#define PL_NR 9
#define PM_NR 8
EG: val 186
PA_NR + PB_NR + PC_NR + PD_NR + PE_NR + PF_NR + PG_NR + PH_NR = 165
2*(iterated_banks) = 2 * 8 = 16
bank = 165 + 16 = 181 | 181<_186_<192 = PL
186- 181 = 5
PL05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment