sentry_chassis_hzz/modules/super_cap/super_cap.h

52 lines
1.0 KiB
C
Raw Permalink Normal View History

2022-12-05 15:59:47 +08:00
/*
* @Descripttion:
* @version:
2022-12-05 15:59:47 +08:00
* @Author: Chenfu
* @Date: 2022-12-02 21:32:47
* @LastEditTime: 2022-12-05 15:25:46
*/
#ifndef SUPER_CAP_H
#define SUPER_CAP_H
2022-12-05 15:59:47 +08:00
#include "bsp_can.h"
2023-01-01 17:32:22 +08:00
#pragma pack(1)
typedef struct
2022-12-05 15:59:47 +08:00
{
2023-01-01 17:32:22 +08:00
uint16_t vol; // 电压
uint16_t current; // 电流
uint16_t power; // 功率
} SuperCap_Msg_s;
2023-01-01 17:32:22 +08:00
#pragma pack()
2022-12-05 15:59:47 +08:00
2023-01-01 17:32:22 +08:00
/* 超级电容实例 */
2022-12-05 15:59:47 +08:00
typedef struct
{
2023-01-01 17:32:22 +08:00
CANInstance *can_ins; // CAN实例
SuperCap_Msg_s cap_msg; // 超级电容信息
2022-12-05 15:59:47 +08:00
} SuperCapInstance;
2023-01-01 17:32:22 +08:00
/* 超级电容初始化配置 */
2022-12-05 15:59:47 +08:00
typedef struct
{
CAN_Init_Config_s can_config;
2022-12-05 15:59:47 +08:00
} SuperCap_Init_Config_s;
2023-01-01 17:32:22 +08:00
/**
* @brief
*
* @param supercap_config
* @return SuperCapInstance*
*/
SuperCapInstance *SuperCapInit(SuperCap_Init_Config_s *supercap_config);
2022-12-05 15:59:47 +08:00
2023-01-01 17:32:22 +08:00
/**
* @brief
*
* @param instance
* @param data
*/
2022-12-05 15:59:47 +08:00
void SuperCapSend(SuperCapInstance *instance, uint8_t *data);
#endif // !SUPER_CAP_Hd