analogdevicesinc / TMC-API

TRINAMIC's IC API
MIT License
188 stars 83 forks source link

Documentation says user needs to implement wrong function for TMC4671 #27

Closed bigbrett closed 2 years ago

bigbrett commented 2 years ago

The documentation in README.md states:

To use the TMC-API, perform the following steps in your code:

  • Implement the tmcXXXX_readWriteArray() function in in your code. This function provides the necessary hardware access to the TMC-API.

But in the TMC4671 IC driver this function does not exist. Instead, it seems that the code wants you to implement tmc4671_readWriteByte()

// => SPI wrapper
extern uint8_t tmc4671_readwriteByte(uint8_t motor, uint8_t data, uint8_t lastTransfer);
// <= SPI wrapper

Additionally, looking at other ICs, each function has a differently named wrapper implementation. This should be made uniform, or at least documented to the user so they know where to look (e.g. "Every IC has a function prototype marked as extern that the user needs to implement in order for the driver to communicate with the chip...` or something like that).

trinamic-ed commented 2 years ago

Hi,

the use of the wrapper function for the TMC4671 is shown here in our Eval-System firmware:

https://github.com/trinamic/TMC-EvalSystem/blob/master/boards/TMC4671_eval.c

from line 60 onwards.

Best regards, Enrico

bigbrett commented 2 years ago

Yep thanks I see how it is intended to be used, I'm just pointing out that the documentation in the API README.md is incorrect

trinamic commented 2 years ago

Ok, thanks! We will update the Readme file.

pwfff commented 1 year ago

would be nice to see the README updated, confused the hell out of me too for the 2240