1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-13 09:28:05 +11:00
collapseos/blk/162
Virgil Dupras 037c10fc57 Move AVR programmer from B690 to B160
Also, remove leftovers from previous move.
2020-09-21 20:00:49 -04:00

14 lines
581 B
Plaintext

: aspfb! ( n a --, write word n to flash buffer addr a )
SWAP 256 /MOD ( a lo hi ) SWAP ROT ( hi lo a )
DUP ROT ( hi a a lo ) SWAP ( hi a lo a )
0 0x40 ( hi a lo a 0 0x40 ) _cmd DROP ( hi a )
0 0x48 _cmd DROP ;
: aspfp! ( page --, write buffer to page )
0 SWAP aspfpgsz @ * 256 /MOD ( 0 lsb msb )
0x4c _cmd DROP asprdy ;
: aspf@ ( page a -- n, read word from flash )
SWAP aspfpgsz @ * OR ( addr ) 256 /MOD ( lsb msb )
2DUP 0 ROT ROT ( lsb msb 0 lsb msb )
0x20 _cmd ( lsb msb low )
ROT ROT 0 ROT ROT ( low 0 lsb msb ) 0x28 _cmd 8 LSHIFT OR ;