This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Real_Time; use Ada.Real_Time; | |
with Stm32.GPIO; use Stm32.GPIO; | |
with Stm32.RCC; use Stm32.RCC; | |
pragma Elaborate_All (Stm32.GPIO); | |
procedure Cours1 is | |
--Definir la Pin | |
Pin : constant Pin_Type := (GPIOD, 12); | |
begin | |
--Configurer la pin comme une pin de sortie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Stm32.GPIO; use Stm32.GPIO; | |
with Stm32.RCC; use Stm32.RCC; | |
pragma Elaborate_All (Stm32.GPIO); | |
procedure Cours2 is | |
--Definir 2 pins : une pour l'emission et l autre pour la reception | |
Pin1 : constant Pin_Type := (GPIOD, 12); | |
Pin2 : constant Pin_Type := (GPIOA, 0); | |
Params : constant GPIO_Params := (Pins => (Mask => (0 => True, others => False)), | |
Mode => Mode_In, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Real_Time; use Ada.Real_Time; | |
package body Cours4 is | |
--Corps de la tache | |
task body Blink is | |
begin | |
--faire clignoter une led | |
Setup_Out_Pin(Pin.all); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------- | |
-- Cortex-M4 Processor Exceptions Numbers -- | |
-------------------------------------------- | |
-- 2 Non Maskable Interrupt | |
NonMaskableInt_IRQn : constant IRQn_Type := 2; | |
-- 4 Cortex-M4 Memory Management Interrupt | |
MemoryManagement_IRQn : constant IRQn_Type := 4; | |
-- 5 Cortex-M4 Bus Fault Interrupt | |
BusFault_IRQn : constant IRQn_Type := 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Stm32.Timer; use Stm32.Timer; | |
with Stm32.GPIO; use Stm32.GPIO; | |
with Stm32.RCC; use Stm32.RCC; | |
pragma Elaborate_All (Stm32.GPIO); | |
with Interfaces; use Interfaces; | |
procedure Cours5 is | |
--Configurer les parametres du timer | |
Params : constant Timer_Params := | |
(Prescaler =>40000, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Cours6incl; use Cours6incl; | |
procedure Cours6 is | |
begin | |
--executer procedure principale | |
run; | |
end Cours6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Stm32.Timer; use Stm32.Timer; | |
with Ada.Real_Time; use Ada.Real_Time; | |
with Stm32.GPIO; use Stm32.GPIO; | |
with Stm32.RCC; use Stm32.RCC; | |
pragma Elaborate_All (Stm32.GPIO); | |
with Interfaces; use Interfaces; | |
procedure Cours7 is | |
--Declaration des parametres du timer | |
Params_Timer : constant Timer_Params := |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Stm32.USB; use Stm32.USB; | |
with Stm32.Defines; use Stm32.Defines; | |
with Stm32.ADC; use Stm32.ADC; | |
with Interfaces; use Interfaces; | |
procedure TestADC is | |
--Specific parameters. | |
Params : constant ADC_Params := | |
(Resolution => Resolution_12b, | |
Scan_Conv_Mode => Disable, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Stm32.USB; use Stm32.USB; | |
with Stm32.Defines; use Stm32.Defines; | |
with Stm32.ADC; use Stm32.ADC; | |
with Interfaces; use Interfaces; | |
pragma Elaborate_All(Stm32.ADC); | |
package body TestADC is | |
--Specific parameters. | |
Params : constant ADC_Params := | |
(Resolution => Resolution_12b, |
OlderNewer