Skip to content

Instantly share code, notes, and snippets.

@oyvindrobertsen
Last active December 28, 2015 02:39
Show Gist options
  • Save oyvindrobertsen/7429983 to your computer and use it in GitHub Desktop.
Save oyvindrobertsen/7429983 to your computer and use it in GitHub Desktop.
.thumb
.syntax unified
.include "gpio_constants.s" // Register-adresser og konstanter for GPIO
.text
.global Start
.global GPIO_ODD_IRQHandler
Start:
MOV R0, #5
BAL Start
.thumb_func
GPIO_ODD_IRQHandler:
// Do the actual toggling
LDR R0, =GPIO_BASE
MOV R1, #0b00000100 // pins 0-7 from right to left
STR R1, [R0, #PORT_SIZE * PORT_E + GPIO_PORT_DOUTTGL]
// Clear interrupt flag
LDR R0, =GPIO_BASE
LDR R1, [R0, #GPIO_IF]
STR R1, [R0, #GPIO_IFC]
BX LR
NOP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment