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.

29 lines
777 B

2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
  1. #include <stdint.h>
  2. #include "sdk\components\tmc\ic\ztmc4361A.hpp"
  3. #include "sdk\components\tmc\ic\ztmc5130.hpp"
  4. namespace iflytop {
  5. class Hardware {
  6. public:
  7. typedef enum { kcan, kuart } from_where_t;
  8. int32_t m_device_id = 0;
  9. public:
  10. void initialize(int deviceId);
  11. int32_t process_rx_packet(from_where_t fromwhere, uint8_t *packet, int32_t len, uint8_t *receipt, int32_t &receiptsize, bool &matching);
  12. void loop();
  13. TMC5130 *getMotor1();
  14. TMC5130 *getMotor2();
  15. void setmotor1(int16_t acc_rpm2, int16_t rpm, int16_t idlepower, int16_t power);
  16. void recovermotor1();
  17. bool ismotor1error();
  18. void setmotor2(int16_t acc_rpm2, int16_t rpm, int16_t idlepower, int16_t power);
  19. void recovermotor2();
  20. bool ismotor2error();
  21. };
  22. } // namespace iflytop