text
stringlengths
0
234
STM32_SVD.RCC.RCC_Periph.APB2ENR.AFIOEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.IOPAEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.IOPBEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.IOPCEN := 1;
STM32_SVD.NVIC.NVIC_Periph.ISER0 := 2#00000000_10000000_00000000_00000000#;
BUTTON.Init;
USB_DISC.Init;
SWO.Init;
LED.Init;
LED2.Init;
end Init;
procedure USB_Re_Enumerate is
begin
Ada.Text_IO.Put_Line ("Re-enumerate");
USB_DISC.Set;
declare
I : UInt32 with volatile;
begin
I := 10000;
while I > 0 loop
I := I - 1;
end loop;
Function Definition: procedure Init is
Function Body: begin
STM32_SVD.RCC.RCC_Periph.APB2ENR.AFIOEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.IOPAEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.IOPBEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.IOPCEN := 1;
STM32_SVD.NVIC.NVIC_Periph.ISER0 := 2#00000000_10000000_00000000_00000000#;
BUTTON.Init;
-- SWO.Init;
LED.Init;
LED2.Init;
end Init;
procedure USB_Re_Enumerate is
begin
STM32_SVD.GPIO.GPIOA_Periph.CRH.CNF12 := 0;
STM32_SVD.GPIO.GPIOA_Periph.CRH.MODE12 := 1;
STM32_SVD.GPIO.GPIOA_Periph.BSRR.BR.Arr (12) := 1;
declare
I : UInt32 with volatile;
begin
I := 100000;
while I > 0 loop
I := I - 1;
end loop;
Function Definition: procedure Init is
Function Body: begin
Clocks.Init;
STM32_SVD.RCC.RCC_Periph.APB2ENR.AFIOEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.IOPAEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.IOPBEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.IOPCEN := 1;
STM32_SVD.RCC.RCC_Periph.APB2ENR.USART1EN := 1;
BUTTON.Init;
LED.Init;
LED2.Init;
TX.Init;
RX.Init;
USART.Init;
RTC.Init;
end Init;
procedure USB_Re_Enumerate is
begin
STM32_SVD.GPIO.GPIOA_Periph.CRH.CNF12 := 0;
STM32_SVD.GPIO.GPIOA_Periph.CRH.MODE12 := 1;
STM32_SVD.GPIO.GPIOA_Periph.BSRR.BR.Arr (12) := 1;
declare
I : UInt32 with volatile;
begin
I := 100000;
while I > 0 loop
I := I - 1;
end loop;
Function Definition: procedure Init is
Function Body: RCC : RCC_Peripheral renames RCC_Periph;
begin
if PLL_Source = HSE_Input then
RCC.CR.HSEON := 1;
while RCC.CR.HSERDY = 0 loop
null;
end loop;
end if;
RCC.CFGR := (
PLLMUL => UInt4 (PLL_Mul),
PLLSRC => (
case PLL_Source is
when HSI_Input => 1,
when HSE_Input => 1),
others => <>);
Function Definition: procedure bot is
Function Body: game : T_game;
logic : T_logic;