Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)

Liste des GroupesRevenir à cl forth 
Sujet : Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)
De : albert (at) *nospam* spenarnc.xs4all.nl
Groupes : comp.lang.forth
Date : 26. Oct 2024, 09:48:27
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$3c99179e$3dd4b32f@6cc2be919654136f>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <vfhgqc$3sajh$1@paganini.bofh.team>,
Waldek Hebisch <antispam@fricas.org> wrote:
Waldek Hebisch <antispam@fricas.org> wrote:
<SNIP>
Milkv Duos have 5 GPIO ports, formally 32-bit but many lines are
not connected to outputs.  One port in RTC block and has
base address 0x05021000, the other ports are at 0x03020000 + n*0x1000
where n is port number.  Output register is at offset 0, at offset
4 is direction register (setting bit to 1 means that line is an
output).  At offset 0x50 is input register.  Other registers
deal with interrupts.
>
ATM I have the following:
>
HEX
: LBIS DUP L@ ROT OR SWAP L! ;
: LBIC DUP L@ ROT INVERT AND SWAP L! ;

These boards are all 32 bits io. So I lifted the BIS and BIC
from ARM boards into riscv.
So you can use BIS instead of LBIS, BIC instead of LBIC.
Of course they are in assembler, as these low level words must be.

: gpio-base DUP 4 = IF DROP 2001000 ELSE 1000 * THEN VMA-IO @ + 20000 + ;
: bit-data 20 /MOD SWAP 1 SWAP LSHIFT SWAP gpio-base ;
: gpio-on bit-data LBIS ;
: gpio-off bit-data LBIC ;
>
which outputs bits to data register.  To get actual output one
need to set direction register and associate PIN with GPIO function.

I defined set-function by ( fun# gpio#)
and redefine fun# that I always 0 for input , -1 for output.
This make a 1602 driver almost portable except for defining
the port numbers/


--
                             Waldek Hebisch

Groetjes Albert
--
Temu exploits Christians: (Disclaimer, only 10 apostles)
Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
And Gifts For Friends Family And Colleagues.

Date Sujet#  Auteur
24 Sep 24 * 1 euro Olimex RISC-V mini-PC: this needs Forth ;)35Paul Rubin
25 Sep 24 +* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)12dxf
25 Sep 24 i+* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)10Paul Rubin
25 Sep 24 ii`* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)9dxf
25 Sep 24 ii `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)8Paul Rubin
29 Sep 24 ii  +- Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)1Waldek Hebisch
29 Sep 24 ii  `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)6LIT
29 Sep 24 ii   `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)5dxf
29 Sep 24 ii    `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)4LIT
30 Sep 24 ii     `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)3dxf
30 Sep 24 ii      `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)2LIT
30 Sep 24 ii       `- Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)1dxf
28 Sep 24 i`- Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)1LIT
25 Sep 24 +- Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)1David De La Harpe Golden
29 Sep 24 +- Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)1Waldek Hebisch
29 Sep 24 `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)20LIT
29 Sep 24  `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)19Paul Rubin
29 Sep 24   `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)18LIT
29 Sep 24    `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)17Paul Rubin
17 Oct 24     `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)16Waldek Hebisch
17 Oct 24      `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)15LIT
18 Oct 24       `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)14Waldek Hebisch
18 Oct 24        `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)13albert
18 Oct 24         `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)12Waldek Hebisch
19 Oct 24          `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)11albert
21 Oct 24           `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)10Waldek Hebisch
21 Oct 24            `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)9Waldek Hebisch
21 Oct 24             +* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)2albert
23 Oct 24             i`- Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)1Waldek Hebisch
26 Oct 24             `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)6Waldek Hebisch
26 Oct 24              +* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)3albert
26 Oct 24              i`* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)2Waldek Hebisch
27 Oct 24              i `- Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)1albert
26 Oct 24              `* Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)2albert
26 Oct 24               `- Re: 1 euro Olimex RISC-V mini-PC: this needs Forth ;)1Waldek Hebisch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal