
Пришло время Ады )
https://www.embedded.com/electronics-bl … me-for-Ada
Developing Embedded Systems in Ada
https://www.youtube.com/watch?v=FTdHWjg38QE
Ada Driver Library for ARM Cortex-M
https://community.arm.com/iot/embedded/ … --part-1-2
https://community.arm.com/iot/embedded/ … --part-2-2
Вот так это выглядит в приложении к эмбеду
-- Definition of the GPIO config field type GPIO_Config is … with Size => 4; type GPIO_Low_List is array (1 .. 8) of GPIO_Config with Pack, Element_Size => 4, Size => 32; type GPIO_High_List is array (9 .. 16) of GPIO_Config with Pack, Element_Size => 4, Size => 32;
type Field1 is … with Size => 5;
type Field2 is .. with Size => 15;
type Field3 is … with Size => 12;
type The_Register is record
F1 : Field1;
F2 : Field2;
F3 : Field3;
end record
with Size => 32,
Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for The_Register use record
F1 at 0 range 0 .. 4;
F2 at 0 range 5 .. 19;
F3 at 0 range 20 .. 31;
end record;
declare
Register : The_Register with Address => Reg_Addr;
begin
Register.F2 := 5;
end;type My_Peripheral is record Reg1 : Reg1_Type; Reg2 : Reg2_Type; end record with Volatile; for My_Peripheral use record Reg1 at 0 range 0 .. 31; Reg2 at 4 range 0 .. 31; end record; Periph1 : My_Peripheral with Import, Address => Base_Peripheral_Address;
task body Periodic_Hello is
Print_Time : Time := Clock;
Period : constant Time_Span := Milliseconds (500);
begin
loop
Print_Time := Print_Time + Period;
delay until Print_Time;
Put_Line (“Periodic hello world!”); end loop;
end Periodic_Hello;User_Button_Interrupt : constant Interrupt_ID := EXTI0_Interrupt; protected User_Button is pragma Interrupt_Priority; function Get_State return Boolean; procedure Clear_State; entry Wait_Press; private procedure Interrupt; pragma Attach_Handler (Interrupt, User_Button_Interrupt); Pressed : Boolean := False; end User_Button;


