Skip to content

Instantly share code, notes, and snippets.

@wdwalker
Last active March 11, 2017 14:46
Show Gist options
  • Save wdwalker/7ba0a05d4f462c30e922d4d386d9caf7 to your computer and use it in GitHub Desktop.
Save wdwalker/7ba0a05d4f462c30e922d4d386d9caf7 to your computer and use it in GitHub Desktop.
Set FIODIR of pins to output for LED1-4
#define P18 (1 << 18)
#define P20 (1 << 20)
#define P21 (1 << 21)
#define P23 (1 << 23)
#define ALL (P18 | P20 | P21 | P23)
...
/* Set the direction as output by setting the associated bits
* to 1 (p133)
*/
LPC_GPIO1->FIODIR |= ALL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment