Skip to content

Instantly share code, notes, and snippets.

@tabemann
tabemann / rp_spi_clock_test.txt
Created September 4, 2024 02:03
rp_spi_clock_test.txt
\ This is a comparison of SPI input and output clocks where those for the RP2040
\ are faster than those for the RP2350 for the same SPI input SPI clock.
\
\ Of the below numbers, the first is the input SPI clock, the second is the
\ RP2040 (i.e. 125 MHz system clock) output SPI clock, and the third is the
\ RP2350 (i.e. 150 MHz system clock) output SPI clock. All values are in Hz.
spi-clock-test
2016200 2016129 1973684
2027000 2016129 1973684
@tabemann
tabemann / consttst.txt
Created September 2, 2024 01:13
consttst.txt
fat32-tools import enable-line ok
s" TEST/CONSTTST.FS" included
: const16 [inlined] $DEAD ;
: const32 [inlined] $DEADCAFE ;
: const16-included const16 ;
: const32-included const32 ;
$DEAD constant constant16
$DEADCAFE constant constant32
: constant16-included constant16 ;
: constant32-included constant32 ;
@tabemann
tabemann / us_unroll.fs
Last active July 24, 2024 02:28
us_unroll.fs
\ Copyright (c) 2024 Travis Bemann
\
\ Permission is hereby granted, free of charge, to any person obtaining a copy
\ of this software and associated documentation files (the "Software"), to deal
\ in the Software without restriction, including without limitation the rights
\ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\ copies of the Software, and to permit persons to whom the Software is
\ furnished to do so, subject to the following conditions:
\
\ The above copyright notice and this permission notice shall be included in
@tabemann
tabemann / us.fs
Created July 24, 2024 01:09
us.fs
\ Copyright (c) 2024 Travis Bemann
\
\ Permission is hereby granted, free of charge, to any person obtaining a copy
\ of this software and associated documentation files (the "Software"), to deal
\ in the Software without restriction, including without limitation the rights
\ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\ copies of the Software, and to permit persons to whom the Software is
\ furnished to do so, subject to the following conditions:
\
\ The above copyright notice and this permission notice shall be included in
@tabemann
tabemann / fun_with_zeptoscript.fs
Created March 31, 2024 05:10
fun_with_zeptoscript.fs
begin-record pair
item: pair-name
item: pair-value
end-record
global pairs
s" foo " 0 >pair
s" bar " 1 >pair
s" baz " 2 >pair
@tabemann
tabemann / mecrisp_ice_spin.fs
Created March 10, 2024 03:08
mecrisp_ice_spin.fs
$0401 constant P3IN
$0402 constant P3OUT
$0404 constant P3DIR
: bit 1 swap lshift ;
0 bit constant west
5 bit constant north
1 bit constant east
2 bit constant south
@tabemann
tabemann / closure_examples.fs
Last active December 15, 2022 19:07
Closure examples
closure import ok
closure-size buffer: my-adder ok
: set-add ( x -- ) my-adder ['] + bind ; ok
1 set-add ok
1 my-adder execute . 2 ok
2 set-add ok
1 my-adder execute . 3 ok
2 my-adder execute . 4 ok
0 set-add ok
1 my-adder execute . 1 ok
@tabemann
tabemann / ssd1306_snow_wind.fs
Created December 14, 2022 02:23
Snow with wind for the SSD1306
\ Copyright (c) 2022 Travis Bemann
\
\ Permission is hereby granted, free of charge, to any person obtaining a copy
\ of this software and associated documentation files (the "Software"), to deal
\ in the Software without restriction, including without limitation the rights
\ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\ copies of the Software, and to permit persons to whom the Software is
\ furnished to do so, subject to the following conditions:
\
\ The above copyright notice and this permission notice shall be included in
@tabemann
tabemann / ssd1306_snow.fs
Created December 13, 2022 05:21
Snow for the SSD1306
\ Copyright (c) 2022 Travis Bemann
\
\ Permission is hereby granted, free of charge, to any person obtaining a copy
\ of this software and associated documentation files (the "Software"), to deal
\ in the Software without restriction, including without limitation the rights
\ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\ copies of the Software, and to permit persons to whom the Software is
\ furnished to do so, subject to the following conditions:
\
\ The above copyright notice and this permission notice shall be included in
@tabemann
tabemann / ssd1306_snowflake.fs
Last active December 13, 2022 16:10
Snowflake for the SSD1306
begin-module snowflake
\ Only 'ssd1306-print import' is really needed here; the others are just to show dependencies.
oo import
bitmap import
ssd1306 import
font import
simple-font import
ssd1306-print import
: >s { x y -- } x c, y c, [char] * c, ;