feat: update USART1 baud rate and implement IM1281B communication

This commit is contained in:
2025-03-29 22:37:31 +08:00
parent 98463aa9f1
commit 05668ca262
11 changed files with 1663 additions and 208 deletions

19
Core/Inc/IM1281B.h Normal file
View File

@ -0,0 +1,19 @@
//
// Created by Timothy Yin on 2025/3/29.
//
#ifndef IM1281B_H
#define IM1281B_H
#include "usart.h"
extern uint8_t IM_TxBuf[8];
extern uint8_t IM_RxBuf[40];
extern unsigned char IM_ReadFlag, IM_RecvDone, IM_RecvLen;
extern uint32_t IM_Volt, IM_Curr, IM_Power, IM_Energy, IM_PF, IM_CO2;
unsigned int Calc_CRC(unsigned char crc_buf, unsigned int crc);
unsigned int Check_CRC(const unsigned char *buf, unsigned char len);
void IM_Read(void);
void IM_Analyze(void);
#endif //IM1281B_H