harp-tech / protocol

Description of the Harp protocol.
https://harp-tech.org/protocol/BinaryProtocol-8bit.html
MIT License
3 stars 5 forks source link

Refactor `Version` registers #44

Open bruno-f-cruz opened 3 months ago

bruno-f-cruz commented 3 months ago

Summary

Deprecate the current way to store information regarding the version of hardware, firmware and core in favor of a single register.

Motivation

The current registers 01-07 are used to version hardware, application firmware and harp core. We are moving into a direction where we will additionally need to keep track of the protocol spec as the harp core and its implementation will now diverge given how we support two parallel core hardware implementations (rp2040 and atmega). Since we need to add a new register, I propose we start deprecating the current ones in favor of a single register that stores all this information.

Detailed Design

Deprecate all current registers and add a new one with the following specs:

Register: Name: Version Type: U8 Access: Read Length: 15 PayloadSpec: HarpProtocol[Major, minor, patch], CoreImplementation[Major, minor, patch], App[Major, minor, patch], Hardware[Major, minor, patch], Assembly[Major, minor, patch].

This has a huge benefit of all versions now being able to be read out with a single call.

Finally, until the deprecated registers are removed from the spec, the available information should be duplicated (in this case only Major and Minor versions)

Drawbacks

No real drawback as we will need to add a register anyway.

Alternatives

Adding a new register with the harp protocol version and keep all others as is.

Unresolved Questions

Design Meetings

bruno-f-cruz commented 2 months ago

Filipe suggests removing the assembly (probably deprecate the current register to be removed later). Probably gonna keep it just in case...

The current implementation register will duplicate the future register implementation version and NOT the core version