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

Some definitions are missing in TMC5272_HW_Abstraction.h compared to the data sheet #57

Open
chrislro2019 opened this issue Apr 12, 2024 · 1 comment

Comments

@chrislro2019
Copy link

I did not do a full review, but I stumbled over missing definitions in the header file compared to the data sheet. The header file should contain for all registers all field definitions as defined in the data sheet.

E.g.

#define TMC5272_ENCMODE_NBEMF_ABN_SEL_FIELD(motor) ((RegisterField) { TMC5272_ENCMODE_NBEMF_ABN_SEL_MASK, TMC5272_ENCMODE_NBEMF_ABN_SEL_SHIFT, TMC5272_ENCMODE(motor), false })
#define TMC5272_ENCMODE_BEMF_HYST_MASK 0x00007000
#define TMC5272_ENCMODE_BEMF_HYST_SHIFT 12
#define TMC5272_ENCMODE_BEMF_HYST_FIELD(motor) ((RegisterField) { TMC5272_ENCMODE_BEMF_HYST_MASK, TMC5272_ENCMODE_BEMF_HYST_SHIFT, TMC5272_ENCMODE(motor), false })
#define TMC5272_ENCMODE_BEMF_BLANK_TIME_MASK 0x00FF0000
#define TMC5272_ENCMODE_BEMF_BLANK_TIME_SHIFT 16
#define TMC5272_ENCMODE_BEMF_BLANK_TIME_FIELD(motor) ((RegisterField) { TMC5272_ENCMODE_BEMF_BLANK_TIME_MASK, TMC5272_ENCMODE_BEMF_BLANK_TIME_SHIFT, TMC5272_ENCMODE(motor), false })

lacks the definition for the fields:

  • qsc_enc_en
  • BEMF_FILTER_SEL

In addition - at least for the TMC5272 - the header file does not define field values as defined in the "Decode" column in the data sheet. This would be very helpful to have all of them in the header file as there are really a lot of them. E.g.:

#define TMC5272_ENCMODE_POL_B_NEGATIVE (0)
#define TMC5272_ENCMODE_POL_B_POSITIVE (1)
@chrislro2019
Copy link
Author

Also a goody would be the list of all register RESET values as defines.

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

No branches or pull requests

1 participant