Skip to content
Snippets Groups Projects
Commit 287c96e0 authored by Mark Frost's avatar Mark Frost
Browse files

Blink LED pin on MuseLabs nanoCH32V003 board

These boards have an LED on D6

https://github.com/wuxx/nanoCH32V003
parent ff623dfb
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -16,16 +16,20 @@ int main()
GPIOD->CFGLR &= ~(0xf<<(4*4));
GPIOD->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*4);
// GPIO D6 Push-Pull
GPIOD->CFGLR &= ~(0xf<<(4*6));
GPIOD->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*6);
// GPIO C0 Push-Pull
GPIOC->CFGLR &= ~(0xf<<(4*0));
GPIOC->CFGLR |= (GPIO_Speed_10MHz | GPIO_CNF_OUT_PP)<<(4*0);
while(1)
{
GPIOD->BSHR = 1 | (1<<4); // Turn on GPIOs
GPIOC->BSHR = 1;
GPIOD->BSHR = (1<<0) | (1<<4) | (1<<6); // Turn on GPIOs
GPIOC->BSHR = (1<<0);
Delay_Ms( 250 );
GPIOD->BSHR = (1<<16) | (1<<(16+4)); // Turn off GPIODs
GPIOD->BSHR = (1<<16) | (1<<(16+4)) | (1<<(16+6)); // Turn off GPIOs
GPIOC->BSHR = (1<<16);
Delay_Ms( 250 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment