From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!paganini.bofh.team!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 23 Jan 2018 17:03:27 -0600 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: Raspberry Pi SenseHAT / AstroPi Date: Tue, 23 Jan 2018 18:03:27 -0500 Organization: IISS Elusive Unicorn Message-ID: References: <10c0eb19-4d5c-4ef2-b3a8-751ae3c5b530@googlegroups.com> User-Agent: ForteAgent/8.00.32.1272 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.73.118.61 X-Trace: sv3-DirHhO5XPYVlqBacgAu9UjETr1/oH9izxlGueYATE4wmFuPHdgVK5N0pYeL0+dqvQ0+CwdKYBttSmbh!C1v5O1j/bSLVXFpG3i265QqFzQj9cab9swoaVXZz2Fh3K48TXPPnkPwyZnELqvvBUOIseFwSV+Gz!FHcDqelFG5s7UOmf9C8mtRzkOQo= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3800 Xref: reader02.eternal-september.org comp.lang.ada:50084 Date: 2018-01-23T18:03:27-05:00 List-Id: On Tue, 23 Jan 2018 13:30:36 -0800 (PST), slos 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/