Skip to content

Commit 40f9663

Browse files
authored
Merge pull request #3 from proveskit/v5a-reference-devel
Initial V5a Working Reference
2 parents 9d1de1e + 4e056d1 commit 40f9663

File tree

9 files changed

+565
-93
lines changed

9 files changed

+565
-93
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYSQUARED_VERSION ?= v2.0.0-alpha-25w14-3
1+
PYSQUARED_VERSION ?= sx1280-manager
22
PYSQUARED ?= git+https://github.com/proveskit/pysquared@$(PYSQUARED_VERSION)
33

44
.PHONY: all
@@ -51,6 +51,11 @@ else
5151
$(call rsync_to_dest,artifacts/proves,$(BOARD_MOUNT_POINT))
5252
endif
5353

54+
# install-firmware
55+
.PHONY: install-firmware
56+
install-firmware: uv ## Install the board firmware onto a connected PROVES Kit
57+
@$(UVX) --from git+https://github.com/proveskit/[email protected] install-firmware v5a
58+
5459
.PHONY: clean
5560
clean: ## Remove all gitignored files such as downloaded libraries and artifacts
5661
git clean -dfX

lib/requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
adafruit-circuitpython-74hc595==1.4.6
1+
adafruit-circuitpython-ina219==3.4.26
22
adafruit-circuitpython-asyncio @ git+https://github.com/adafruit/[email protected]
33
adafruit-circuitpython-drv2605==1.3.4
44
adafruit-circuitpython-lis2mdl==2.1.23
@@ -7,8 +7,9 @@ adafruit-circuitpython-mcp9808==3.3.24
77
adafruit-circuitpython-neopixel==6.3.12
88
adafruit-circuitpython-register==1.10.1
99
adafruit-circuitpython-rfm==1.0.3
10-
adafruit-circuitpython-tca9548a @ git+https://github.com/proveskit/Adafruit_CircuitPython_TCA9548A@1.0.0
10+
adafruit-circuitpython-tca9548a @ git+https://github.com/proveskit/Adafruit_CircuitPython_TCA9548A@1.1.0
1111
adafruit-circuitpython-ticks==1.1.1
1212
adafruit-circuitpython-veml7700==2.0.2
13+
Adafruit_CircuitPython_MCP230xx
1314
proves-circuitpython-rv3028 @ git+https://github.com/proveskit/[email protected]
14-
proves-circuitpython-sx126 @ git+https://github.com/proveskit/micropySX126X@1.0.0
15+
proves-circuitpython-sx1280 @ git+https://github.com/proveskit/CircuitPython_SX1280@1.0.3

main.py

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,19 @@
33
# Created By: Michael Pham
44

55
"""
6-
Built for the PySquared FC Board
7-
Version: 2.0.0
8-
Published: Nov 19, 2024
6+
Built for the PySquared V5a FC Board
7+
Version: X.X.X
8+
Published:
99
"""
1010

1111
import gc
12+
import os
1213
import time
1314

15+
import board
1416
import digitalio
1517
import microcontroller
1618

17-
try:
18-
# from board_definitions import proveskit_rp2040_v4 as board
19-
raise ImportError
20-
except ImportError:
21-
import board
22-
23-
import os
24-
2519
import lib.pysquared.functions as functions
2620
import lib.pysquared.nvm.register as register
2721
from lib.pysquared.cdh import CommandDataHandler
@@ -30,7 +24,7 @@
3024
from lib.pysquared.hardware.digitalio import initialize_pin
3125
from lib.pysquared.hardware.imu.manager.lsm6dsox import LSM6DSOXManager
3226
from lib.pysquared.hardware.magnetometer.manager.lis2mdl import LIS2MDLManager
33-
from lib.pysquared.hardware.radio.manager.sx126x import SX126xManager
27+
from lib.pysquared.hardware.radio.manager.sx1280 import SX1280Manager
3428
from lib.pysquared.logger import Logger
3529
from lib.pysquared.nvm.counter import Counter
3630
from lib.pysquared.nvm.flag import Flag
@@ -43,7 +37,7 @@
4337
rtc = MicrocontrollerManager()
4438

4539
logger: Logger = Logger(
46-
error_counter=Counter(index=register.ERRORCNT, datastore=microcontroller.nvm),
40+
error_counter=Counter(index=register.ERRORCNT),
4741
colorized=False,
4842
)
4943

@@ -68,38 +62,58 @@
6862

6963
# TODO(nateinaction): fix spi init
7064
spi0 = _spi_init(
65+
logger,
66+
board.SPI0_SCK,
67+
board.SPI0_MOSI,
68+
board.SPI0_MISO,
69+
)
70+
71+
spi1 = _spi_init(
7172
logger,
7273
board.SPI1_SCK,
7374
board.SPI1_MOSI,
7475
board.SPI1_MISO,
7576
)
7677

77-
radio = SX126xManager(
78+
use_fsk_flag = Flag(index=register.FLAG, bit_index=7)
79+
80+
radio = SX1280Manager(
7881
logger,
7982
config.radio,
80-
Flag(index=register.FLAG, bit_index=7, datastore=microcontroller.nvm),
81-
spi0,
82-
initialize_pin(logger, board.SPI0_CS0, digitalio.Direction.OUTPUT, True),
83-
board.RF2_IO0,
84-
initialize_pin(logger, board.RF1_RST, digitalio.Direction.OUTPUT, True),
85-
board.RF2_IO4,
83+
use_fsk_flag,
84+
spi1,
85+
initialize_pin(logger, board.SPI1_CS0, digitalio.Direction.OUTPUT, True),
86+
initialize_pin(logger, board.RF2_RST, digitalio.Direction.OUTPUT, True),
87+
initialize_pin(logger, board.RF2_IO0, digitalio.Direction.OUTPUT, True),
88+
2.4,
89+
initialize_pin(logger, board.RF2_TX_EN, digitalio.Direction.OUTPUT, True),
90+
initialize_pin(logger, board.RF2_RX_EN, digitalio.Direction.OUTPUT, True),
8691
)
8792

8893
i2c1 = initialize_i2c_bus(
8994
logger,
90-
board.I2C1_SCL,
91-
board.I2C1_SDA,
95+
board.SCL1,
96+
board.SDA1,
9297
100000,
9398
)
9499

95-
magnetometer = LIS2MDLManager(logger, i2c1)
96-
97-
imu = LSM6DSOXManager(logger, i2c1, 0x6B)
98-
99100
c = Satellite(logger, config)
100101

101102
sleep_helper = SleepHelper(c, logger, watchdog)
102103

104+
# radio = RFM9xManager(
105+
# logger,
106+
# config.radio,
107+
# Flag(index=register.FLAG, bit_index=7),
108+
# spi0,
109+
# initialize_pin(logger, board.SPI0_CS0, digitalio.Direction.OUTPUT, True),
110+
# initialize_pin(logger, board.RF1_RST, digitalio.Direction.OUTPUT, True),
111+
# )
112+
113+
magnetometer = LIS2MDLManager(logger, i2c1)
114+
115+
imu = LSM6DSOXManager(logger, i2c1, 0x6B)
116+
103117
cdh = CommandDataHandler(config, logger, radio)
104118

105119
f = functions.functions(
@@ -156,9 +170,7 @@ def main():
156170

157171
f.listen_loiter()
158172

159-
f.all_face_data()
160173
watchdog.pet()
161-
f.send_face()
162174

163175
f.listen_loiter()
164176

pyproject.toml

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,31 @@
11
[project]
2-
name = "circuitpy-flight-software"
3-
version = "2.0.0"
4-
description = "Flight Software for the PROVES Kit"
2+
name = "proveskit-rp2350-v5a"
3+
version = "1.0.0"
4+
description = "Flight Software for the PROVES Kit RP2350 v5A"
55
readme = "README.md"
66
requires-python = ">=3.13"
77
dependencies = [
88
"adafruit-circuitpython-typing==1.11.2",
99
"circuitpython-stubs==9.2.5",
1010
"coverage==7.6.10",
1111
"pre-commit==4.0.1",
12+
"pyright[nodejs]==1.1.399",
1213
"pytest==8.3.2",
1314
]
1415

1516
[tool.ruff.format]
1617
# Use `\n` line endings for all files
1718
line-ending = "lf"
1819

19-
[tool.pytest.ini_options]
20-
pythonpath = "."
21-
markers = [
22-
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
20+
[tool.pyright]
21+
include = ["main.py", "boot.py", "repl.py", "safemode.py"]
22+
exclude = [
23+
"**/__pycache__",
24+
".venv",
25+
".git",
26+
"artifacts",
27+
"lib",
28+
"typings",
2329
]
24-
25-
[tool.coverage.run]
26-
branch = true
27-
relative_files = true
28-
29-
[tool.coverage.report]
30-
show_missing = true
31-
skip_covered = false
32-
include = [
33-
"lib/**/*.py",
34-
"boot.py",
35-
"main.py",
36-
"repl.py",
37-
"safemode.py",
38-
]
39-
omit = [
40-
"lib/adafruit_*/**",
41-
"lib/asyncio_*/**",
42-
"lib/rv3028*/**",
43-
"lib/neopixel.py",
44-
"lib/pysquared/**"
45-
]
46-
47-
[tool.coverage.html]
48-
directory = ".coverage-reports/html"
49-
50-
[tool.coverage.xml]
51-
output = ".coverage-reports/coverage.xml"
30+
stubPath = "./typings"
31+
reportMissingModuleSource = false

0 commit comments

Comments
 (0)