wheel_legged_gimbal/modules/power_meter/power_meter.h

40 lines
860 B
C
Raw Normal View History

//
// Created by SJQ on 2023/12/19.
//
#ifndef BASIC_FRAMEWORK_POWER_METER_H
#define BASIC_FRAMEWORK_POWER_METER_H
#include "bsp_can.h"
#pragma pack(1)
typedef struct
{
uint16_t vol; // 电压
uint16_t current; // 电流
} PowerMeter_Msg_s;
#pragma pack()
/* 超级电容实例 */
typedef struct
{
CANInstance *can_ins; // CAN实例
PowerMeter_Msg_s power_msg; // 功率计反馈信息
} PowerMeterInstance;
/* 超级电容初始化配置 */
typedef struct
{
CAN_Init_Config_s can_config;
} PowerMeter_Init_Config_s;
/**
* @brief
*
* @param PowerMeter_config
* @return PowerMeterInstance*
*/
PowerMeterInstance *PowerMeterInit(PowerMeter_Init_Config_s *PowerMeter_config);
float PowerMeterGet(PowerMeterInstance *instance);
#endif //BASIC_FRAMEWORK_POWER_METER_H