This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ uses 4 bytes at neopixel_address.. pin# r g b | |
\ this address is monitored and when it changes the rgb is set | |
#require gpio-pins.fs | |
\ byte 0 is r, 1 is g, 2 is b, 3 is pin# | |
0 variable neopixel-address | |
\ this is launched on core1 | |
\ starts monitoring the address and does not return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ neopixel.fs traffic lights a neopixel on pin 16, done in assembly bit blitting the data | |
: neopixel | |
[ | |
$7179 h, \ addi sp,sp,-48 | |
$c006 h, \ sw ra,0(sp) | |
$c20e h, \ sw gp,4(sp) | |
$c412 h, \ sw tp,8(sp) | |
$c616 h, \ sw t0,12(sp) | |
$c81a h, \ sw t1,16(sp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
Definition Flag_visible, "execute-coprocessor" | |
execute_coprocessor: # ( xt -- ) Entry point for the coprocessor trampoline | |
# ----------------------------------------------------------------------------- | |
# Store the execution token into a global variable | |
li x14, trampolineaddr # Note we are using li here as we forcefully circumvent the linker facilities | |
sw x8, 0(x14) | |
drop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# Initialize register file | |
# li x1, 0 # Return address register, holds link back and is also used to compose long calls with auipc and jalr | |
# laf x2, returnstackanfang # Set return stack pointer (sp) | |
# li x3, 0 # Loop index | |
# li x4, 0 # Loop limit | |
# li x5, 0 # Scratch register, needs to be saved. | |
# li x6, 0 # Scratch register, needs to be saved. | |
# li x7, 0 # Scratch register, needs to be saved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python3 | |
# this script will concatenate the file specified into the upload.fs | |
# it strips comments and handles #require | |
# | |
import argparse | |
import os | |
import re | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.foreach('RP2350.svd') do |line| | |
if line.include?('<bitRange>') | |
# Extract range from <bitRange>[31:0]</bitRange> | |
range_match = line.match(/\[(\d+):(\d+)\]/) | |
if range_match | |
hr = range_match[1].to_i | |
lr = range_match[2].to_i | |
puts "<bitOffset>#{lr}</bitOffset>" | |
puts "<bitWidth>#{(hr - lr) + 1}</bitWidth>" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.section .text | |
.global _start | |
.equ SYSCTL_BASE, 0x40000000 | |
.equ CLK_EN_REG, SYSCTL_BASE + 0x100 # Clock enable register | |
.equ PAD_ISO_REG, 0x40038000 + 0x40 # Pad isolation control register for GPIO15 | |
.equ IOMUX_BASE, 0x40028000 | |
.equ IOMUX_GPIO15, IOMUX_BASE + 0x7C # IOMUX register for GPIO15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python -u | |
import subprocess | |
import selectors | |
import os | |
import time | |
import readline | |
import sys | |
import atexit | |
import threading |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[button box] | |
feeder0.pin = PE8 # button | |
feeder0.press = echo -1 M700N0 # command to send | |
feeder1.pin = PJ7 # button | |
feeder1.press = echo -1 M700N1 # command to send | |
feeder2.pin = PJ8 # button | |
feeder2.press = echo -1 M700N2 # command to send | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
x0=0 # First Position (Start) | |
xd=100 # Second Position (End) | |
T=100 # Time | |
x= [0] * 101 | |
for t in range(0,101): | |
x[t]= x0+(xd-x0)*(10*((t/T)**3)-15*((t/T)**4)+6*((t/T)**5)) |
NewerOlder