Skip to content

Commit 78a762d

Browse files
committed
nRF52832 and nRF52 DK Support
1 parent 30ac4d2 commit 78a762d

File tree

171 files changed

+61884
-573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+61884
-573
lines changed

arch/ARM/Nordic/devices/nrf51-device.ads renamed to arch/ARM/Nordic/devices/nrf51/nrf-device.ads

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@
2929
-- --
3030
------------------------------------------------------------------------------
3131

32-
with nRF51.GPIO; use nRF51.GPIO;
33-
with nRF51.RTC; use nRF51.RTC;
34-
with NRF51_SVD.RTC;
35-
with nRF51.TWI; use nRF51.TWI;
36-
with NRF51_SVD.TWI;
37-
with nRF51.SPI_Master; use nRF51.SPI_Master;
38-
with NRF51_SVD.SPI;
39-
with nRF51.Timers; use nRF51.Timers;
40-
with NRF51_SVD.TIMER;
41-
with nRF51.UART; use nRF51.UART;
42-
with NRF51_SVD.UART;
32+
with nRF.GPIO; use nRF.GPIO;
33+
with nRF.RTC; use nRF.RTC;
34+
with NRF_SVD.RTC;
35+
with nRF.TWI; use nRF.TWI;
36+
with NRF_SVD.TWI;
37+
with nRF.SPI_Master; use nRF.SPI_Master;
38+
with NRF_SVD.SPI;
39+
with nRF.Timers; use nRF.Timers;
40+
with NRF_SVD.TIMER;
41+
with nRF.UART; use nRF.UART;
42+
with NRF_SVD.UART;
4343

44-
package nRF51.Device is
44+
package nRF.Device is
4545

4646
P00 : aliased GPIO_Point := (Pin => 00);
4747
P01 : aliased GPIO_Point := (Pin => 01);
@@ -76,27 +76,27 @@ package nRF51.Device is
7676
P30 : aliased GPIO_Point := (Pin => 30);
7777
P31 : aliased GPIO_Point := (Pin => 31);
7878

79-
RTC_0 : aliased Real_Time_Counter (NRF51_SVD.RTC.RTC0_Periph'Access);
80-
RTC_1 : aliased Real_Time_Counter (NRF51_SVD.RTC.RTC1_Periph'Access);
79+
RTC_0 : aliased Real_Time_Counter (NRF_SVD.RTC.RTC0_Periph'Access);
80+
RTC_1 : aliased Real_Time_Counter (NRF_SVD.RTC.RTC1_Periph'Access);
8181

8282

8383
-- Be carefull of shared resources between the TWI and SPI controllers.
8484
-- TWI_O and SPI_Master_0 cannot be used at the same time.
8585
-- TWI_1 and SPI_Master_1 cannot be used at the same time.
8686
--
87-
-- See nRF51 Series Reference Manual, chapter Memory.Instantiation.
87+
-- See nRF Series Reference Manual, chapter Memory.Instantiation.
8888

89-
TWI_0 : aliased TWI_Master (NRF51_SVD.TWI.TWI0_Periph'Access);
90-
TWI_1 : aliased TWI_Master (NRF51_SVD.TWI.TWI1_Periph'Access);
89+
TWI_0 : aliased TWI_Master (NRF_SVD.TWI.TWI0_Periph'Access);
90+
TWI_1 : aliased TWI_Master (NRF_SVD.TWI.TWI1_Periph'Access);
9191

92-
SPI_Master_0 : aliased nRF51.SPI_Master.SPI_Master (NRF51_SVD.SPI.SPI0_Periph'Access);
93-
SPI_Master_1 : aliased nRF51.SPI_Master.SPI_Master (NRF51_SVD.SPI.SPI1_Periph'Access);
92+
SPI_Master_0 : aliased nRF.SPI_Master.SPI_Master (NRF_SVD.SPI.SPI0_Periph'Access);
93+
SPI_Master_1 : aliased nRF.SPI_Master.SPI_Master (NRF_SVD.SPI.SPI1_Periph'Access);
9494

9595

96-
Timer_0 : aliased Timer (NRF51_SVD.TIMER.TIMER0_Periph'Access);
97-
Timer_1 : aliased Timer (NRF51_SVD.TIMER.TIMER1_Periph'Access);
98-
Timer_2 : aliased Timer (NRF51_SVD.TIMER.TIMER2_Periph'Access);
96+
Timer_0 : aliased Timer (NRF_SVD.TIMER.TIMER0_Periph'Access);
97+
Timer_1 : aliased Timer (NRF_SVD.TIMER.TIMER1_Periph'Access);
98+
Timer_2 : aliased Timer (NRF_SVD.TIMER.TIMER2_Periph'Access);
9999

100100

101-
UART_0 : aliased UART_Device (NRF51_SVD.UART.UART0_Periph'Access);
102-
end nRF51.Device;
101+
UART_0 : aliased UART_Device (NRF_SVD.UART.UART0_Periph'Access);
102+
end nRF.Device;
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
------------------------------------------------------------------------------
2+
-- --
3+
-- Copyright (C) 2016, AdaCore --
4+
-- --
5+
-- Redistribution and use in source and binary forms, with or without --
6+
-- modification, are permitted provided that the following conditions are --
7+
-- met: --
8+
-- 1. Redistributions of source code must retain the above copyright --
9+
-- notice, this list of conditions and the following disclaimer. --
10+
-- 2. Redistributions in binary form must reproduce the above copyright --
11+
-- notice, this list of conditions and the following disclaimer in --
12+
-- the documentation and/or other materials provided with the --
13+
-- distribution. --
14+
-- 3. Neither the name of the copyright holder nor the names of its --
15+
-- contributors may be used to endorse or promote products derived --
16+
-- from this software without specific prior written permission. --
17+
-- --
18+
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
19+
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
20+
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
21+
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
22+
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
23+
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
24+
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
25+
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
26+
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
27+
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
28+
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
29+
-- --
30+
------------------------------------------------------------------------------
31+
32+
with nRF.GPIO; use nRF.GPIO;
33+
with nRF.RTC; use nRF.RTC;
34+
with NRF_SVD.RTC;
35+
with nRF.TWI; use nRF.TWI;
36+
with NRF_SVD.TWI;
37+
with nRF.SPI_Master; use nRF.SPI_Master;
38+
with NRF_SVD.SPI;
39+
with nRF.Timers; use nRF.Timers;
40+
with NRF_SVD.TIMER;
41+
with nRF.UART; use nRF.UART;
42+
with NRF_SVD.UART;
43+
44+
package nRF.Device is
45+
46+
P00 : aliased GPIO_Point := (Pin => 00);
47+
P01 : aliased GPIO_Point := (Pin => 01);
48+
P02 : aliased GPIO_Point := (Pin => 02);
49+
P03 : aliased GPIO_Point := (Pin => 03);
50+
P04 : aliased GPIO_Point := (Pin => 04);
51+
P05 : aliased GPIO_Point := (Pin => 05);
52+
P06 : aliased GPIO_Point := (Pin => 06);
53+
P07 : aliased GPIO_Point := (Pin => 07);
54+
P08 : aliased GPIO_Point := (Pin => 08);
55+
P09 : aliased GPIO_Point := (Pin => 09);
56+
P10 : aliased GPIO_Point := (Pin => 10);
57+
P11 : aliased GPIO_Point := (Pin => 11);
58+
P12 : aliased GPIO_Point := (Pin => 12);
59+
P13 : aliased GPIO_Point := (Pin => 13);
60+
P14 : aliased GPIO_Point := (Pin => 14);
61+
P15 : aliased GPIO_Point := (Pin => 15);
62+
P16 : aliased GPIO_Point := (Pin => 16);
63+
P17 : aliased GPIO_Point := (Pin => 17);
64+
P18 : aliased GPIO_Point := (Pin => 18);
65+
P19 : aliased GPIO_Point := (Pin => 19);
66+
P20 : aliased GPIO_Point := (Pin => 20);
67+
P21 : aliased GPIO_Point := (Pin => 21);
68+
P22 : aliased GPIO_Point := (Pin => 22);
69+
P23 : aliased GPIO_Point := (Pin => 23);
70+
P24 : aliased GPIO_Point := (Pin => 24);
71+
P25 : aliased GPIO_Point := (Pin => 25);
72+
P26 : aliased GPIO_Point := (Pin => 26);
73+
P27 : aliased GPIO_Point := (Pin => 27);
74+
P28 : aliased GPIO_Point := (Pin => 28);
75+
P29 : aliased GPIO_Point := (Pin => 29);
76+
P30 : aliased GPIO_Point := (Pin => 30);
77+
P31 : aliased GPIO_Point := (Pin => 31);
78+
79+
RTC_0 : aliased Real_Time_Counter (NRF_SVD.RTC.RTC0_Periph'Access);
80+
RTC_1 : aliased Real_Time_Counter (NRF_SVD.RTC.RTC1_Periph'Access);
81+
82+
83+
-- Be carefull of shared resources between the TWI and SPI controllers.
84+
-- TWI_O and SPI_Master_0 cannot be used at the same time.
85+
-- TWI_1 and SPI_Master_1 cannot be used at the same time.
86+
--
87+
-- See nRF Series Reference Manual, chapter Memory.Instantiation.
88+
89+
TWI_0 : aliased TWI_Master (NRF_SVD.TWI.TWI0_Periph'Access);
90+
TWI_1 : aliased TWI_Master (NRF_SVD.TWI.TWI1_Periph'Access);
91+
92+
SPI_Master_0 : aliased nRF.SPI_Master.SPI_Master (NRF_SVD.SPI.SPI0_Periph'Access);
93+
SPI_Master_1 : aliased nRF.SPI_Master.SPI_Master (NRF_SVD.SPI.SPI1_Periph'Access);
94+
95+
96+
Timer_0 : aliased Timer (NRF_SVD.TIMER.TIMER0_Periph'Access);
97+
Timer_1 : aliased Timer (NRF_SVD.TIMER.TIMER1_Periph'Access);
98+
Timer_2 : aliased Timer (NRF_SVD.TIMER.TIMER2_Periph'Access);
99+
Timer_3 : aliased Timer (NRF_SVD.TIMER.TIMER3_Periph'Access);
100+
Timer_4 : aliased Timer (NRF_SVD.TIMER.TIMER4_Periph'Access);
101+
102+
103+
UART_0 : aliased UART_Device (NRF_SVD.UART.UART0_Periph'Access);
104+
end nRF.Device;

arch/ARM/Nordic/drivers/nrf51-adc.adb renamed to arch/ARM/Nordic/drivers/nrf51/nrf-adc.adb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
-- --
3030
------------------------------------------------------------------------------
3131

32-
with NRF51_SVD.ADC; use NRF51_SVD.ADC;
33-
with nRF51.Tasks; use nRF51.Tasks;
32+
with NRF_SVD.ADC; use NRF_SVD.ADC;
33+
with nRF.Tasks; use nRF.Tasks;
3434

35-
package body nRF51.ADC is
35+
package body nRF.ADC is
3636

3737
procedure Set_Resolution (Res : Bits_Resolution);
3838
procedure Set_Reference (Ref : Reference_Selection);
@@ -166,4 +166,4 @@ package body nRF51.ADC is
166166
return ADC_Periph.RESULT.RESULT;
167167
end Wait_For_Result;
168168

169-
end nRF51.ADC;
169+
end nRF.ADC;

arch/ARM/Nordic/drivers/nrf51-adc.ads renamed to arch/ARM/Nordic/drivers/nrf51/nrf-adc.ads

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
with HAL; use HAL;
3333

34-
package nRF51.ADC is
34+
package nRF.ADC is
3535

3636
type Bits_Resolution is range 8 .. 10;
3737

@@ -58,4 +58,4 @@ package nRF51.ADC is
5858

5959
function Wait_For_Result return UInt10;
6060

61-
end nRF51.ADC;
61+
end nRF.ADC;

arch/ARM/Nordic/drivers/nrf51-clock.adb renamed to arch/ARM/Nordic/drivers/nrf51/nrf-clock.adb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
-- --
3030
------------------------------------------------------------------------------
3131

32-
with NRF51_SVD.CLOCK; use NRF51_SVD.CLOCK;
33-
with nRF51.Tasks; use nRF51.Tasks;
32+
with NRF_SVD.CLOCK; use NRF_SVD.CLOCK;
33+
with nRF.Tasks; use nRF.Tasks;
3434

35-
package body nRF51.Clock is
35+
package body nRF.Clock is
3636

3737
--------------------------------------
3838
-- Set_High_Freq_External_Frequency --
@@ -147,4 +147,4 @@ package body nRF51.Clock is
147147
Tasks.Trigger (Tasks.Clock_LFCLKSTOP);
148148
end Stop_Low_Freq;
149149

150-
end nRF51.Clock;
150+
end nRF.Clock;

arch/ARM/Nordic/drivers/nrf51-clock.ads renamed to arch/ARM/Nordic/drivers/nrf51/nrf-clock.ads

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
-- --
3030
------------------------------------------------------------------------------
3131

32-
package nRF51.Clock is
32+
package nRF.Clock is
3333

3434
--------------------------
3535
-- High frequency clock --
@@ -66,4 +66,4 @@ package nRF51.Clock is
6666

6767
procedure Stop_Low_Freq;
6868

69-
end nRF51.Clock;
69+
end nRF.Clock;

arch/ARM/Nordic/drivers/nrf51-events.adb renamed to arch/ARM/Nordic/drivers/nrf51/nrf-events.adb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
with Ada.Unchecked_Conversion;
3333

34-
package body nRF51.Events is
34+
package body nRF.Events is
3535

3636
function To_UInt32 is new Ada.Unchecked_Conversion (System.Address, UInt32);
3737
function To_Address is new Ada.Unchecked_Conversion (UInt32, System.Address);
@@ -58,11 +58,11 @@ package body nRF51.Events is
5858

5959
Event_Index : constant UInt7 := UInt7 (Reg_Addr and 16#0000_007F#) / 4;
6060
-- The bit corresponding to an event is determined by the offset of the
61-
-- event. (nRF51 Series Reference Manual, section 9.1.6)
61+
-- event. (nRF Series Reference Manual, section 9.1.6)
6262

6363
Set_Register_Addr : constant UInt32 := Device_Base + 16#0000_0304#;
6464
-- For each device the "Interrupt enable set register" is always located
65-
-- at the same offset: 0x304. (nRF51 Series Reference Manual,
65+
-- at the same offset: 0x304. (nRF Series Reference Manual,
6666
-- section 9.1.6)
6767

6868
Set_Register : UInt32 with Address => To_Address (Set_Register_Addr);
@@ -81,11 +81,11 @@ package body nRF51.Events is
8181

8282
Event_Index : constant UInt7 := UInt7 (Reg_Addr and 16#0000_007F#) / 4;
8383
-- The bit corresponding to an event is determined by the offset of the
84-
-- event. (nRF51 Series Reference Manual, section 9.1.6)
84+
-- event. (nRF Series Reference Manual, section 9.1.6)
8585

8686
Clear_Register_Addr : constant UInt32 := Device_Base + 16#0000_0308#;
8787
-- For each device the "Interrupt enable clear register" is always
88-
-- located at the same offset: 0x308. (nRF51 Series Reference Manual,
88+
-- located at the same offset: 0x308. (nRF Series Reference Manual,
8989
-- section 9.1.6)
9090

9191
Clear_Register : UInt32 with Address => To_Address (Clear_Register_Addr);
@@ -122,4 +122,4 @@ package body nRF51.Events is
122122
end Get_Address;
123123

124124

125-
end nRF51.Events;
125+
end nRF.Events;

0 commit comments

Comments
 (0)