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!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.91-157-44-55.elisa-laajakaista.fi!not-for-mail From: Tero Koskinen Newsgroups: comp.lang.ada Subject: Re: ANN: Cortex GNAT RTS 2018-07-15 Date: Wed, 18 Jul 2018 14:31:55 +0300 Organization: JSA Research & Innovation Message-ID: <1005e1e5-c1f2-ef3d-d2a5-c309d47ca32c@iki.fi> References: <87in5gf9nt.fsf@nightsong.com> <87sh4ipq0q.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: franka.jacob-sparre.dk; posting-host="91-157-44-55.elisa-laajakaista.fi:91.157.44.55"; logging-data="31964"; mail-complaints-to="news@jacob-sparre.dk" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/6.1.0 To: Simon Wright In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:53890 Date: 2018-07-18T14:31:55+03:00 List-Id: Hi, Simon Wright wrote on 17.7.2018 16.14: > Paul Rubin writes: > >> Simon Wright writes: >>> A kind thought! but as Fabien says, it's already been done. Might >>> look at one of the others (though I had been thinking of something >>> bigger rather than smaller, e.g. STM32F7). >> >> Hmm, I guess I have two Trinket M0's (actually one of them is a Gemma, >> same board except circular in shape) if you want one of those. > > Just a little bit too tiny for me! (8K flash, 512b ram). Candidates for > a ZFP, I think. I have samd21-zfp port for GNAT GPL at https://bitbucket.org/tkoskine/zfp-samd21 It isn't complete yet, but you can do simple blink led apps with it. And if you dislike Adacore's codebase, I have AVR-Ada style runtime for samd21 & FSF GNAT combo at: https://bitbucket.org/tkoskine/samd-ada Here example code for samd21-zfp: with Interfaces; package GPIO is type Port_Type is (PORT_A, PORT_B); subtype GPIO_Pin_Type is Interfaces.Unsigned_8; procedure Set_Output (GPIO_Port : Port_Type; GPIO_Pin : GPIO_Pin_Type); procedure Set_State (GPIO_Port : Port_Type; GPIO_Pin : GPIO_Pin_Type; State : Boolean); end GPIO; with ATSAMD21G18A.PORT; package body GPIO is use Interfaces; use ATSAMD21G18A.PORT; use ATSAMD21G18A; procedure Set_Output (GPIO_Port : Port_Type; GPIO_Pin : GPIO_Pin_Type) is begin if GPIO_Port = PORT_A then PORT0_Periph.OUTSET := Shift_Left (Uint32 (1), Natural (GPIO_Pin)); PORT0_Periph.DIRSET := Shift_Left (Uint32 (1), Natural (GPIO_Pin)); PORT0_Periph.PINCFG (Natural (GPIO_Pin)) := (0, 0, 0, 0, 0, 0); else PORT1_Periph.OUTSET := Shift_Left (Uint32 (1), Natural (GPIO_Pin)); PORT1_Periph.DIRSET := Shift_Left (Uint32 (1), Natural (GPIO_Pin)); PORT1_Periph.PINCFG (Natural (GPIO_Pin)) := (0, 0, 0, 0, 0, 0); end if; end Set_Output; procedure Set_State (GPIO_Port : Port_Type; GPIO_Pin : GPIO_Pin_Type; State : Boolean) is begin if GPIO_Port = Port_A then if State then PORT0_Periph.OUTSET := Shift_Left (Uint32 (1), Natural (GPIO_Pin)); else PORT0_Periph.OUTCLR := Shift_Left (Uint32 (1), Natural (GPIO_Pin)); end if; else if State then PORT1_Periph.OUTSET := Shift_Left (Uint32 (1), Natural (GPIO_Pin)); else PORT1_Periph.OUTCLR := Shift_Left (Uint32 (1), Natural (GPIO_Pin)); end if; end if; end Set_State; end GPIO;with GPIO; procedure Main is begin GPIO.Set_Output (GPIO.PORT_A, 17); loop GPIO.Set_State (GPIO.PORT_A, 17, True); GPIO.Set_State (GPIO.PORT_A, 17, False); end loop; end Main; -Tero Ps. I also have several SAMD5x boards (including Adafruit's Metro M4 and ItsyBitsy M4). Once I have some free time (in a year or two?), I'll create zfp runtime for them also.