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

Fix I2C/COMD/OPCODE values #267

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Conversation

playfulFence
Copy link
Contributor

@playfulFence playfulFence commented Aug 13, 2024

Copy link
Contributor

@JurajSadel JurajSadel left a comment

Choose a reason for hiding this comment

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

Thanks!

@burrbull
Copy link
Contributor

Slightly confusing that you write one enum and then replace it with another.

@playfulFence
Copy link
Contributor Author

Honestly, I wasn't able to find information about how to edit some exact variant of enumeratedValues. If you could share it, I'd be grateful and will be happy to do it in a more elegant way.

But the reasoning behind the whole thing is simple: esp32 and esp32s2 have different OPCODE values than the rest of boards. Also in "original" version of SVD, so we need to patch all the chips anyway

@burrbull
Copy link
Contributor

I try to say that it is better to remove adding OPCODE from i2c0.yaml to avoid replacing.
esp32:

I2C0:
  COMD%s:
    OPCODE:
      Rstart: [0, RSTART opcode]
      Write: [1, WRITE opcode]
      Read: [2, READ opcode]
      Stop: [3, STOP opcode]
      End: [4, END opcode]
  _include:
    - ../../../common_patches/i2c0.yaml

esp32c6 and other:

I2C0:
  _include:
    - ../../../common_patches/i2c0.yaml
    - ../../../common_patches/i2c_opcode.yaml # contains default values

@playfulFence playfulFence merged commit 5270c86 into esp-rs:main Aug 13, 2024
11 checks passed
@MabezDev
Copy link
Member

I try to say that it is better to remove adding OPCODE from i2c0.yaml to avoid replacing. esp32:

I2C0:
  COMD%s:
    OPCODE:
      Rstart: [0, RSTART opcode]
      Write: [1, WRITE opcode]
      Read: [2, READ opcode]
      Stop: [3, STOP opcode]
      End: [4, END opcode]
  _include:
    - ../../../common_patches/i2c0.yaml

esp32c6 and other:

I2C0:
  _include:
    - ../../../common_patches/i2c0.yaml
    - ../../../common_patches/i2c_opcode.yaml # contains default values

I think the current approach is fine, new chips will more than likely have the default and we won't need to apply the patch at all on them

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.

4 participants