Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stm32f10x.h"
- #include "stm32f10x_gpio.h"
- #include "stm32f10x_rcc.h"
- void main(void)
- {
- /* Structure for GPIO */
- GPIO_InitTypeDef GPIO_InitStructure;
- /* Initialize PortA and Enable the Clock*/
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
- /* Configure the GPIO_LED pin (PA1 & PA5) */
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5|GPIO_Pin_1;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_Init(GPIOA, &GPIO_InitStructure);
- /* Toggle LEDs */
- GPIOA->ODR = ((GPIO_Pin_5)|(GPIO_Pin_1));
- while (1)
- { }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement