forked from trocache/RefKEIL
28 lines
485 B
C
28 lines
485 B
C
#include "stm32f10x.h"
|
|
#include "Driver_GPIO.h"
|
|
|
|
int main ( void )
|
|
{
|
|
// Clocks des ports A, B, C
|
|
RCC->APB2ENR |= (0x01 << 2) | (0x01 << 3) | (0x01 << 4) ;
|
|
|
|
GPIOA->CRL &= ~(0xF << 20); // Mise à 0
|
|
GPIOA->CRL |= (0x1 << 20); // Output
|
|
GPIOA->BSRR |= (0x01 << 5);
|
|
|
|
// Configure PC13 as input with pull-up
|
|
GPIOC->CRH &=~ (1<<)
|
|
|
|
GPIOC->CRH &= ~(0x1 << 22)
|
|
GPIOC->CRH |= GPIO_CRH_CNF13_1;
|
|
GPIOC->ODR |= GPIO_ODR_ODR13;
|
|
|
|
//GPIOA->BSRR |= (1 << 21);
|
|
|
|
|
|
for (;;)
|
|
{
|
|
|
|
}
|
|
|
|
}
|