comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: Raspberry Pi SenseHAT / AstroPi
Date: Tue, 23 Jan 2018 18:03:27 -0500
Date: 2018-01-23T18:03:27-05:00	[thread overview]
Message-ID: <qudf6d9bb8fp8h0urvtjdd03i1plui02oc@4ax.com> (raw)
In-Reply-To: e07875fc-d7e8-4c78-b2d0-01d86168b37a@googlegroups.com

On Tue, 23 Jan 2018 13:30:36 -0800 (PST), slos <new.stephane.los@gmail.com>
declaimed the following:

>It could allow some people interested in Ada language to play on an inexpensive target. Is it useless ?
>The Raspberry Pi was designed exactly for that purpose. Teaching and experiments for anyone interested in.

	The RPi was designed for an educational usage, yes -- but it is
commonly believed that the "Pi" part of the name was influenced by "Python"
as the language of choice.

	Ada was never really designed as a language for quick experimentation.
For data-processing type applications, one can create programs using the
stock library (I'm talking the type of processing that made use of fixed
format record layouts -- even use of an RDBM gets a bit advanced in Ada,
and I don't want to consider what a GUI takes).

	For Linux on RPi (and BBB), the common /base/ for GPIO and other
special peripherals is to use the sys file system -- by opening virtual
files representing pins, PWM, etc. and doing read/write operations. Lots of
latency as one is using POSIX I/O calls which transfer from user mode to
kernel and back -- but is available to /any/ language capable of opening
arbitrary files -- no libraries are needed.

	The next layer above that is a simple library which handles the
formation of the proper sysfs file names while masking them from the user
-- one calls a function to write to a pin, and the library generates the
file name appropriate for that pin, opens said file, writes the value, and
closes the file.

	Beyond that you are in the realm of doing things like mmap a memory
block into the processor peripheral I/O space -- which often requires root
privilege -- and writing bits to the actual I/O ports. This is beyond the
simple experimenters that are the target of the RPi/BBB. In Ada, this would
be using address attributes on variable declarations (not quite an
example):
http://www.adaic.org/resources/add_content/docs/95style/html/sec_5/5-9-4.html
And I'd consider that quite an advanced subject -- one would need to study
the reference for the SoC in use to determine the proper addresses, and
bits within that address (since GPIO ports typically are multiple bits
wide). One would need to be able to ensure the addresses are hardware
addresses, and not the virtual address blocks seen by user-land Linux
programs. So... bare-board (no OS) with ALL I/O, including simple serial
port console needs to be coded...

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/


  parent reply	other threads:[~2018-01-23 23:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23 15:45 Raspberry Pi SenseHAT / AstroPi slos
2018-01-23 16:33 ` Dennis Lee Bieber
2018-01-30 23:00   ` Luke A. Guest
2018-01-23 17:40 ` Dmitry A. Kazakov
2018-01-23 19:18   ` Dennis Lee Bieber
2018-01-23 20:29     ` Dmitry A. Kazakov
2018-01-23 21:30   ` slos
2018-01-23 22:02     ` Dmitry A. Kazakov
2018-01-23 23:03     ` Dennis Lee Bieber [this message]
2018-01-25 11:12 ` Philip Munts
2018-01-29 14:40   ` slos
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox