-
Notifications
You must be signed in to change notification settings - Fork 46
Description
The title pretty much says it all. I know I can get the DIAG status from the physical pin, but I'd like to save a GPIO pin on my microcontroller if I can. Lots of other status bits have their own methods, but for some reason DIAG isn't one of them. I tried using the read() method but it is private, as are all the related variables.... Presumably I could create my own version of the library, but I'd rather not start a branch!
The code that resulted in the compiler errors below is:
TMC2209::Input input;
input.bytes = TMC_driver.read(TMC2209::ADDRESS_IOIN);
Compiler errors:
/[redacted]Arduino/TMC2209_Config_Tool/TMC2209_Config_Tool.ino: In function 'void loop()':
/[redacted]Arduino/TMC2209_Config_Tool/TMC2209_Config_Tool.ino:179:16: error: 'union TMC2209::Input' is private within this context
179 | TMC2209::Input input;
| ^~~~~
In file included from /[redacted]Arduino/TMC2209_Config_Tool/TMC2209_Config_Tool.ino:2:
/[redacted]Arduino/libraries/TMC2209/src/TMC2209.h:376:9: note: declared private here
376 | union Input
| ^~~~~
/[redacted]Arduino/TMC2209_Config_Tool/TMC2209_Config_Tool.ino:180:46: error: 'const uint8_t TMC2209::ADDRESS_IOIN' is private within this context
180 | input.bytes = TMC_driver.read(TMC2209::ADDRESS_IOIN);
| ^~~~~~~~~~~~
/[redacted]Arduino/libraries/TMC2209/src/TMC2209.h:375:24: note: declared private here
375 | const static uint8_t ADDRESS_IOIN = 0x06;
| ^~~~~~~~~~~~
/[redacted]Arduino/TMC2209_Config_Tool/TMC2209_Config_Tool.ino:180:36: error: 'uint32_t TMC2209::read(uint8_t)' is private within this context
180 | input.bytes = TMC_driver.read(TMC2209::ADDRESS_IOIN);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/[redacted]Arduino/libraries/TMC2209/src/TMC2209.h:606:12: note: declared private here
606 | uint32_t read(uint8_t register_address);
| ^~~~