Code: Select all
program STM32F103V8_16x2;
{ Declarations section }
{ Declarations section }
procedure ExternerInterrupt(); iv IVT_INT_EXTI1; ics ICS_AUTO;
Begin
DisableInterrupts();
GPIOC_ODR := 0x0000; // Setze Port C auf 0;
EXTI_PR := 0x0000001A; //Pending register zurücksetzen
EnableInterrupts();
end;
Begin
GPIO_Digital_Input(@GPIOB_BASE, _GPIO_PINMASK_ALL);
GPIO_Digital_Output(@GPIOC_BASE, _GPIO_PINMASK_ALL); // Set PORTC as digital output
GPIO_Alternate_Function_Enable(@_GPIO_MODULE_SWJ_JTAGDISABLE );
GPIO_Analog_Input(@GPIOA_BASE, _GPIO_PINMASK_1 );
GPIOC_ODR := 1 SHL 13; Schalte LED am Port PC.13 aus (Bluepill)
//*******************************
GPIOB_CRL := 0xFFFFFFFF; //Port configuration register low
RCC_APB2ENR.AFIOEN := 1; // Enable clock for alternate pin functions
AFIO_EXTICR1 := 0x00000010; // PB.1 as External interrupt
EXTI_RTSR := 0xFFFFFFFF; // Set interrupt on Rising edge ####### not ready yet, FFFFFF is wrong, but it work
EXTI_IMR := 0xFFFFFFFF; // Set mask ####### not ready yet, FFFFFF is wrong, but it work
NVIC_IntEnable(IVT_INT_EXTI1); // Enable External interrupt
EnableInterrupts(); // Enables the processor interrupt.
//clk := Clock_MHz();
{ Main program }
While TRUE DO
begin
end.