diff --git a/arch/ARM/Nordic/devices/nrf52/nrf-device.adb b/arch/ARM/Nordic/devices/nrf52/nrf-device.adb index 454cd8e52..c6f9a4b4a 100644 --- a/arch/ARM/Nordic/devices/nrf52/nrf-device.adb +++ b/arch/ARM/Nordic/devices/nrf52/nrf-device.adb @@ -9,14 +9,30 @@ with NRF_SVD.TEMP; use NRF_SVD.TEMP; package body nRF.Device is - Undocumented_Reg_FE0: UInt32 + Undocumented_Reg_FE0 : UInt32 with Address => System'To_Address (16#F0000FE0#); - Undocumented_Reg_FE4: UInt32 + Undocumented_Reg_FE4 : UInt32 with Address => System'To_Address (16#F0000FE4#); - Undocumented_Reg_FE8: UInt32 + Undocumented_Reg_FE8 : UInt32 with Address => System'To_Address (16#F0000FE8#); - FE0_Is_Six: constant Boolean := (Undocumented_Reg_FE0 and 16#FF#) = 6; - FE4_Is_Zero: constant Boolean := (Undocumented_Reg_FE0 and 16#0F#) = 0; + FE0_Is_Six : constant Boolean := (Undocumented_Reg_FE0 and 16#FF#) = 6; + FE4_Is_Zero : constant Boolean := (Undocumented_Reg_FE0 and 16#0F#) = 0; + + function Errata_12 return Boolean; + function Errata_16 return Boolean; + function Errata_31 return Boolean; + function Errata_32 return Boolean; + function Errata_36 return Boolean; + function Errata_37 return Boolean; + function Errata_57 return Boolean; + function Errata_66 return Boolean; + function Errata_136 return Boolean; + function Errata_182 return Boolean; + function Errata_108 return Boolean; + + --------------- + -- Errata_12 -- + --------------- function Errata_12 return Boolean is begin @@ -31,11 +47,15 @@ package body nRF.Device is return False; end Errata_12; - E12_Undocumented_COMP_Reg_540: UInt32 + E12_Undocumented_COMP_Reg_540 : UInt32 with Address => System'To_Address (16#40013540#); - E12_Undocumented_FICR_Reg_324: UInt32 + E12_Undocumented_FICR_Reg_324 : UInt32 with Address => System'To_Address (16#10000324#); + --------------- + -- Errata_16 -- + --------------- + function Errata_16 return Boolean is begin if FE0_Is_Six and FE4_Is_Zero and Undocumented_Reg_FE8 = 16#30# then @@ -44,51 +64,75 @@ package body nRF.Device is return False; end Errata_16; - E16_Undocumented_Reg_074: UInt32 + E16_Undocumented_Reg_074 : UInt32 with Address => System'To_Address (16#4007C074#); + --------------- + -- Errata_31 -- + --------------- + function Errata_31 return Boolean is begin return Errata_12; end Errata_31; - E31_Undocumented_CLOCK_Reg_53C: UInt32 with + E31_Undocumented_CLOCK_Reg_53C : UInt32 with Address => System'To_Address (16#4000053C#); - E31_Undocumented_FICR_Reg_244: UInt32 with + E31_Undocumented_FICR_Reg_244 : UInt32 with Address => System'To_Address (16#10000244#); + --------------- + -- Errata_32 -- + --------------- + function Errata_32 return Boolean is begin return Errata_16; end Errata_32; + --------------- + -- Errata_36 -- + --------------- + function Errata_36 return Boolean is begin return Errata_12; end Errata_36; + --------------- + -- Errata_37 -- + --------------- + function Errata_37 return Boolean is begin return Errata_16; end Errata_37; - E37_Undocumented_Reg_5A0: UInt32 with + E37_Undocumented_Reg_5A0 : UInt32 with Address => System'To_Address (16#400005A0#); + --------------- + -- Errata_57 -- + --------------- + function Errata_57 return Boolean is begin return Errata_16; end Errata_57; - E57_Undocumented_NFCT_Reg_610: UInt32 with + E57_Undocumented_NFCT_Reg_610 : UInt32 with Address => System'To_Address (16#40005610#); - E57_Undocumented_NFCT_Reg_614: UInt32 with + E57_Undocumented_NFCT_Reg_614 : UInt32 with Address => System'To_Address (16#40005614#); - E57_Undocumented_NFCT_Reg_618: UInt32 with + E57_Undocumented_NFCT_Reg_618 : UInt32 with Address => System'To_Address (16#40005618#); - E57_Undocumented_NFCT_Reg_688: UInt32 with + E57_Undocumented_NFCT_Reg_688 : UInt32 with Address => System'To_Address (16#40005688#); + --------------- + -- Errata_66 -- + --------------- + function Errata_66 return Boolean is begin if FE0_Is_Six and FE4_Is_Zero and Undocumented_Reg_FE8 = 16#50# then @@ -97,75 +141,87 @@ package body nRF.Device is return False; end Errata_66; + ---------------- + -- Errata_108 -- + ---------------- + function Errata_108 return Boolean is begin return Errata_12; end Errata_108; - E108_Undocumented_Reg_EE4: UInt32 with + E108_Undocumented_Reg_EE4 : UInt32 with Address => System'To_Address (16#40000EE4#); - E108_Undocumented_FICR_Reg_258: UInt32 with + E108_Undocumented_FICR_Reg_258 : UInt32 with Address => System'To_Address (16#10000258#); + ---------------- + -- Errata_136 -- + ---------------- + function Errata_136 return Boolean is begin return Errata_12; end Errata_136; + ---------------- + -- Errata_182 -- + ---------------- + function Errata_182 return Boolean is - Undocumented_FICR_Reg_130: UInt32 + Undocumented_FICR_Reg_130 : UInt32 with Address => System'To_Address (16#10000130#); - Undocumented_FICR_Reg_134: UInt32 + Undocumented_FICR_Reg_134 : UInt32 with Address => System'To_Address (16#10000130#); begin return Undocumented_FICR_Reg_130 = 6 and Undocumented_FICR_Reg_134 = 6; end Errata_182; - E182_Undocumented_Reg_73C: UInt32 with + E182_Undocumented_Reg_73C : UInt32 with Address => System'To_Address (16#4000173C#); begin if Errata_12 then - -- Workaround for Errata 12 "COMP: Reference ladder not correctly - -- calibrated" + -- Workaround for Errata 12 "COMP: Reference ladder not correctly + -- calibrated" E12_Undocumented_COMP_Reg_540 := - Shift_Right(E12_Undocumented_FICR_Reg_324 and 16#1F00#, 8); + Shift_Right (E12_Undocumented_FICR_Reg_324 and 16#1F00#, 8); end if; if Errata_16 then - -- Workaround for Errata 16 "System: RAM may be corrupt on wakeup from CPU - -- IDLE" + -- Workaround for Errata 16 "System: RAM may be corrupt on wakeup from CPU + -- IDLE" E16_Undocumented_Reg_074 := 3131961357; end if; if Errata_31 then - -- Workaround for Errata 31 "CLOCK: Calibration values are not correctly - -- loaded from FICR at reset" + -- Workaround for Errata 31 "CLOCK: Calibration values are not correctly + -- loaded from FICR at reset" E31_Undocumented_CLOCK_Reg_53C := - Shift_Right(E31_Undocumented_FICR_Reg_244 and 16#E000#, 13); + Shift_Right (E31_Undocumented_FICR_Reg_244 and 16#E000#, 13); end if; if Errata_32 then - -- Workaround for Errata 32 "DIF: Debug session automatically enables - -- TracePort pins" + -- Workaround for Errata 32 "DIF: Debug session automatically enables + -- TracePort pins" Debug_Periph.DEMCR.TRCENA := False; end if; if Errata_36 then - -- Workaround for Errata 36 "CLOCK: Some registers are not reset when - -- expected" + -- Workaround for Errata 36 "CLOCK: Some registers are not reset when + -- expected" CLOCK_Periph.EVENTS_DONE.EVENTS_DONE := False; CLOCK_Periph.EVENTS_CTTO.EVENTS_CTTO := False; CLOCK_Periph.CTIV.CTIV := 0; end if; if Errata_37 then - -- Workaround for Errata 37 "RADIO: Encryption engine is slow by default" + -- Workaround for Errata 37 "RADIO: Encryption engine is slow by default" E37_Undocumented_Reg_5A0 := 3; end if; if Errata_57 then - -- Workaround for Errata 57 "NFCT: NFC Modulation amplitude" + -- Workaround for Errata 57 "NFCT: NFC Modulation amplitude" E57_Undocumented_NFCT_Reg_610 := 5; E57_Undocumented_NFCT_Reg_688 := 1; E57_Undocumented_NFCT_Reg_618 := 0; @@ -173,8 +229,8 @@ begin end if; if Errata_66 then - -- Workaround for Errata 66 "TEMP: Linearity specification not met with - -- default settings" + -- Workaround for Errata 66 "TEMP: Linearity specification not met with + -- default settings" TEMP_Periph.A0.A0 := FICR_Periph.TEMP.A0.A; TEMP_Periph.A1.A1 := FICR_Periph.TEMP.A1.A; TEMP_Periph.A2.A2 := FICR_Periph.TEMP.A2.A; @@ -197,24 +253,24 @@ begin end if; if Errata_108 then - -- Workaround for Errata 108 "RAM: RAM content cannot be trusted upon - -- waking up from System ON Idle or System OFF mode" + -- Workaround for Errata 108 "RAM: RAM content cannot be trusted upon + -- waking up from System ON Idle or System OFF mode" E108_Undocumented_Reg_EE4 := E108_Undocumented_FICR_Reg_258 and 16#4F#; end if; if Errata_136 then - -- Workaround for Errata 136 "System: Bits in RESETREAS are set when they - -- should not be" + -- Workaround for Errata 136 "System: Bits in RESETREAS are set when they + -- should not be" if POWER_Periph.RESETREAS.RESETPIN = Detected then POWER_Periph.RESETREAS.RESETPIN := Notdetected; end if; end if; if Errata_182 then - -- Workaround for Errata 182 "RADIO: Fixes for anomalies #102, #106, and - -- #107 do not take effect" + -- Workaround for Errata 182 "RADIO: Fixes for anomalies #102, #106, and + -- #107 do not take effect" E182_Undocumented_Reg_73C := - E182_Undocumented_Reg_73C or Shift_Left(1, 10); + E182_Undocumented_Reg_73C or Shift_Left (1, 10); end if; end nRF.Device; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-clock-set_high_freq_external_frequency.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-clock-set_high_freq_external_frequency.adb index b9be7c4cc..e5ca9065c 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-clock-set_high_freq_external_frequency.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-clock-set_high_freq_external_frequency.adb @@ -1,4 +1,4 @@ -separate(nRF.Clock) +separate (nRF.Clock) procedure Set_High_Freq_External_Frequency (Freq : High_Freq_Ext_Freq) is begin CLOCK_Periph.XTALFREQ.XTALFREQ := (case Freq is diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-interrupts.ads b/arch/ARM/Nordic/drivers/nrf51/nrf-interrupts.ads index 1dd1e810f..e994c57a6 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-interrupts.ads +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-interrupts.ads @@ -29,9 +29,10 @@ -- -- ------------------------------------------------------------------------------ -with HAL; use HAL; +with Cortex_M.NVIC; package nRF.Interrupts is + type Interrupt_Name is (POWER_CLOCK_Interrupt, RADIO_Interrupt, @@ -66,7 +67,7 @@ package nRF.Interrupts is Unused_Interrupt_6, Unused_Interrupt_7); - subtype Interrupt_Priority is UInt8; + subtype Interrupt_Priority is Cortex_M.NVIC.Interrupt_Priority; procedure Set_Priority (Int : Interrupt_Name; Prio : Interrupt_Priority); procedure Enable (Int : Interrupt_Name); diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-add_to_group.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-add_to_group.adb index 800e18883..f59d4144b 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-add_to_group.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-add_to_group.adb @@ -1,4 +1,4 @@ -separate(nRF.PPI) +separate (nRF.PPI) procedure Add_To_Group (Chan : Channel_ID; Group : Group_ID) diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-disable_channel.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-disable_channel.adb index b6eb7b35e..53e7605b2 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-disable_channel.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-disable_channel.adb @@ -1,4 +1,4 @@ -separate(nRF.PPI) +separate (nRF.PPI) procedure Disable_Channel (Chan : Channel_ID) is Arr : CHENCLR_CH_Field_Array := (others => Chenclr_Ch0_Field_Reset); begin diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-enable_channel.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-enable_channel.adb index d201b380f..a0b1398d3 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-enable_channel.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-enable_channel.adb @@ -1,4 +1,4 @@ -separate(nRF.PPI) +separate (nRF.PPI) procedure Enable_Channel (Chan : Channel_ID) is Arr : CHENSET_CH_Field_Array := (others => Chenset_Ch0_Field_Reset); begin diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-remove_from_group.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-remove_from_group.adb index d56555f6c..a2a0f6a72 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-remove_from_group.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-ppi-remove_from_group.adb @@ -1,4 +1,4 @@ -separate(nRF.PPI) +separate (nRF.PPI) procedure Remove_From_Group (Chan : Channel_ID; Group : Group_ID) diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-rng-read.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-rng-read.adb index bfa673fdb..786a61d9c 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-rng-read.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-rng-read.adb @@ -1,4 +1,4 @@ -separate(nRF.RNG) +separate (nRF.RNG) function Read return UInt8 is begin -- Clear event diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-clear.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-clear.adb index bfbce00dd..e6a34f9bd 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-clear.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-clear.adb @@ -1,4 +1,4 @@ -separate(nRF.RTC) +separate (nRF.RTC) procedure Clear (This : Real_Time_Counter) is begin This.Periph.TASKS_CLEAR := 1; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-start.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-start.adb index 818884a0a..31705611c 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-start.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-start.adb @@ -1,4 +1,4 @@ -separate(nRF.RTC) +separate (nRF.RTC) procedure Start (This : Real_Time_Counter) is begin This.Periph.TASKS_START := 1; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-stop.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-stop.adb index efd092452..19cd616fe 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-stop.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-rtc-stop.adb @@ -1,4 +1,4 @@ -separate(nRF.RTC) +separate (nRF.RTC) procedure Stop (This : Real_Time_Counter) is begin This.Periph.TASKS_STOP := 1; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-temperature-read.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-temperature-read.adb index 5b9800648..c37f25b32 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-temperature-read.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-temperature-read.adb @@ -1,6 +1,11 @@ -separate(nRF.Temperature) +with HAL; + +separate (nRF.Temperature) function Read return Temp_Celsius is + use type HAL.UInt32; + Raw : RAW_Temp; + begin -- Clear event diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-timers-capture.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-timers-capture.adb index 4168ec576..9ca8dc8cb 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-timers-capture.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-timers-capture.adb @@ -1,6 +1,6 @@ -separate(nRF.Timers) +separate (nRF.Timers) procedure Capture (This : in out Timer; - Chan : Timer_Channel) + Chan : Timer_Channel) is begin This.Periph.TASKS_CAPTURE (Integer (Chan)) := 1; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-timers-clear.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-timers-clear.adb index d49f51bd2..13e664ade 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-timers-clear.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-timers-clear.adb @@ -1,4 +1,4 @@ -separate(nRF.Timers) +separate (nRF.Timers) procedure Clear (This : in out Timer) is begin This.Periph.TASKS_CLEAR := 1; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-timers-start.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-timers-start.adb index 701b100ab..11bf9f93a 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-timers-start.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-timers-start.adb @@ -1,4 +1,4 @@ -separate(NRF.Timers) +separate (nRF.Timers) procedure Start (This : in out Timer) is begin This.Periph.TASKS_START := 1; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-timers-stop.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-timers-stop.adb index e52d495fc..db23d921c 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-timers-stop.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-timers-stop.adb @@ -1,4 +1,4 @@ -separate(nRF.Timers) +separate (nRF.Timers) procedure Stop (This : in out Timer) is begin This.Periph.TASKS_STOP := 1; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-twi-master_receive.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-twi-master_receive.adb index 5cb27df0e..94d5cfbd6 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-twi-master_receive.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-twi-master_receive.adb @@ -38,17 +38,17 @@ begin loop - if This.Periph.EVENTS_ERROR /= 0 then - Status := Err_Error; - -- Clear the error - This.Periph.EVENTS_ERROR := 0; + if This.Periph.EVENTS_ERROR /= 0 then + Status := Err_Error; + -- Clear the error + This.Periph.EVENTS_ERROR := 0; - Stop_Sequence (This); + Stop_Sequence (This); - return; - end if; + return; + end if; - exit when This.Periph.EVENTS_RXDREADY /= 0; + exit when This.Periph.EVENTS_RXDREADY /= 0; end loop; -- Clear the event @@ -57,10 +57,10 @@ begin if Index = Data'Last - 1 and then This.Do_Stop_Sequence then - -- Configure SHORTS to automatically stop the TWI port and produce - -- a STOP event on the bus when receiving a byte. - This.Periph.SHORTS.BB_SUSPEND := Disabled; - This.Periph.SHORTS.BB_STOP := Enabled; + -- Configure SHORTS to automatically stop the TWI port and produce + -- a STOP event on the bus when receiving a byte. + This.Periph.SHORTS.BB_SUSPEND := Disabled; + This.Periph.SHORTS.BB_STOP := Enabled; end if; This.Periph.TASKS_RESUME := 1; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-twi-master_transmit.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-twi-master_transmit.adb index e390e0750..788edd25c 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-twi-master_transmit.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-twi-master_transmit.adb @@ -1,4 +1,4 @@ -separate(nRF.TWI) +separate (nRF.TWI) overriding procedure Master_Transmit (This : in out TWI_Master; Addr : I2C_Address; @@ -32,20 +32,20 @@ begin loop - Evt_Err := This.Periph.EVENTS_ERROR; - if Evt_Err /= 0 then - Err_Src := This.Periph.ERRORSRC; - Status := Err_Error; - -- Clear the error - This.Periph.EVENTS_ERROR := 0; + Evt_Err := This.Periph.EVENTS_ERROR; + if Evt_Err /= 0 then + Err_Src := This.Periph.ERRORSRC; + Status := Err_Error; + -- Clear the error + This.Periph.EVENTS_ERROR := 0; - -- Stop sequence - This.Periph.TASKS_STOP := 1; + -- Stop sequence + This.Periph.TASKS_STOP := 1; - return; - end if; + return; + end if; - exit when This.Periph.EVENTS_TXDSENT /= 0; + exit when This.Periph.EVENTS_TXDSENT /= 0; end loop; -- Clear the event diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-uart-disable.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-uart-disable.adb index 324a4258c..82ae57a7c 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-uart-disable.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-uart-disable.adb @@ -1,4 +1,4 @@ -separate(nRF.UART) +separate (nRF.UART) procedure Disable (This : in out UART_Device) is begin This.Periph.ENABLE.ENABLE := Disabled; diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-uart-enable.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-uart-enable.adb index a03645ee1..a5d6bafb8 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-uart-enable.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-uart-enable.adb @@ -1,6 +1,6 @@ -separate(NRF.UART) +separate (nRF.UART) procedure Enable (This : in out UART_Device; - Tx, Rx : GPIO_Pin_Index) + Tx, Rx : GPIO_Pin_Index) is begin This.Periph.PSELTXD := UInt32 (Tx); diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-uart-receive.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-uart-receive.adb index a930aea5a..9be492511 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-uart-receive.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-uart-receive.adb @@ -1,4 +1,4 @@ -separate(nRF.UART) +separate (nRF.UART) overriding procedure Receive (This : in out UART_Device; @@ -16,7 +16,7 @@ begin for C of Data loop -- Wait for RX Ready event while UART0_Periph.EVENTS_RXDRDY = 0 loop - null; + null; end loop; -- Read a character diff --git a/arch/ARM/Nordic/drivers/nrf51/nrf-uart-transmit.adb b/arch/ARM/Nordic/drivers/nrf51/nrf-uart-transmit.adb index 020876aaa..6c2855315 100644 --- a/arch/ARM/Nordic/drivers/nrf51/nrf-uart-transmit.adb +++ b/arch/ARM/Nordic/drivers/nrf51/nrf-uart-transmit.adb @@ -1,4 +1,4 @@ -separate(nRF.UART) +separate (nRF.UART) overriding procedure Transmit (This : in out UART_Device; @@ -16,7 +16,7 @@ begin for C of Data loop -- Wait for TX Ready event while UART0_Periph.EVENTS_TXDRDY = 0 loop - null; + null; end loop; -- Clear the event diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-adc.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-adc.adb index 5dc301795..1da5767d8 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-adc.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-adc.adb @@ -62,9 +62,9 @@ package body nRF.ADC is begin case Ref is when Internal_0V6 => - SAADC_Periph.CH(0).CONFIG.REFSEL := Internal; + SAADC_Periph.CH (0).CONFIG.REFSEL := Internal; when VDD_One_Forth => - SAADC_Periph.CH(0).CONFIG.REFSEL := Vdd1_4; + SAADC_Periph.CH (0).CONFIG.REFSEL := Vdd1_4; end case; end Set_Reference; @@ -83,45 +83,45 @@ package body nRF.ADC is Set_Resolution (Res); Set_Reference (Ref); - SAADC_Periph.RESULT.PTR := UInt32(System.Storage_Elements.To_Integer(Result'Address)); + SAADC_Periph.RESULT.PTR := UInt32 (System.Storage_Elements.To_Integer (Result'Address)); SAADC_Periph.RESULT.MAXCNT.MAXCNT := 1; case Input is when Pin_Quadruple => - SAADC_Periph.CH(0).CONFIG.GAIN := Gain4; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain4; when Pin_Double => - SAADC_Periph.CH(0).CONFIG.GAIN := Gain2; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain2; when Pin_Full => - SAADC_Periph.CH(0).CONFIG.GAIN := Gain1; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain1; when Pin_Half => - SAADC_Periph.CH(0).CONFIG.GAIN := Gain1_2; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain1_2; when Pin_One_Third => - SAADC_Periph.CH(0).CONFIG.GAIN := Gain1_3; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain1_3; when Pin_One_Forth => - SAADC_Periph.CH(0).CONFIG.GAIN := Gain1_4; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain1_4; when Pin_One_Fifth => - SAADC_Periph.CH(0).CONFIG.GAIN := Gain1_5; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain1_5; when Pin_One_Sixth => - SAADC_Periph.CH(0).CONFIG.GAIN := Gain1_6; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain1_6; end case; case Pin is when 0 => - SAADC_Periph.CH(0).PSELP.PSELP := Analoginput0; + SAADC_Periph.CH (0).PSELP.PSELP := Analoginput0; when 1 => - SAADC_Periph.CH(0).PSELP.PSELP := Analoginput1; + SAADC_Periph.CH (0).PSELP.PSELP := Analoginput1; when 2 => - SAADC_Periph.CH(0).PSELP.PSELP := Analoginput2; + SAADC_Periph.CH (0).PSELP.PSELP := Analoginput2; when 3 => - SAADC_Periph.CH(0).PSELP.PSELP := Analoginput3; + SAADC_Periph.CH (0).PSELP.PSELP := Analoginput3; when 4 => - SAADC_Periph.CH(0).PSELP.PSELP := Analoginput4; + SAADC_Periph.CH (0).PSELP.PSELP := Analoginput4; when 5 => - SAADC_Periph.CH(0).PSELP.PSELP := Analoginput5; + SAADC_Periph.CH (0).PSELP.PSELP := Analoginput5; when 6 => - SAADC_Periph.CH(0).PSELP.PSELP := Analoginput6; + SAADC_Periph.CH (0).PSELP.PSELP := Analoginput6; when 7 => - SAADC_Periph.CH(0).PSELP.PSELP := Analoginput7; + SAADC_Periph.CH (0).PSELP.PSELP := Analoginput7; end case; SAADC_Periph.ENABLE.ENABLE := Enabled; @@ -139,20 +139,20 @@ package body nRF.ADC is Ref : Reference_Selection; Res : Bits_Resolution) return UInt16 is - Result: Uint16 with Volatile; + Result : UInt16 with Volatile; begin Set_Resolution (Res); Set_Reference (Ref); - SAADC_Periph.CH(0).PSELP.PSELP := Vdd; - SAADC_Periph.RESULT.PTR := UInt32(System.Storage_Elements.To_Integer(Result'Address)); + SAADC_Periph.CH (0).PSELP.PSELP := Vdd; + SAADC_Periph.RESULT.PTR := UInt32 (System.Storage_Elements.To_Integer (Result'Address)); SAADC_Periph.RESULT.MAXCNT.MAXCNT := 1; case Input is when VDD_One_Fifth => - SAADC_Periph.CH(0).CONFIG.Gain := Gain1_5; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain1_5; when VDD_One_Sixth => - SAADC_Periph.CH(0).CONFIG.Gain := Gain1_6; + SAADC_Periph.CH (0).CONFIG.GAIN := Gain1_6; end case; SAADC_Periph.ENABLE.ENABLE := Enabled; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-clock-set_high_freq_external_frequency.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-clock-set_high_freq_external_frequency.adb index 616d69fc6..86a4f97a6 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-clock-set_high_freq_external_frequency.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-clock-set_high_freq_external_frequency.adb @@ -1,4 +1,4 @@ -separate(nRF.Clock) +separate (nRF.Clock) procedure Set_High_Freq_External_Frequency (Freq : High_Freq_Ext_Freq) is begin null; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-interrupts.ads b/arch/ARM/Nordic/drivers/nrf52/nrf-interrupts.ads index b66d192c0..e994c57a6 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-interrupts.ads +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-interrupts.ads @@ -29,9 +29,10 @@ -- -- ------------------------------------------------------------------------------ -with HAL; use HAL; +with Cortex_M.NVIC; package nRF.Interrupts is + type Interrupt_Name is (POWER_CLOCK_Interrupt, RADIO_Interrupt, @@ -66,7 +67,7 @@ package nRF.Interrupts is Unused_Interrupt_6, Unused_Interrupt_7); - subtype Interrupt_Priority is UInt32; + subtype Interrupt_Priority is Cortex_M.NVIC.Interrupt_Priority; procedure Set_Priority (Int : Interrupt_Name; Prio : Interrupt_Priority); procedure Enable (Int : Interrupt_Name); diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-add_to_group.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-add_to_group.adb index 4b306f48d..b9384cf66 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-add_to_group.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-add_to_group.adb @@ -1,4 +1,4 @@ -separate(nRF.PPI) +separate (nRF.PPI) procedure Add_To_Group (Chan : Channel_ID; Group : Group_ID) diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-disable_channel.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-disable_channel.adb index 6ecd3574e..50e7c7a7d 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-disable_channel.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-disable_channel.adb @@ -1,4 +1,4 @@ -separate(nRF.PPI) +separate (nRF.PPI) procedure Disable_Channel (Chan : Channel_ID) is Arr : CHENCLR_CH_Field_Array := (others => Chenclr_Ch0_Field_Reset); begin diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-enable_channel.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-enable_channel.adb index 286d90ec1..477ce1efa 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-enable_channel.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-enable_channel.adb @@ -1,4 +1,4 @@ -separate(nRF.PPI) +separate (nRF.PPI) procedure Enable_Channel (Chan : Channel_ID) is Arr : CHENSET_CH_Field_Array := (others => Chenset_Ch0_Field_Reset); begin diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-remove_from_group.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-remove_from_group.adb index 019b409c1..d8c252d2f 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-remove_from_group.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-ppi-remove_from_group.adb @@ -1,4 +1,4 @@ -separate(nRF.PPI) +separate (nRF.PPI) procedure Remove_From_Group (Chan : Channel_ID; Group : Group_ID) diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-rng-read.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-rng-read.adb index bbd130e93..e4fd40974 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-rng-read.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-rng-read.adb @@ -1,4 +1,4 @@ -separate(nRF.RNG) +separate (nRF.RNG) function Read return UInt8 is begin -- Clear event @@ -7,7 +7,7 @@ begin -- Start random numnber generator RNG_Periph.TASKS_START.TASKS_START := True; - while RNG_Periph.EVENTS_VALRDY.EVENTS_VALRDY = FALSE loop + while RNG_Periph.EVENTS_VALRDY.EVENTS_VALRDY = False loop null; end loop; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-clear.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-clear.adb index 2aeab6b97..e0f0d7246 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-clear.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-clear.adb @@ -1,4 +1,4 @@ -separate(nRF.RTC) +separate (nRF.RTC) procedure Clear (This : Real_Time_Counter) is begin This.Periph.TASKS_CLEAR.TASKS_CLEAR := True; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-start.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-start.adb index d5b2e6e4b..04a92cefe 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-start.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-start.adb @@ -1,4 +1,4 @@ -separate(nRF.RTC) +separate (nRF.RTC) procedure Start (This : Real_Time_Counter) is begin This.Periph.TASKS_START.TASKS_START := True; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-stop.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-stop.adb index 627819726..06a22be95 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-stop.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-rtc-stop.adb @@ -1,4 +1,4 @@ -separate(nRF.RTC) +separate (nRF.RTC) procedure Stop (This : Real_Time_Counter) is begin This.Periph.TASKS_STOP.TASKS_STOP := True; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-temperature-read.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-temperature-read.adb index c883bdb42..ca4202d6d 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-temperature-read.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-temperature-read.adb @@ -1,4 +1,4 @@ -separate(nRF.Temperature) +separate (nRF.Temperature) function Read return Temp_Celsius is Raw : RAW_Temp; begin diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-timers-capture.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-timers-capture.adb index 57b1ffad2..c7695d6d3 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-timers-capture.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-timers-capture.adb @@ -1,6 +1,6 @@ -separate(nRF.Timers) +separate (nRF.Timers) procedure Capture (This : in out Timer; - Chan : Timer_Channel) + Chan : Timer_Channel) is begin This.Periph.TASKS_CAPTURE (Integer (Chan)).TASKS_CAPTURE := True; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-timers-clear.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-timers-clear.adb index 9779008b4..9bf8e4593 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-timers-clear.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-timers-clear.adb @@ -1,4 +1,4 @@ -separate(nRF.Timers) +separate (nRF.Timers) procedure Clear (This : in out Timer) is begin This.Periph.TASKS_CLEAR.TASKS_CLEAR := True; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-timers-start.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-timers-start.adb index 0f6bddcb4..b92f61af2 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-timers-start.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-timers-start.adb @@ -1,4 +1,4 @@ -separate(NRF.Timers) +separate (nRF.Timers) procedure Start (This : in out Timer) is begin This.Periph.TASKS_START.TASKS_START := True; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-timers-stop.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-timers-stop.adb index 88a865ae3..620cba231 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-timers-stop.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-timers-stop.adb @@ -1,4 +1,4 @@ -separate(nRF.Timers) +separate (nRF.Timers) procedure Stop (This : in out Timer) is begin This.Periph.TASKS_STOP.TASKS_STOP := True; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-twi-master_receive.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-twi-master_receive.adb index 30da72c63..9c27aadd7 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-twi-master_receive.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-twi-master_receive.adb @@ -38,17 +38,17 @@ begin loop - if This.Periph.EVENTS_ERROR.EVENTS_ERROR /= False then - Status := Err_Error; - -- Clear the error - This.Periph.EVENTS_ERROR.EVENTS_ERROR := False; + if This.Periph.EVENTS_ERROR.EVENTS_ERROR /= False then + Status := Err_Error; + -- Clear the error + This.Periph.EVENTS_ERROR.EVENTS_ERROR := False; - Stop_Sequence (This); + Stop_Sequence (This); - return; - end if; + return; + end if; - exit when This.Periph.EVENTS_RXDREADY.EVENTS_RXDREADY /= False; + exit when This.Periph.EVENTS_RXDREADY.EVENTS_RXDREADY /= False; end loop; -- Clear the event @@ -57,10 +57,10 @@ begin if Index = Data'Last - 1 and then This.Do_Stop_Sequence then - -- Configure SHORTS to automatically stop the TWI port and produce - -- a STOP event on the bus when receiving a byte. - This.Periph.SHORTS.BB_SUSPEND := Disabled; - This.Periph.SHORTS.BB_STOP := Enabled; + -- Configure SHORTS to automatically stop the TWI port and produce + -- a STOP event on the bus when receiving a byte. + This.Periph.SHORTS.BB_SUSPEND := Disabled; + This.Periph.SHORTS.BB_STOP := Enabled; end if; This.Periph.TASKS_RESUME.TASKS_RESUME := True; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-twi-master_transmit.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-twi-master_transmit.adb index 7aa9303b9..dd21f4bd1 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-twi-master_transmit.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-twi-master_transmit.adb @@ -1,4 +1,4 @@ -separate(nRF.TWI) +separate (nRF.TWI) overriding procedure Master_Transmit (This : in out TWI_Master; Addr : I2C_Address; @@ -32,20 +32,20 @@ begin loop - Evt_Err := This.Periph.EVENTS_ERROR.EVENTS_ERROR; - if Evt_Err /= False then - Err_Src := This.Periph.ERRORSRC; - Status := Err_Error; - -- Clear the error - This.Periph.EVENTS_ERROR.EVENTS_ERROR := False; + Evt_Err := This.Periph.EVENTS_ERROR.EVENTS_ERROR; + if Evt_Err /= False then + Err_Src := This.Periph.ERRORSRC; + Status := Err_Error; + -- Clear the error + This.Periph.EVENTS_ERROR.EVENTS_ERROR := False; - -- Stop sequence - This.Periph.TASKS_STOP.TASKS_STOP := True; + -- Stop sequence + This.Periph.TASKS_STOP.TASKS_STOP := True; - return; - end if; + return; + end if; - exit when This.Periph.EVENTS_TXDSENT.EVENTS_TXDSENT /= False; + exit when This.Periph.EVENTS_TXDSENT.EVENTS_TXDSENT /= False; end loop; -- Clear the event diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-uart-disable.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-uart-disable.adb index aaef99731..22025abb3 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-uart-disable.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-uart-disable.adb @@ -1,4 +1,4 @@ -separate(nRF.UART) +separate (nRF.UART) procedure Disable (This : in out UART_Device) is begin This.Periph.ENABLE.ENABLE := Disabled; diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-uart-enable.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-uart-enable.adb index 7f98eb972..8cd247cfd 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-uart-enable.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-uart-enable.adb @@ -1,6 +1,6 @@ -separate(NRF.UART) +separate (nRF.UART) procedure Enable (This : in out UART_Device; - Tx, Rx : GPIO_Pin_Index) + Tx, Rx : GPIO_Pin_Index) is begin This.Periph.PSELTXD := UInt32 (Tx); diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-uart-receive.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-uart-receive.adb index 5d70bbf92..1d0b5646f 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-uart-receive.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-uart-receive.adb @@ -1,4 +1,4 @@ -separate(nRF.UART) +separate (nRF.UART) overriding procedure Receive (This : in out UART_Device; @@ -16,7 +16,7 @@ begin for C of Data loop -- Wait for RX Ready event while UART0_Periph.EVENTS_RXDRDY.EVENTS_RXDRDY = False loop - null; + null; end loop; -- Read a character diff --git a/arch/ARM/Nordic/drivers/nrf52/nrf-uart-transmit.adb b/arch/ARM/Nordic/drivers/nrf52/nrf-uart-transmit.adb index e20ae1212..8defbdb22 100644 --- a/arch/ARM/Nordic/drivers/nrf52/nrf-uart-transmit.adb +++ b/arch/ARM/Nordic/drivers/nrf52/nrf-uart-transmit.adb @@ -1,4 +1,4 @@ -separate(nRF.UART) +separate (nRF.UART) overriding procedure Transmit (This : in out UART_Device; @@ -16,7 +16,7 @@ begin for C of Data loop -- Wait for TX Ready event while UART0_Periph.EVENTS_TXDRDY.EVENTS_TXDRDY = False loop - null; + null; end loop; -- Clear the event diff --git a/arch/ARM/Nordic/drivers/nrf_common/nrf-interrupts.adb b/arch/ARM/Nordic/drivers/nrf_common/nrf-interrupts.adb index d5dc36117..0b02f681b 100644 --- a/arch/ARM/Nordic/drivers/nrf_common/nrf-interrupts.adb +++ b/arch/ARM/Nordic/drivers/nrf_common/nrf-interrupts.adb @@ -29,7 +29,8 @@ -- -- ------------------------------------------------------------------------------ -with Cortex_M.NVIC; +with HAL; use HAL; + with System.Machine_Code; use System.Machine_Code; package body nRF.Interrupts is diff --git a/arch/ARM/Nordic/svd/nrf51/nrf_svd-swi.ads b/arch/ARM/Nordic/svd/nrf51/nrf_svd-swi.ads deleted file mode 100644 index 43c669c0c..000000000 --- a/arch/ARM/Nordic/svd/nrf51/nrf_svd-swi.ads +++ /dev/null @@ -1,65 +0,0 @@ --- Copyright (c) 2013, Nordic Semiconductor ASA --- All rights reserved. --- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are met: --- --- * Redistributions of source code must retain the above copyright notice, this --- list of conditions and the following disclaimer. --- --- * Redistributions in binary form must reproduce the above copyright notice, --- this list of conditions and the following disclaimer in the documentation --- and/or other materials provided with the distribution. --- --- * Neither the name of Nordic Semiconductor ASA nor the names of its --- contributors may be used to endorse or promote products derived from --- this software without specific prior written permission. --- --- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" --- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE --- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE --- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE --- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL --- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR --- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER --- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, --- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- - --- This spec has been automatically generated from nrf51.svd - -pragma Restrictions (No_Elaboration_Code); -pragma Ada_2012; -pragma Style_Checks (Off); - -with HAL; -with System; - -package NRF_SVD.SWI is - pragma Preelaborate; - - --------------- - -- Registers -- - --------------- - - ----------------- - -- Peripherals -- - ----------------- - - -- SW Interrupts. - type SWI_Peripheral is record - -- Unused. - UNUSED : aliased HAL.UInt32; - end record - with Volatile; - - for SWI_Peripheral use record - UNUSED at 0 range 0 .. 31; - end record; - - -- SW Interrupts. - SWI_Periph : aliased SWI_Peripheral - with Import, Address => SWI_Base; - -end NRF_SVD.SWI; diff --git a/arch/ARM/Nordic/svd/nrf52/nrf_svd-mwu.ads b/arch/ARM/Nordic/svd/nrf52/nrf_svd-mwu.ads index e2074e4ed..f815b9a4c 100644 --- a/arch/ARM/Nordic/svd/nrf52/nrf_svd-mwu.ads +++ b/arch/ARM/Nordic/svd/nrf52/nrf_svd-mwu.ads @@ -2718,7 +2718,7 @@ package NRF_SVD.MWU is -- Description cluster[0]: End address of region 0 END_k : aliased HAL.UInt32; end record - with Size => 128; + with Size => 64; for REGION_Cluster use record START at 16#0# range 0 .. 31; @@ -2777,7 +2777,7 @@ package NRF_SVD.MWU is -- Description cluster[0]: Subregions of region 0 SUBS : aliased SUBS_PREGION_Register; end record - with Size => 128; + with Size => 96; for PREGION_Cluster use record START at 16#0# range 0 .. 31; @@ -2838,8 +2838,8 @@ package NRF_SVD.MWU is REGIONEN at 16#510# range 0 .. 31; REGIONENSET at 16#514# range 0 .. 31; REGIONENCLR at 16#518# range 0 .. 31; - REGION at 16#600# range 0 .. 511; - PREGION at 16#6C0# range 0 .. 255; + REGION at 16#600# range 0 .. 255; + PREGION at 16#6C0# range 0 .. 191; end record; -- Memory Watch Unit diff --git a/arch/ARM/Nordic/svd/nrf52/nrf_svd-power.ads b/arch/ARM/Nordic/svd/nrf52/nrf_svd-power.ads index b7799b135..8663d732e 100644 --- a/arch/ARM/Nordic/svd/nrf52/nrf_svd-power.ads +++ b/arch/ARM/Nordic/svd/nrf52/nrf_svd-power.ads @@ -1008,7 +1008,7 @@ package NRF_SVD.POWER is -- Description cluster[0]: RAM0 power control clear register POWERCLR : aliased POWERCLR_RAM_Register; end record - with Size => 128; + with Size => 96; for RAM_Cluster use record POWER at 16#0# range 0 .. 31; @@ -1079,7 +1079,7 @@ package NRF_SVD.POWER is RAMON at 16#524# range 0 .. 31; RAMONB at 16#554# range 0 .. 31; DCDCEN at 16#578# range 0 .. 31; - RAM at 16#900# range 0 .. 1023; + RAM at 16#900# range 0 .. 767; end record; -- Power control diff --git a/arch/ARM/Nordic/svd/nrf52/nrf_svd-pwm.ads b/arch/ARM/Nordic/svd/nrf52/nrf_svd-pwm.ads index 248aac5f7..34d162203 100644 --- a/arch/ARM/Nordic/svd/nrf52/nrf_svd-pwm.ads +++ b/arch/ARM/Nordic/svd/nrf52/nrf_svd-pwm.ads @@ -1084,7 +1084,7 @@ package NRF_SVD.PWM is -- Description cluster[0]: Time added after the sequence ENDDELAY : aliased ENDDELAY_SEQ_Register; end record - with Size => 256; + with Size => 256 - 128; for PWM_SEQ_Cluster use record PTR at 16#0# range 0 .. 31; @@ -1238,7 +1238,7 @@ package NRF_SVD.PWM is PRESCALER at 16#50C# range 0 .. 31; DECODER at 16#510# range 0 .. 31; LOOP_k at 16#514# range 0 .. 31; - SEQ at 16#520# range 0 .. 511; + SEQ at 16#520# range 0 .. 255; PSEL at 16#560# range 0 .. 127; end record; diff --git a/arch/ARM/Nordic/svd/nrf52/nrf_svd-swi.ads b/arch/ARM/Nordic/svd/nrf52/nrf_svd-swi.ads deleted file mode 100644 index 9b1441fd1..000000000 --- a/arch/ARM/Nordic/svd/nrf52/nrf_svd-swi.ads +++ /dev/null @@ -1,94 +0,0 @@ --- Copyright (c) 2010 - 2018, Nordic Semiconductor ASA --- --- All rights reserved. --- --- Redistribution and use in source and binary forms, with or without --- modification, are permitted provided that the following conditions are met: --- --- 1. Redistributions of source code must retain the above copyright notice, --- this list of conditions and the following disclaimer. --- --- 2. Redistributions in binary form, except as embedded into a Nordic --- Semiconductor ASA integrated circuit in a product or a software update for --- such product, must reproduce the above copyright notice, this list of --- conditions and the following disclaimer in the documentation and/or other --- materials provided with the distribution. --- --- 3. Neither the name of Nordic Semiconductor ASA nor the names of its --- contributors may be used to endorse or promote products derived from this --- software without specific prior written permission. --- --- 4. This software, with or without modification, must only be used with a --- Nordic Semiconductor ASA integrated circuit. --- --- 5. Any software provided in binary form under this license must not be --- reverse engineered, decompiled, modified and/or disassembled. --- --- THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY --- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED --- WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A --- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR --- ASA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --- - --- This spec has been automatically generated from nrf52.svd - -pragma Restrictions (No_Elaboration_Code); -pragma Ada_2012; -pragma Style_Checks (Off); - -with HAL; - -package NRF_SVD.SWI is - pragma Preelaborate; - - --------------- - -- Registers -- - --------------- - - ----------------- - -- Peripherals -- - ----------------- - - -- Software interrupt 0 - type SWI_Peripheral is record - -- Unused. - UNUSED : aliased HAL.UInt32; - end record - with Volatile; - - for SWI_Peripheral use record - UNUSED at 0 range 0 .. 31; - end record; - - -- Software interrupt 0 - SWI0_Periph : aliased SWI_Peripheral - with Import, Address => SWI0_Base; - - -- Software interrupt 1 - SWI1_Periph : aliased SWI_Peripheral - with Import, Address => SWI1_Base; - - -- Software interrupt 2 - SWI2_Periph : aliased SWI_Peripheral - with Import, Address => SWI2_Base; - - -- Software interrupt 3 - SWI3_Periph : aliased SWI_Peripheral - with Import, Address => SWI3_Base; - - -- Software interrupt 4 - SWI4_Periph : aliased SWI_Peripheral - with Import, Address => SWI4_Base; - - -- Software interrupt 5 - SWI5_Periph : aliased SWI_Peripheral - with Import, Address => SWI5_Base; - -end NRF_SVD.SWI; diff --git a/arch/ARM/cortex_m/src/nvic_cm0/cortex_m-nvic.adb b/arch/ARM/cortex_m/src/nvic_cm0/cortex_m-nvic.adb index 2c7f8863d..442f97d64 100644 --- a/arch/ARM/cortex_m/src/nvic_cm0/cortex_m-nvic.adb +++ b/arch/ARM/cortex_m/src/nvic_cm0/cortex_m-nvic.adb @@ -61,14 +61,14 @@ package body Cortex_M.NVIC is end case; end record with Unchecked_Union, Pack, Size => 32; - IPR_Index : constant Natural := IRQn / 4; - IP_Index : constant Natural := IRQn mod 4; + IPR_Index : constant Natural := Natural (IRQn) / 4; + IP_Index : constant Natural := Natural (IRQn) mod 4; IPR : As_Array; begin IPR.IPR := NVIC_Periph.NVIC_IPR (IPR_Index); - IPR.Arr (IP_Index) := Priority; + IPR.Arr (IP_Index) := UInt8 (Priority); NVIC_Periph.NVIC_IPR (IPR_Index) := IPR.IPR; end Set_Priority; @@ -79,7 +79,7 @@ package body Cortex_M.NVIC is procedure Enable_Interrupt (IRQn : Interrupt_ID) is begin - NVIC_Periph.NVIC_ISER := Shift_Left (1, IRQn); + NVIC_Periph.NVIC_ISER := Shift_Left (1, Natural (IRQn)); end Enable_Interrupt; ------------- @@ -88,7 +88,7 @@ package body Cortex_M.NVIC is procedure Disable_Interrupt (IRQn : Interrupt_ID) is begin - NVIC_Periph.NVIC_ICER := Shift_Left (1, IRQn); + NVIC_Periph.NVIC_ICER := Shift_Left (1, Natural (IRQn)); end Disable_Interrupt; ------------- @@ -97,7 +97,7 @@ package body Cortex_M.NVIC is function Enabled (IRQn : Interrupt_ID) return Boolean is begin - return ((NVIC_Periph.NVIC_ISER and Shift_Left (1, IRQn)) /= 0); + return ((NVIC_Periph.NVIC_ISER and Shift_Left (1, Natural (IRQn))) /= 0); end Enabled; ------------- @@ -106,7 +106,7 @@ package body Cortex_M.NVIC is function Pending (IRQn : Interrupt_ID) return Boolean is begin - return ((NVIC_Periph.NVIC_ISPR and Shift_Left (1, IRQn)) /= 0); + return ((NVIC_Periph.NVIC_ISPR and Shift_Left (1, Natural (IRQn))) /= 0); end Pending; ----------------- @@ -115,7 +115,7 @@ package body Cortex_M.NVIC is procedure Set_Pending (IRQn : Interrupt_ID) is begin - NVIC_Periph.NVIC_ISPR := Shift_Left (1, IRQn); + NVIC_Periph.NVIC_ISPR := Shift_Left (1, Natural (IRQn)); end Set_Pending; ------------------- @@ -124,7 +124,7 @@ package body Cortex_M.NVIC is procedure Clear_Pending (IRQn : Interrupt_ID) is begin - NVIC_Periph.NVIC_ICPR := Shift_Left (1, IRQn); + NVIC_Periph.NVIC_ICPR := Shift_Left (1, Natural (IRQn)); end Clear_Pending; end Cortex_M.NVIC; diff --git a/arch/ARM/cortex_m/src/nvic_cm0/cortex_m-nvic.ads b/arch/ARM/cortex_m/src/nvic_cm0/cortex_m-nvic.ads index 79a649b80..28ffe9bb1 100644 --- a/arch/ARM/cortex_m/src/nvic_cm0/cortex_m-nvic.ads +++ b/arch/ARM/cortex_m/src/nvic_cm0/cortex_m-nvic.ads @@ -46,8 +46,8 @@ with HAL; use HAL; package Cortex_M.NVIC is -- the Nested Vectored Interrupt Controller - subtype Interrupt_ID is Natural range 0 .. 31; - subtype Interrupt_Priority is UInt8; + type Interrupt_ID is new Natural range 0 .. 31; + type Interrupt_Priority is new UInt8; procedure Set_Priority (IRQn : Interrupt_ID; diff --git a/arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.adb b/arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.adb index 5ac8a5366..e63f06e59 100644 --- a/arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.adb +++ b/arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.adb @@ -47,19 +47,20 @@ package body Cortex_M.NVIC is -- Priority_Grouping -- ----------------------- - function Priority_Grouping return UInt32 is + function Priority_Grouping return Interrupt_Priority is begin - return Shift_Right (SCB.AIRCR and SCB_AIRCR_PRIGROUP_Mask, - SCB_AIRCR_PRIGROUP_Pos); + return Interrupt_Priority + (Shift_Right (SCB.AIRCR and SCB_AIRCR_PRIGROUP_Mask, + SCB_AIRCR_PRIGROUP_Pos)); end Priority_Grouping; --------------------------- -- Set_Priority_Grouping -- --------------------------- - procedure Set_Priority_Grouping (Priority_Group : UInt32) is + procedure Set_Priority_Grouping (Priority_Group : Interrupt_Priority) is Reg_Value : UInt32; - PriorityGroupTmp : constant UInt32 := Priority_Group and 16#07#; + PriorityGroupTmp : constant UInt32 := UInt32 (Priority_Group) and 16#07#; Key : constant := 16#5FA#; begin Reg_Value := SCB.AIRCR; @@ -77,11 +78,11 @@ package body Cortex_M.NVIC is procedure Set_Priority (IRQn : Interrupt_ID; - Priority : UInt32) + Priority : Interrupt_Priority) is Index : constant Natural := Integer (IRQn); Value : constant UInt32 := - Shift_Left (Priority, 8 - NVIC_PRIO_BITS) and 16#FF#; + Shift_Left (UInt32 (Priority), 8 - NVIC_PRIO_BITS) and 16#FF#; begin -- IRQ numbers are never less than 0 in the current definition, hence -- the code is different from that in the CMSIS. @@ -93,17 +94,19 @@ package body Cortex_M.NVIC is ---------------------- function Encoded_Priority - (Priority_Group : UInt32; Preempt_Priority : UInt32; Subpriority : UInt32) - return UInt32 + (Priority_Group : Interrupt_Priority; + Preempt_Priority : Interrupt_Priority; + Subpriority : Interrupt_Priority) + return Interrupt_Priority is - PriorityGroupTmp : constant UInt32 := Priority_Group and 16#07#; - PreemptPriorityBits : UInt32; - SubPriorityBits : UInt32; - Temp1 : UInt32; - Temp2 : UInt32; - Temp3 : UInt32; - Temp4 : UInt32; - Temp5 : UInt32; + PriorityGroupTmp : constant Interrupt_Priority := Priority_Group and 16#07#; + PreemptPriorityBits : Interrupt_Priority; + SubPriorityBits : Interrupt_Priority; + Temp1 : Interrupt_Priority; + Temp2 : Interrupt_Priority; + Temp3 : Interrupt_Priority; + Temp4 : Interrupt_Priority; + Temp5 : Interrupt_Priority; begin if (7 - PriorityGroupTmp) > NVIC_PRIO_BITS then PreemptPriorityBits := NVIC_PRIO_BITS; @@ -133,10 +136,10 @@ package body Cortex_M.NVIC is procedure Set_Priority (IRQn : Interrupt_ID; - Preempt_Priority : UInt32; - Subpriority : UInt32) + Preempt_Priority : Interrupt_Priority; + Subpriority : Interrupt_Priority) is - Priority_Group : constant UInt32 := Priority_Grouping; + Priority_Group : constant Interrupt_Priority := Priority_Grouping; begin Set_Priority (IRQn, diff --git a/arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.ads b/arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.ads index 85aad9dd4..a12e3c171 100644 --- a/arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.ads +++ b/arch/ARM/cortex_m/src/nvic_cm4_cm7/cortex_m-nvic.ads @@ -47,8 +47,8 @@ with HAL; use HAL; package Cortex_M.NVIC is -- the Nested Vectored Interrupt Controller - subtype Interrupt_ID is Natural range 0 .. 240; - subtype Interrupt_Priority is UInt32; + type Interrupt_ID is new Natural range 0 .. 240; + type Interrupt_Priority is new UInt32; -- 0 bits for pre-emption priority; 4 bits for subpriority Priority_Group_0 : constant UInt32 := 16#00000007#; @@ -66,22 +66,27 @@ package Cortex_M.NVIC is -- the Nested Vectored Interrupt Controller Priority_Group_4 : constant UInt32 := 16#00000003#; - procedure Set_Priority_Grouping (Priority_Group : UInt32) with Inline; + procedure Set_Priority_Grouping (Priority_Group : Interrupt_Priority) + with Inline; - function Priority_Grouping return UInt32 with Inline; + function Priority_Grouping return Interrupt_Priority + with Inline; procedure Set_Priority (IRQn : Interrupt_ID; - Priority : UInt32) with Inline; + Priority : Interrupt_Priority) with Inline; function Encoded_Priority - (Priority_Group : UInt32; Preempt_Priority : UInt32; Subpriority : UInt32) - return UInt32 with Inline; + (Priority_Group : Interrupt_Priority; + Preempt_Priority : Interrupt_Priority; + Subpriority : Interrupt_Priority) + return Interrupt_Priority + with Inline; procedure Set_Priority (IRQn : Interrupt_ID; - Preempt_Priority : UInt32; - Subpriority : UInt32) with Inline; + Preempt_Priority : Interrupt_Priority; + Subpriority : Interrupt_Priority) with Inline; -- A convenience routine that first encodes (Priority_Grouping(), -- Preempt_Priority, and Subpriority), and then calls the other -- Set_Priority with the resulting encoding for the Priority argument. diff --git a/boards/NRF52_DK/src/nrf52_dk-buttons.adb b/boards/NRF52_DK/src/nrf52_dk-buttons.adb index 07b5d34aa..085296f00 100755 --- a/boards/NRF52_DK/src/nrf52_dk-buttons.adb +++ b/boards/NRF52_DK/src/nrf52_dk-buttons.adb @@ -30,7 +30,7 @@ ------------------------------------------------------------------------------ with nRF.Device; use nRF.Device; -with NRF.GPIO; use nRF.GPIO; +with nRF.GPIO; use nRF.GPIO; with NRF52_DK.Time; use NRF52_DK.Time; package body NRF52_DK.Buttons is diff --git a/boards/NRF52_DK/src/nrf52_dk-leds.adb b/boards/NRF52_DK/src/nrf52_dk-leds.adb index 9bb668100..1060aa2c0 100644 --- a/boards/NRF52_DK/src/nrf52_dk-leds.adb +++ b/boards/NRF52_DK/src/nrf52_dk-leds.adb @@ -1,6 +1,6 @@ package body NRF52_DK.LEDs is - - LEDs : array(1 .. 4) of GPIO_Point := (LED1, LED2, LED3, LED4); + + LEDs : array (1 .. 4) of GPIO_Point := (LED1, LED2, LED3, LED4); procedure Initialize_LEDs is Conf : GPIO_Configuration; @@ -8,17 +8,17 @@ package body NRF52_DK.LEDs is Conf.Mode := Mode_Out; Conf.Resistors := No_Pull; for LED of LEDs loop - LED.Configure_IO(Conf); + LED.Configure_IO (Conf); LED.Set; end loop; end Initialize_LEDs; - - procedure Turn_On( This : in out User_LED) is + + procedure Turn_On (This : in out User_LED) is begin This.Clear; end Turn_On; - - procedure Turn_Off( This : in out User_LED) is + + procedure Turn_Off (This : in out User_LED) is begin This.Set; end Turn_Off; diff --git a/boards/NRF52_DK/src/nrf52_dk-leds.ads b/boards/NRF52_DK/src/nrf52_dk-leds.ads index e4cedecf3..23dc076ba 100644 --- a/boards/NRF52_DK/src/nrf52_dk-leds.ads +++ b/boards/NRF52_DK/src/nrf52_dk-leds.ads @@ -1,6 +1,6 @@ -with nRF.Device; use NRF.Device; -with nRF.GPIO; use NRF.GPIO; - +with nRF.Device; use nRF.Device; +with nRF.GPIO; use nRF.GPIO; + package NRF52_DK.LEDs is subtype User_LED is GPIO_Point; @@ -8,10 +8,10 @@ package NRF52_DK.LEDs is LED2 : User_LED renames P18; LED3 : User_LED renames P19; LED4 : User_LED renames P20; - + procedure Initialize_LEDs; - - procedure Turn_On( This : in out User_LED); - procedure Turn_Off( This : in out User_LED); -end NRF52_DK.LEDS; + procedure Turn_On (This : in out User_LED); + procedure Turn_Off (This : in out User_LED); + +end NRF52_DK.LEDs; diff --git a/boards/NRF52_DK/src/nrf52_dk.ads b/boards/NRF52_DK/src/nrf52_dk.ads index 5ad6c969e..3d018fedb 100644 --- a/boards/NRF52_DK/src/nrf52_dk.ads +++ b/boards/NRF52_DK/src/nrf52_dk.ads @@ -34,8 +34,8 @@ with nRF.GPIO; package NRF52_DK is - -- DK Headers are "Arduino compatible" these names reflect the - -- Arduino locations of these peripherals + -- DK Headers are "Arduino compatible" these names reflect the + -- Arduino locations of these peripherals DK_SCK : nRF.GPIO.GPIO_Point renames nRF.Device.P25; DK_MISO : nRF.GPIO.GPIO_Point renames nRF.Device.P24; diff --git a/examples/MicroBit/BLE_beacon/src/beacon.adb b/examples/MicroBit/BLE_beacon/src/beacon.adb index add1eddf5..ed51270e6 100644 --- a/examples/MicroBit/BLE_beacon/src/beacon.adb +++ b/examples/MicroBit/BLE_beacon/src/beacon.adb @@ -29,10 +29,10 @@ -- -- ------------------------------------------------------------------------------ -with nRF51.Tasks; -with nRF51.Events; -with nRF51.Radio; use nRF51.Radio; -with nRF51.Clock; use nRF51.Clock; +with nRF.Tasks; +with nRF.Events; +with nRF.Radio; use nRF.Radio; +with nRF.Clock; use nRF.Clock; with Bluetooth_Low_Energy.Packets; use Bluetooth_Low_Energy.Packets; with Bluetooth_Low_Energy; use Bluetooth_Low_Energy; @@ -116,16 +116,16 @@ package body Beacon is Set_Packet (Memory_Address (Beacon_Packet)); -- Clear all events - nRF51.Events.Clear (nRF51.Events.Radio_DISABLED); - nRF51.Events.Clear (nRF51.Events.Radio_ADDRESS); - nRF51.Events.Clear (nRF51.Events.Radio_PAYLOAD); - nRF51.Events.Clear (nRF51.Events.Radio_END); + nRF.Events.Clear (nRF.Events.Radio_DISABLED); + nRF.Events.Clear (nRF.Events.Radio_ADDRESS); + nRF.Events.Clear (nRF.Events.Radio_PAYLOAD); + nRF.Events.Clear (nRF.Events.Radio_END); -- Start transmission - nRF51.Tasks.Trigger (nRF51.Tasks.Radio_TXEN); + nRF.Tasks.Trigger (nRF.Tasks.Radio_TXEN); -- Wait for end of transmission - while not nRF51.Events.Triggered (nRF51.Events.Radio_DISABLED) loop + while not nRF.Events.Triggered (nRF.Events.Radio_DISABLED) loop null; end loop; end Send_Beacon_Packet; diff --git a/examples/NRF52_DK/BLE_beacon/src/beacon.adb b/examples/NRF52_DK/BLE_beacon/src/beacon.adb index 0561b2ec8..ed51270e6 100644 --- a/examples/NRF52_DK/BLE_beacon/src/beacon.adb +++ b/examples/NRF52_DK/BLE_beacon/src/beacon.adb @@ -29,10 +29,10 @@ -- -- ------------------------------------------------------------------------------ -with NRF52.Tasks; -with NRF52.Events; -with NRF52.Radio; use NRF52.Radio; -with NRF52.Clock; use NRF52.Clock; +with nRF.Tasks; +with nRF.Events; +with nRF.Radio; use nRF.Radio; +with nRF.Clock; use nRF.Clock; with Bluetooth_Low_Energy.Packets; use Bluetooth_Low_Energy.Packets; with Bluetooth_Low_Energy; use Bluetooth_Low_Energy; @@ -116,16 +116,16 @@ package body Beacon is Set_Packet (Memory_Address (Beacon_Packet)); -- Clear all events - NRF52.Events.Clear (NRF52.Events.Radio_DISABLED); - NRF52.Events.Clear (NRF52.Events.Radio_ADDRESS); - NRF52.Events.Clear (NRF52.Events.Radio_PAYLOAD); - NRF52.Events.Clear (NRF52.Events.Radio_END); + nRF.Events.Clear (nRF.Events.Radio_DISABLED); + nRF.Events.Clear (nRF.Events.Radio_ADDRESS); + nRF.Events.Clear (nRF.Events.Radio_PAYLOAD); + nRF.Events.Clear (nRF.Events.Radio_END); -- Start transmission - NRF52.Tasks.Trigger (NRF52.Tasks.Radio_TXEN); + nRF.Tasks.Trigger (nRF.Tasks.Radio_TXEN); -- Wait for end of transmission - while not NRF52.Events.Triggered (NRF52.Events.Radio_DISABLED) loop + while not nRF.Events.Triggered (nRF.Events.Radio_DISABLED) loop null; end loop; end Send_Beacon_Packet; diff --git a/examples/NRF52_DK/BLE_beacon/src/main.adb b/examples/NRF52_DK/BLE_beacon/src/main.adb index bc08f3526..5ff5dd1fe 100644 --- a/examples/NRF52_DK/BLE_beacon/src/main.adb +++ b/examples/NRF52_DK/BLE_beacon/src/main.adb @@ -39,9 +39,9 @@ begin Beacon.Initialize_Radio; loop - Turn_On(LED1); + Turn_On (LED1); Beacon.Send_Beacon_Packet; - Turn_Off(LED1); + Turn_Off (LED1); NRF52_DK.Time.Delay_Ms (500); end loop; end Main; diff --git a/scripts/build_all_examples.py b/scripts/build_all_examples.py index 6a10e52ef..58d7b3fe5 100755 --- a/scripts/build_all_examples.py +++ b/scripts/build_all_examples.py @@ -139,6 +139,12 @@ def gprbuild(project_file, debug=False): "/examples/MicroBit/follower/follower.gpr", "/examples/MicroBit/accelerometer/accelerometer.gpr", + # NRF52_SDK + "/boards/NRF52_DK/nrf52_dk_zfp.gpr", + "/examples/NRF52_DK/buttons/buttons.gpr", + "/examples/NRF52_DK/BLE_beacon/BLE_beacon.gpr", + "/examples/NRF52_DK/digital_out/digital_out.gpr", + # STM32 driver examples STM_DRIVERS + "/demo_adc_dma/demo_adc_dma.gpr", STM_DRIVERS + "/demo_adc_interrupts/demo_adc_interrupts.gpr",