Skip to content

Commit 88f442e

Browse files
committed
For microbit, only include needed SVD-generated files.
* microbit/Makefile: 'all:' target doesn't need nrf51/. * microbit/README: removed, replaced by README.md. * microbit/README.md: edited from README. * microbit/adainclude/nrf51-clock.ads: regenerated, moved from nrf51/. * microbit/adainclude/nrf51-rtc.ads: likewise. * microbit/adainclude/nrf51.ads: likewise. * microbit/nrf51/: removed.
1 parent 9a331d4 commit 88f442e

32 files changed

+98
-12770
lines changed

microbit/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
SVD2ADA ?= ~/adacore/svd2ada
2020

21-
all: nrf51
21+
all:
2222
gprbuild -p -P build_runtime.gpr
2323

2424
nrf51:

microbit/README

Lines changed: 0 additions & 34 deletions
This file was deleted.

microbit/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
This is an Ada Runtime System (RTS) for the GCC Ada compiler (GNAT), targeted to the [BBC micro:bit board](http://microbit.org/).
2+
3+
The RTS supports Ravenscar tasking. Package System contains the following additional restrictions:
4+
5+
* `pragma Restrictions (No_Exception_Propagation);`
6+
* `pragma Restrictions (No_Finalization);`
7+
8+
Aside from the limitations imposed by the small RAM size of the micro:bit (16K), the system clock runs at 100 Hz rather than the 1000 Hz used in the other RTSs in this family.
9+
10+
The RTS is intended to support commercial binary distributions. The Ada source code has either been derived from FSF GCC (4.9.1, in some cases later) or written for this work; see the files `COPYING3` and `COPYING.RUNTIME`.
11+
12+
The RTS is based on [FreeRTOS]( http://www.freertos.org). See `COPYING.FreeRTOS`.
13+
14+
Board support (spec files only) was generated using [svd2ada](https://github.com/AdaCore/svd2ada) at commit `861c829` from the Nordic SVD. See `COPYING.Nordic`.
15+
16+
The following non-original files don't form part of a binary deliverable, so don't affect the status of the binary:
17+
18+
* `build_runtime.gpr` and `runtime.xml` originated in AdaCore's GNAT GPL 2014 arm-eabi distribution (for Linux).
19+
* The linker script `nrf51.ld` is under an MIT licence: see COPYING.MIT.

microbit/nrf51/nrf51-clock.ads renamed to microbit/adainclude/nrf51-clock.ads

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pragma Ada_2012;
21
pragma Style_Checks (Off);
32

43
-- Copyright (c) 2013, Nordic Semiconductor ASA
@@ -57,12 +56,12 @@ package nrf51.CLOCK is
5756
-- Enable interrupt on HFCLKSTARTED event.
5857
type INTENSET_HFCLKSTARTED_Field_1 is
5958
(-- Reset value for the field
60-
Intenset_Hfclkstarted_Field_Reset,
59+
INTENSET_HFCLKSTARTED_Field_Reset,
6160
-- Enable interrupt on write.
6261
Set)
6362
with Size => 1;
6463
for INTENSET_HFCLKSTARTED_Field_1 use
65-
(Intenset_Hfclkstarted_Field_Reset => 0,
64+
(INTENSET_HFCLKSTARTED_Field_Reset => 0,
6665
Set => 1);
6766

6867
-- Enable interrupt on LFCLKSTARTED event.
@@ -79,12 +78,12 @@ package nrf51.CLOCK is
7978
-- Enable interrupt on LFCLKSTARTED event.
8079
type INTENSET_LFCLKSTARTED_Field_1 is
8180
(-- Reset value for the field
82-
Intenset_Lfclkstarted_Field_Reset,
81+
INTENSET_LFCLKSTARTED_Field_Reset,
8382
-- Enable interrupt on write.
8483
Set)
8584
with Size => 1;
8685
for INTENSET_LFCLKSTARTED_Field_1 use
87-
(Intenset_Lfclkstarted_Field_Reset => 0,
86+
(INTENSET_LFCLKSTARTED_Field_Reset => 0,
8887
Set => 1);
8988

9089
-- Enable interrupt on DONE event.
@@ -101,12 +100,12 @@ package nrf51.CLOCK is
101100
-- Enable interrupt on DONE event.
102101
type INTENSET_DONE_Field_1 is
103102
(-- Reset value for the field
104-
Intenset_Done_Field_Reset,
103+
INTENSET_DONE_Field_Reset,
105104
-- Enable interrupt on write.
106105
Set)
107106
with Size => 1;
108107
for INTENSET_DONE_Field_1 use
109-
(Intenset_Done_Field_Reset => 0,
108+
(INTENSET_DONE_Field_Reset => 0,
110109
Set => 1);
111110

112111
-- Enable interrupt on CTTO event.
@@ -123,28 +122,28 @@ package nrf51.CLOCK is
123122
-- Enable interrupt on CTTO event.
124123
type INTENSET_CTTO_Field_1 is
125124
(-- Reset value for the field
126-
Intenset_Ctto_Field_Reset,
125+
INTENSET_CTTO_Field_Reset,
127126
-- Enable interrupt on write.
128127
Set)
129128
with Size => 1;
130129
for INTENSET_CTTO_Field_1 use
131-
(Intenset_Ctto_Field_Reset => 0,
130+
(INTENSET_CTTO_Field_Reset => 0,
132131
Set => 1);
133132

134133
-- Interrupt enable set register.
135134
type INTENSET_Register is record
136135
-- Enable interrupt on HFCLKSTARTED event.
137136
HFCLKSTARTED : INTENSET_HFCLKSTARTED_Field_1 :=
138-
Intenset_Hfclkstarted_Field_Reset;
137+
INTENSET_HFCLKSTARTED_Field_Reset;
139138
-- Enable interrupt on LFCLKSTARTED event.
140139
LFCLKSTARTED : INTENSET_LFCLKSTARTED_Field_1 :=
141-
Intenset_Lfclkstarted_Field_Reset;
140+
INTENSET_LFCLKSTARTED_Field_Reset;
142141
-- unspecified
143142
Reserved_2_2 : nrf51.Bit := 16#0#;
144143
-- Enable interrupt on DONE event.
145-
DONE : INTENSET_DONE_Field_1 := Intenset_Done_Field_Reset;
144+
DONE : INTENSET_DONE_Field_1 := INTENSET_DONE_Field_Reset;
146145
-- Enable interrupt on CTTO event.
147-
CTTO : INTENSET_CTTO_Field_1 := Intenset_Ctto_Field_Reset;
146+
CTTO : INTENSET_CTTO_Field_1 := INTENSET_CTTO_Field_Reset;
148147
-- unspecified
149148
Reserved_5_31 : nrf51.UInt27 := 16#0#;
150149
end record
@@ -174,12 +173,12 @@ package nrf51.CLOCK is
174173
-- Disable interrupt on HFCLKSTARTED event.
175174
type INTENCLR_HFCLKSTARTED_Field_1 is
176175
(-- Reset value for the field
177-
Intenclr_Hfclkstarted_Field_Reset,
176+
INTENCLR_HFCLKSTARTED_Field_Reset,
178177
-- Disable interrupt on write.
179178
Clear)
180179
with Size => 1;
181180
for INTENCLR_HFCLKSTARTED_Field_1 use
182-
(Intenclr_Hfclkstarted_Field_Reset => 0,
181+
(INTENCLR_HFCLKSTARTED_Field_Reset => 0,
183182
Clear => 1);
184183

185184
-- Disable interrupt on LFCLKSTARTED event.
@@ -196,12 +195,12 @@ package nrf51.CLOCK is
196195
-- Disable interrupt on LFCLKSTARTED event.
197196
type INTENCLR_LFCLKSTARTED_Field_1 is
198197
(-- Reset value for the field
199-
Intenclr_Lfclkstarted_Field_Reset,
198+
INTENCLR_LFCLKSTARTED_Field_Reset,
200199
-- Disable interrupt on write.
201200
Clear)
202201
with Size => 1;
203202
for INTENCLR_LFCLKSTARTED_Field_1 use
204-
(Intenclr_Lfclkstarted_Field_Reset => 0,
203+
(INTENCLR_LFCLKSTARTED_Field_Reset => 0,
205204
Clear => 1);
206205

207206
-- Disable interrupt on DONE event.
@@ -218,12 +217,12 @@ package nrf51.CLOCK is
218217
-- Disable interrupt on DONE event.
219218
type INTENCLR_DONE_Field_1 is
220219
(-- Reset value for the field
221-
Intenclr_Done_Field_Reset,
220+
INTENCLR_DONE_Field_Reset,
222221
-- Disable interrupt on write.
223222
Clear)
224223
with Size => 1;
225224
for INTENCLR_DONE_Field_1 use
226-
(Intenclr_Done_Field_Reset => 0,
225+
(INTENCLR_DONE_Field_Reset => 0,
227226
Clear => 1);
228227

229228
-- Disable interrupt on CTTO event.
@@ -240,28 +239,28 @@ package nrf51.CLOCK is
240239
-- Disable interrupt on CTTO event.
241240
type INTENCLR_CTTO_Field_1 is
242241
(-- Reset value for the field
243-
Intenclr_Ctto_Field_Reset,
242+
INTENCLR_CTTO_Field_Reset,
244243
-- Disable interrupt on write.
245244
Clear)
246245
with Size => 1;
247246
for INTENCLR_CTTO_Field_1 use
248-
(Intenclr_Ctto_Field_Reset => 0,
247+
(INTENCLR_CTTO_Field_Reset => 0,
249248
Clear => 1);
250249

251250
-- Interrupt enable clear register.
252251
type INTENCLR_Register is record
253252
-- Disable interrupt on HFCLKSTARTED event.
254253
HFCLKSTARTED : INTENCLR_HFCLKSTARTED_Field_1 :=
255-
Intenclr_Hfclkstarted_Field_Reset;
254+
INTENCLR_HFCLKSTARTED_Field_Reset;
256255
-- Disable interrupt on LFCLKSTARTED event.
257256
LFCLKSTARTED : INTENCLR_LFCLKSTARTED_Field_1 :=
258-
Intenclr_Lfclkstarted_Field_Reset;
257+
INTENCLR_LFCLKSTARTED_Field_Reset;
259258
-- unspecified
260259
Reserved_2_2 : nrf51.Bit := 16#0#;
261260
-- Disable interrupt on DONE event.
262-
DONE : INTENCLR_DONE_Field_1 := Intenclr_Done_Field_Reset;
261+
DONE : INTENCLR_DONE_Field_1 := INTENCLR_DONE_Field_Reset;
263262
-- Disable interrupt on CTTO event.
264-
CTTO : INTENCLR_CTTO_Field_1 := Intenclr_Ctto_Field_Reset;
263+
CTTO : INTENCLR_CTTO_Field_1 := INTENCLR_CTTO_Field_Reset;
265264
-- unspecified
266265
Reserved_5_31 : nrf51.UInt27 := 16#0#;
267266
end record
@@ -280,12 +279,12 @@ package nrf51.CLOCK is
280279
-- Task HFCLKSTART trigger status.
281280
type HFCLKRUN_STATUS_Field is
282281
(-- Task HFCLKSTART has not been triggered.
283-
Nottriggered,
282+
NotTriggered,
284283
-- Task HFCLKSTART has been triggered.
285284
Triggered)
286285
with Size => 1;
287286
for HFCLKRUN_STATUS_Field use
288-
(Nottriggered => 0,
287+
(NotTriggered => 0,
289288
Triggered => 1);
290289

291290
-- Task HFCLKSTART trigger status.
@@ -306,24 +305,24 @@ package nrf51.CLOCK is
306305
-- Active clock source for the HF clock.
307306
type HFCLKSTAT_SRC_Field is
308307
(-- Internal 16MHz RC oscillator running and generating the HFCLK clock.
309-
Rc,
308+
RC,
310309
-- External 16MHz/32MHz crystal oscillator running and generating the HFCLK
311310
-- clock.
312311
Xtal)
313312
with Size => 1;
314313
for HFCLKSTAT_SRC_Field use
315-
(Rc => 0,
314+
(RC => 0,
316315
Xtal => 1);
317316

318317
-- State for the HFCLK.
319318
type HFCLKSTAT_STATE_Field is
320319
(-- HFCLK clock not running.
321-
Notrunning,
320+
NotRunning,
322321
-- HFCLK clock running.
323322
Running)
324323
with Size => 1;
325324
for HFCLKSTAT_STATE_Field use
326-
(Notrunning => 0,
325+
(NotRunning => 0,
327326
Running => 1);
328327

329328
-- High frequency clock status.
@@ -350,12 +349,12 @@ package nrf51.CLOCK is
350349
-- Task LFCLKSTART triggered status.
351350
type LFCLKRUN_STATUS_Field is
352351
(-- Task LFCLKSTART has not been triggered.
353-
Nottriggered,
352+
NotTriggered,
354353
-- Task LFCLKSTART has been triggered.
355354
Triggered)
356355
with Size => 1;
357356
for LFCLKRUN_STATUS_Field use
358-
(Nottriggered => 0,
357+
(NotTriggered => 0,
359358
Triggered => 1);
360359

361360
-- Task LFCLKSTART triggered status.
@@ -376,27 +375,27 @@ package nrf51.CLOCK is
376375
-- Active clock source for the LF clock.
377376
type LFCLKSTAT_SRC_Field is
378377
(-- Internal 32KiHz RC oscillator running and generating the LFCLK clock.
379-
Rc,
378+
RC,
380379
-- External 32KiHz crystal oscillator running and generating the LFCLK clock.
381380
Xtal,
382381
-- Internal 32KiHz synthesizer from the HFCLK running and generating the LFCLK
383382
-- clock.
384383
Synth)
385384
with Size => 2;
386385
for LFCLKSTAT_SRC_Field use
387-
(Rc => 0,
386+
(RC => 0,
388387
Xtal => 1,
389388
Synth => 2);
390389

391390
-- State for the LF clock.
392391
type LFCLKSTAT_STATE_Field is
393392
(-- LFCLK clock not running.
394-
Notrunning,
393+
NotRunning,
395394
-- LFCLK clock running.
396395
Running)
397396
with Size => 1;
398397
for LFCLKSTAT_STATE_Field use
399-
(Notrunning => 0,
398+
(NotRunning => 0,
400399
Running => 1);
401400

402401
-- Low frequency clock status.
@@ -423,14 +422,14 @@ package nrf51.CLOCK is
423422
-- Clock source for the LFCLK clock, set when task LKCLKSTART is triggered.
424423
type LFCLKSRCCOPY_SRC_Field is
425424
(-- Internal 32KiHz RC oscillator.
426-
Rc,
425+
RC,
427426
-- External 32KiHz crystal.
428427
Xtal,
429428
-- Internal 32KiHz synthesizer from HFCLK system clock.
430429
Synth)
431430
with Size => 2;
432431
for LFCLKSRCCOPY_SRC_Field use
433-
(Rc => 0,
432+
(RC => 0,
434433
Xtal => 1,
435434
Synth => 2);
436435

@@ -453,21 +452,21 @@ package nrf51.CLOCK is
453452
-- Clock source.
454453
type LFCLKSRC_SRC_Field is
455454
(-- Internal 32KiHz RC oscillator.
456-
Rc,
455+
RC,
457456
-- External 32KiHz crystal.
458457
Xtal,
459458
-- Internal 32KiHz synthesizer from HFCLK system clock.
460459
Synth)
461460
with Size => 2;
462461
for LFCLKSRC_SRC_Field use
463-
(Rc => 0,
462+
(RC => 0,
464463
Xtal => 1,
465464
Synth => 2);
466465

467466
-- Clock source for the LFCLK clock.
468467
type LFCLKSRC_Register is record
469468
-- Clock source.
470-
SRC : LFCLKSRC_SRC_Field := nrf51.CLOCK.Rc;
469+
SRC : LFCLKSRC_SRC_Field := nrf51.CLOCK.RC;
471470
-- unspecified
472471
Reserved_2_31 : nrf51.UInt30 := 16#0#;
473472
end record
@@ -499,18 +498,18 @@ package nrf51.CLOCK is
499498
-- External Xtal frequency selection.
500499
type XTALFREQ_XTALFREQ_Field is
501500
(-- 32MHz xtal is used as source for the HFCLK oscillator.
502-
Val_32Mhz,
501+
Val_32MHz,
503502
-- 16MHz xtal is used as source for the HFCLK oscillator.
504-
Val_16Mhz)
503+
Val_16MHz)
505504
with Size => 8;
506505
for XTALFREQ_XTALFREQ_Field use
507-
(Val_32Mhz => 0,
508-
Val_16Mhz => 255);
506+
(Val_32MHz => 0,
507+
Val_16MHz => 255);
509508

510509
-- Crystal frequency.
511510
type XTALFREQ_Register is record
512511
-- External Xtal frequency selection.
513-
XTALFREQ : XTALFREQ_XTALFREQ_Field := nrf51.CLOCK.Val_16Mhz;
512+
XTALFREQ : XTALFREQ_XTALFREQ_Field := nrf51.CLOCK.Val_16MHz;
514513
-- unspecified
515514
Reserved_8_31 : nrf51.UInt24 := 16#FFFFFF#;
516515
end record

0 commit comments

Comments
 (0)