2025-04-16 22:51:39 +03:00
|
|
|
#ifndef REG_CAH_H_
|
|
|
|
#define REG_CAH_H_
|
|
|
|
|
|
|
|
#define APP_ADDR 0x0800400 // 16KB - Application
|
|
|
|
#define ADDR_VAR 0x8040000
|
|
|
|
|
|
|
|
|
|
|
|
#define REG_READ 0x07
|
|
|
|
#define REG_WRITE 0x08
|
|
|
|
|
|
|
|
|
|
|
|
/* Startup ID device */
|
|
|
|
#define START_ID 0x00
|
|
|
|
|
|
|
|
/* CAN REGISTER ID */
|
|
|
|
#define REG_ID 0x01
|
|
|
|
#define REG_BAUDRATE 0x02
|
|
|
|
|
|
|
|
#define REG_MOTOR_POSPID_Kp 0x30
|
|
|
|
#define REG_MOTOR_POSPID_Ki 0x31
|
|
|
|
#define REG_MOTOR_POSPID_Kd 0x32
|
|
|
|
|
|
|
|
#define REG_MOTOR_VELPID_Kp 0x40
|
|
|
|
#define REG_MOTOR_VELPID_Ki 0x41
|
|
|
|
#define REG_MOTOR_VELPID_Kd 0x42
|
|
|
|
|
|
|
|
#define REG_MOTOR_IMPPID_Kp 0x50
|
|
|
|
#define REG_MOTOR_IMPPID_Kd 0x51
|
|
|
|
|
|
|
|
#define REG_RESET 0x88
|
|
|
|
#define REG_LED_BLINK 0x8B
|
|
|
|
|
|
|
|
#define FOC_STATE 0x60
|
|
|
|
|
|
|
|
#define MOTOR_VELOCITY 0x70
|
|
|
|
#define MOTOR_ENABLED 0x71
|
|
|
|
#define MOTOR_ANGLE 0x72
|
|
|
|
#define MOTOR_TORQUE 0x73
|
|
|
|
|
2025-05-23 09:10:51 +03:00
|
|
|
#define FIRMWARE_UPDATE 0x55
|
2025-05-13 19:05:54 +03:00
|
|
|
|
|
|
|
//For send
|
|
|
|
#define CAN_MSG_MAX_LEN 7
|
|
|
|
#define CRC_SIZE 2
|
|
|
|
#define ID_SIZE sizeof(uint8_t)
|
|
|
|
|
|
|
|
|
2025-04-16 22:51:39 +03:00
|
|
|
#endif // REG_CAH_H_
|