Created
January 18, 2019 15:18
-
-
Save nscooling/c53aaa6d353d908de5283ee1d5edad5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(void) | |
{ | |
*rcc_ahb1enr |= (1 << 3); // enable PortD's clock | |
// assume powerup conditions, moder is all 0's | |
// set bit-8 as output | |
uint32_t moder = portd->MODER; | |
moder |= (1 << 16); | |
moder &= ~(1 << 17); | |
portd->MODER = moder; | |
while (1) { | |
portd->ODR |= (1 << 8); // led-on | |
sleep(500); | |
portd->ODR &= ~(1 << 8); // led-off | |
sleep(500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment