sentry_gimbal_hzz/modules/motor/LK9025.h

38 lines
660 B
C
Raw Normal View History

2022-10-20 17:13:02 +08:00
#ifndef LK9025_H
#define LK9025_H
#include <stdint-gcc.h>
2022-10-20 17:13:02 +08:00
#include "bsp_can.h"
2022-10-20 21:14:17 +08:00
#include "controller.h"
#include "motor_def.h"
2022-10-20 17:13:02 +08:00
#define LK_MOTOR_CNT 2
#define I_MIN -2000
#define I_MAX 2000
typedef struct // 9025
2022-10-20 17:13:02 +08:00
{
uint16_t last_ecd;
uint16_t ecd;
int16_t speed_rpm;
int16_t given_current;
uint8_t temperate;
2022-10-20 21:14:17 +08:00
PIDInstance *pid;
CANInstance *motor_can_instance;
2022-10-20 21:14:17 +08:00
2022-10-20 17:13:02 +08:00
} driven_instance;
typedef enum
{
unused = 0,
} driven_mode;
driven_instance *LKMotroInit(CAN_Init_Config_s config);
2022-10-20 17:13:02 +08:00
void DrivenControl(int16_t motor1_current, int16_t motor2_current);
2022-10-20 17:13:02 +08:00
void SetDrivenMode(driven_mode cmd, uint16_t motor_id);
2022-10-20 17:13:02 +08:00
#endif // LK9025_H