forked from gary/BCU
2
0
Fork 0
BCU/app/stm32fxxx_app/protocol/protocol_comm.h

56 lines
1.7 KiB
C
Raw Normal View History

2024-11-26 15:52:49 +08:00
#ifndef PROTOCOL_COMM_H_
#define PROTOCOL_COMM_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "bsp_can.h"
#include "bsp_modbus.h"
#include "drv_can.h"
typedef void (*CanCommReceive)(CanMsg *msg, can_dev_e can);
typedef void (*CanCommPoll)(uint32_t base_time, can_dev_e can);
typedef void (*CanCommSend)(uint32_t base_time, can_dev_e can);
void protocol_comm_init(void);
void protocol_can_none_init(can_dev_e can);
void modbus_rtu_inter_handler(uint32_t base_time);
void modbus_rtu_extern_handler(uint32_t base_time);
2025-02-06 15:08:48 +08:00
void modbus_rtu_externII_handler(uint32_t base_time);
2024-11-26 15:52:49 +08:00
void protocol_exter2_modbus_poll(uint32_t base_time);
void protocol_can_poll(uint32_t base_time, can_dev_e can);
void protocol_can_set_call(can_dev_e can, CanCommReceive rx, CanCommSend tx, CanCommPoll poll);
void protocol_modbus_bcu_init(void * const mb_item,uint16_t addr);
void protocol_modbus_demo(void * const mb_item,uint16_t addr);
void protocol_can_bcu_init(can_dev_e can);
void protocol_can_invt_pcs_init(can_dev_e can);
void bms_analyse_model_data(void);
uint16_t bms_read_model_data(uint8_t *buf);
bool bms_write_model_data(uint8_t *buf, uint16_t len);
2025-02-06 15:08:48 +08:00
void protocol_w5500_modbus_tcp_server1_poll(uint32_t base_time);
void protocol_w5500_modbus_tcp_server2_poll(uint32_t base_time);
void protocol_w5500_modbus_tcp_server3_poll(uint32_t base_time);
void protocol_w5500_modbus_tcp_server4_poll(uint32_t base_time);
void protocol_w5500_modbus_tcp_server5_poll(uint32_t base_time);
void protocol_w5500_modbus_tcp_server6_poll(uint32_t base_time);
void protocol_w5500_modbus_tcp_server7_poll(uint32_t base_time);
void protocol_w5500_modbus_tcp_server8_poll(uint32_t base_time);
2024-11-26 15:52:49 +08:00
#ifdef __cplusplus
}
#endif
#endif