Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firmware #4

Merged
merged 19 commits into from
Oct 31, 2024
Merged

Firmware #4

merged 19 commits into from
Oct 31, 2024

Conversation

patricklatimer
Copy link
Collaborator

@patricklatimer patricklatimer commented Oct 8, 2024

  • Proper way to use events?
  • Do we need any other control registers?
  • WhoAmI?
  • Best place for device.yml?

firmware/src/main.cpp Outdated Show resolved Hide resolved
@Poofjunior
Copy link
Collaborator

Poofjunior commented Oct 9, 2024

For bare-bones Harp communication, this looks good. Delegating the bulk of the work to core1 is clever in that you don't need to rewrite the SPI transactions to non-blocking (i.e: cooperative multitasking) to keep up Harp communication.

I added a few in-line comments.

Additionally, let's plan to add:

  • an aggregate register of the 3 sensor values represented as a single register.
    • We need to use an array for now (promote pressure from U32 to Float) since Harp spec doesn't support registers pointing to structs
  • a periodic dispatch event, when new data from the sensor causes the device to dispatch a Harp EVENT message from the aggregate register.
  • a register to enable periodic sensor dispatch

@Poofjunior
Copy link
Collaborator

Delegating the bulk of the work to core1 is clever in that you don't need to rewrite the SPI transactions to non-blocking (i.e: cooperative multitasking) to keep up Harp communication.

Actually, on second thought we might need to consider getting this to run on just one core for heat-output reasons. Let's do a temperature check with the current implementation. If the heat change is noticeably higher, we might need to do a rewrite to just use one core.

@patricklatimer
Copy link
Collaborator Author

Ooh, still need WhoAmI, shouldn't forget to add that.

@bruno-f-cruz
Copy link
Contributor

bruno-f-cruz commented Oct 17, 2024

Ooh, still need WhoAmI, shouldn't forget to add that.

You can go ahead and use 1405 (I have registered it https://github.com/harp-tech/protocol/blob/41941a6f2dc4f49397946544d70aa5d9759a0ed8/whoami.yml#L173). Once you have a firmware you are happy with let me know and I can generate the bonsai interface and device.yml. Thanks!

@patricklatimer patricklatimer marked this pull request as ready for review October 23, 2024 19:03
@patricklatimer
Copy link
Collaborator Author

Okay, so I was going to finish some pyharp upgrades and python tests for this, but it sounds like I'm being pulled elsewhere and it isn't actually blocking the bonsai work so I'll call this ready for review and integration into bonsai if y'all approve.

firmware/src/main.cpp Outdated Show resolved Hide resolved
firmware/src/myspi.cpp Outdated Show resolved Hide resolved
@Poofjunior
Copy link
Collaborator

Ok overall, this looks great! Let's handle these in-line changes and go from there.

Also: that's a rad way to quickly spin up a Harp class for this device on the Python side. It would be super awesome to get it into pyharp eventually.

firmware/src/main.cpp Outdated Show resolved Hide resolved
@bruno-f-cruz
Copy link
Contributor

Ok overall, this looks great! Let's handle these in-line changes and go from there.

Also: that's a rad way to quickly spin up a Harp class for this device on the Python side. It would be super awesome to get it into pyharp eventually.

In case it's useful we are maintaining a parser for yml files here already https://github.com/harp-tech/harp-python/blob/main/harp/schema.py

firmware/src/main.cpp Outdated Show resolved Hide resolved
@patricklatimer
Copy link
Collaborator Author

Alright, I believe everything should be addressed. The python driver probably won't work without the new pyharp driver that handles events (AllenNeuralDynamics/pyharp#4) though.

Copy link
Collaborator

@Poofjunior Poofjunior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woot-woot! Thanks for making all the tweaks!

@Poofjunior Poofjunior merged commit 7d851f0 into main Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants