wheel_legged/modules/super_cap/super_cap.h

54 lines
1.2 KiB
C
Raw Normal View History

2023-12-26 23:54:56 +08:00
#ifndef SUPER_CAP_H
#define SUPER_CAP_H
#include "bsp_can.h"
#pragma pack(1)
typedef struct
{
int16_t input_vol; // 输入电压
int16_t cap_vol; // 电容电压
int16_t input_cur; // 输入电流
int16_t power_set; // 设定功率
2023-12-26 23:54:56 +08:00
} SuperCap_Msg_s;
#pragma pack()
/* 超级电容实例 */
typedef struct
{
CANInstance *can_ins; // CAN实例
SuperCap_Msg_s cap_msg; // 超级电容信息
} SuperCapInstance;
/* 超级电容初始化配置 */
typedef struct
{
CAN_Init_Config_s can_config;
} SuperCap_Init_Config_s;
/**
* @brief
*
2023-12-26 23:54:56 +08:00
* @param supercap_config
* @return SuperCapInstance*
*/
SuperCapInstance *SuperCapInit(SuperCap_Init_Config_s *supercap_config);
/**
* @brief
*
2023-12-26 23:54:56 +08:00
* @param instance
* @param data
*/
void SuperCapSend(SuperCapInstance *instance, uint8_t *data);
/**
* @brief
*
* @param instance
* @param power_set
*/
void SuperCapSetPower(SuperCapInstance *instance, float power_set);
2023-12-26 23:54:56 +08:00
#endif // !SUPER_CAP_Hd