-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rp2040-tiny, rework led code, rework some extras stuff
- Loading branch information
Showing
68 changed files
with
507 additions
and
135 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
01-early-connection.py | ||
02-path.py | ||
04-advance-time.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
05-reload-hostname.py | ||
06-advance-time.lja |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
04-wifi.py | ||
06-advance-time.lja | ||
50-telnet.lja | ||
05-reload-hostname.py |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
01-early-connection.py | ||
02-path.py | ||
04-advance-time.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
06-advance-time.lja | ||
05-reload-hostname.py |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
00-no-dmesg.lja | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
07-no-dmesg.lja | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
01-early-connection.py | ||
02-path.py | ||
04-advance-time.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
05-reload-hostname.py | ||
06-advance-time.lja |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
01-early-connection.py | ||
02-path.py | ||
04-advance-time.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
05-reload-hostname.py | ||
06-advance-time.lja |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
01-early-connection.py | ||
02-path.py | ||
04-advance-time.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
05-reload-hostname.py | ||
06-advance-time.lja |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
00-no-dmesg.lja | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
07-no-dmesg.lja | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
01-early-connection.py | ||
02-path.py | ||
03-LEDs.py | ||
05-reload-hostname.py | ||
06-advance-time.lja |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
,----.....----. | ||
[ | ] 5V (32) |o5V ````` o| (0) GP0 [SPI0 RX |I2C0 SDA|UART0 TX] | ||
[ | ] GND (31) |o usbC o| (1) GP1 [SPI0 CSn|I2C0 SCL|UART0 RX] | ||
[ | ] 3V3 (30) |oRP2040-Tinyo| (2) GP2 [SPI0 SCK|I2C1 SDA| ] | ||
[ | ADC3 ] GP29 (29) |o o| (3) GP3 [SPI0 TX |I2C1 SCL| ] | ||
[ | ADC2 ] GP28 (28) |o . o| (4) GP4 [SPI0 RX |I2C0 SDA|UART1 TX] | ||
[I2C1 SCL| ADC1 ] GP27 (27) |o / \ o| (5) GP5 [SPI0 CSn|I2C0 SCL|UART1 RX] | ||
[I2C1 SDA| ADC0 ] GP26 (26) |o \ / o| (6) GP6 [SPI0 SCK|I2C1 SDA| ] | ||
[I2C1 SCL|SPI1 TX ] GP15 (25) |o ` L o| (7) GP7 [SPI0 TX |I2C1 SCL| ] | ||
[I2C1 SDA|SPI1 CLK] GP14 (24) |o o o o o o o| (8) GP8 [SPI1 RX |I2C0 SDA|UART1 TX] | ||
`-------------' | ||
| | | | | | ||
,----------------. | | | \ `-- (9) GP9 [SPI1 CSn|I2C1 SCL|UART1 RX] | ||
/ LED used pin \ | | \ `--- (10) GP10 [SPI1 SCK|I2C1 SDA| ] | ||
| | | \ `----- (11) GP11 [SPI1 TX |I2C1 SCL| ] | ||
\ [ GP16 | DIN ] / \ `------- (12) GP12 [SPI1 RX |I2C0 SDA|UART0 TX] | ||
`----------------' `--------- (13) GP13 [SPI1 CSn|I2C0 SCL|UART0 RX] | ||
|
||
Waveshare RP2040-Tiny | ||
|
||
SoC : RP2040 | ||
RAM : 264KB | ||
Storage : SQPI (2MB) | ||
Wi-fi : False | ||
Bluetooth : False |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from board import ( | ||
GP0, | ||
GP1, | ||
GP2, | ||
GP3, | ||
GP4, | ||
GP5, | ||
GP6, | ||
GP7, | ||
GP8, | ||
GP9, | ||
GP10, | ||
GP11, | ||
GP12, | ||
GP13, | ||
GP14, | ||
GP15, | ||
GP16, | ||
GP26, | ||
GP27, | ||
GP28, | ||
) | ||
|
||
pintab = { | ||
0: GP0, | ||
1: GP1, | ||
2: GP2, | ||
3: GP3, | ||
4: GP4, | ||
5: GP5, | ||
6: GP6, | ||
7: GP7, | ||
8: GP8, | ||
9: GP9, | ||
10: GP10, | ||
11: GP11, | ||
12: GP12, | ||
13: GP13, | ||
14: GP14, | ||
15: GP15, | ||
16: GP16, | ||
26: GP26, | ||
27: GP27, | ||
28: GP28, | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
CIRCUITPY_PYSTACK_SIZE = 4608 | ||
|
||
[LJINUX] | ||
setup = true | ||
|
||
fs_label = "LJINUX" | ||
|
||
serial_console_enabled = true | ||
usb_msc_available = true | ||
usb_hid_available = true | ||
usb_midi_available = true | ||
wifi_available = false | ||
ble_available = false | ||
blc_available = false | ||
usb_msc_enabled = false | ||
usb_hid_enabled = false | ||
usb_midi_enabled = false | ||
|
||
leden = -1 | ||
ledtype = "neopixel_invert" | ||
led = 16 | ||
|
||
DEBUG = false | ||
|
||
root_SCLK = -1 | ||
root_SCSn = -1 | ||
root_MOSI = -1 | ||
root_MISO = -1 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
01-early-connection.py | ||
02-path.py | ||
04-advance-time.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
05-reload-hostname.py | ||
06-advance-time.lja |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
00-no-dmesg.lja | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
07-no-dmesg.lja | ||
03-LEDs.py | ||
04-wifi.py | ||
06-advance-time.lja | ||
50-telnet.lja | ||
05-reload-hostname.py |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
00-no-dmesg.lja | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
07-no-dmesg.lja | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
01-early-connection.py | ||
02-path.py | ||
03-wifi.py | ||
04-advance-time.lja | ||
05-telnet.lja | ||
06-reload-hostname.py | ||
03-LEDs.py | ||
04-wifi.py | ||
05-reload-hostname.py | ||
06-advance-time.lja | ||
50-telnet.lja |
Empty file.
Empty file.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
systemprints(2, "Setting up LEDs") | ||
ljinux.based.run("modprobe " + ljinux.io.ledtype) | ||
if ljinux.io.ledtype in ljinux.modules: | ||
if ljinux.io.ledtype.startswith("rgb"): | ||
ljinux.modules[ljinux.io.ledtype].setup( | ||
ljinux.io.led, ljinux.io.ledg, ljinux.io.ledb | ||
) | ||
else: | ||
ljinux.modules[ljinux.io.ledtype].setup(ljinux.io.led) | ||
ljinux.io.led_setup = True | ||
systemprints(1, "Setting up LEDs") | ||
else: | ||
systemprints(3, "Setting up LEDs") |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
class led_generic: | ||
def __init__(self): | ||
self._dg = None # digitalio object | ||
|
||
def setup(self, dg) -> None: | ||
if self._dg is not None: | ||
return | ||
self._dg = dg | ||
self._dg.switch_to_output() | ||
self._dg.value = 0 | ||
|
||
@property | ||
def value(self): | ||
if self._dg is None: | ||
return | ||
return self._dg.value | ||
|
||
@value.setter | ||
def value(self, value) -> None: | ||
if self._dg is None: | ||
return | ||
if value in [None, False]: | ||
value = 0 | ||
elif value is True: | ||
value = 1 | ||
if isinstance(value, int): | ||
self._dg.value = value not in [0, 3, 4, 5] | ||
elif isinstance(value, tuple): | ||
self._dg.value = sum(value) | ||
else: | ||
raise TypeError("Invalid led value type") | ||
|
||
def deinit(self) -> None: | ||
if self._dg is not None: | ||
self._dg.deinit() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
class led_generic_invert: | ||
def __init__(self): | ||
self._dg = None # digitalio object | ||
|
||
def setup(self, dg) -> None: | ||
if self._dg is not None: | ||
return | ||
self._dg = dg | ||
self._dg.switch_to_output() | ||
self._dg.value = 1 | ||
|
||
@property | ||
def value(self): | ||
if self._dg is None: | ||
return | ||
return not self._dg.value | ||
|
||
@value.setter | ||
def value(self, value) -> None: | ||
if self._dg is None: | ||
return | ||
if value in [None, False]: | ||
value = 0 | ||
elif value is True: | ||
value = 1 | ||
if isinstance(value, int) or value is None: | ||
self._dg.value = value in [0, 3, 4, 5] | ||
elif isinstance(value, tuple): | ||
self._dg.value = not sum(value) | ||
else: | ||
raise TypeError("Invalid led value type") | ||
|
||
def deinit(self) -> None: | ||
if self._dg is not None: | ||
self._dg.deinit() |
Oops, something went wrong.