2017-03-26 18:16:39 +08:00
|
|
|
|
2017-04-04 02:51:08 +08:00
|
|
|
#include "stm32l031xx.h"
|
|
|
|
|
2017-03-26 18:16:39 +08:00
|
|
|
int main()
|
|
|
|
{
|
2017-04-04 02:51:08 +08:00
|
|
|
//RCC->CFGR &=
|
|
|
|
RCC->IOPENR |= RCC_IOPENR_IOPAEN; /* Enable clock for GPIO Port A */
|
|
|
|
__NOP();
|
|
|
|
RCC->IOPRSTR |= RCC_IOPRSTR_IOPARST; /* reset GPIO Port A */
|
|
|
|
__NOP();
|
|
|
|
|
|
|
|
GPIOA->MODER &= ~GPIO_MODER_MODE13; /* clear mode for PA13 */
|
|
|
|
GPIOA->MODER |= GPIO_MODER_MODE13_1; /* Output mode for PA13 */
|
|
|
|
GPIOA->OTYPER &= ~GPIO_OTYPER_OT_13; /* no Push/Pull for PA13 */
|
|
|
|
GPIOA->OSPEEDR &= ~GPIO_OSPEEDER_OSPEED13; /* low speed for PA13 */
|
|
|
|
GPIOA->PUPDR &= ~GPIO_PUPDR_PUPD13; /* no pullup/pulldown for PA13 */
|
|
|
|
//GPIOA->BSRR = GPIO_BSRR_BS_13; /* atomic set PA13 */
|
|
|
|
GPIOA->BSRR = GPIO_BSRR_BR_13; /* atomic clr PA13 */
|
|
|
|
|
|
|
|
for(;;)
|
|
|
|
;
|
2017-03-26 18:16:39 +08:00
|
|
|
}
|