You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

2 years ago
2 years ago
2 years ago
  1. /*
  2. * Config.h
  3. *
  4. * Created on: 13.06.2018
  5. * Author: LK
  6. */
  7. #ifndef TMC_HELPERS_CONFIG_H_
  8. #define TMC_HELPERS_CONFIG_H_
  9. #include "Constants.h"
  10. #include "Types.h"
  11. // Callback functions have IC-dependent parameters
  12. // To store the function pointers we use this dummy type, which is never
  13. // called without casting it to the IC-specific type first.
  14. // (Casting between function pointers is allowed by the C standard)
  15. typedef void (*tmc_callback_config)(void);
  16. // States of a configuration
  17. typedef enum {
  18. CONFIG_READY,
  19. CONFIG_RESET,
  20. CONFIG_RESTORE
  21. } ConfigState;
  22. // structure for configuration mechanism
  23. typedef struct
  24. {
  25. ConfigState state;
  26. uint8_t configIndex;
  27. int32_t shadowRegister[TMC_REGISTER_COUNT];
  28. uint8_t (*reset) (void); // tmc-ic ������������������ by:zhaohe
  29. uint8_t (*restore) (void); // tmc-ic ������������������ by:zhaohe
  30. tmc_callback_config callback;
  31. uint8_t channel;
  32. } ConfigurationTypeDef;
  33. #endif /* TMC_HELPERS_CONFIG_H_ */