36 lines
626 B
C
36 lines
626 B
C
/*
|
|
* communication_protocol.h
|
|
*
|
|
* Created on: 2024年5月18日
|
|
* Author: 34509
|
|
*/
|
|
|
|
#ifndef SOFTWARE_PROTOCOL_COMMUNICATION_PROTOCOL_H_
|
|
#define SOFTWARE_PROTOCOL_COMMUNICATION_PROTOCOL_H_
|
|
|
|
#include "UART.h"
|
|
|
|
/* 功能码类型 */
|
|
#define read_Register 0x30
|
|
#define write_Register 0x10
|
|
#define broadcast_Scan 0xA0
|
|
#define reg_Req 0xA1
|
|
|
|
/* 起始标志 */
|
|
#define StartFlag "SL"
|
|
/* 结束标志 */
|
|
#define EndFlag 0x16
|
|
|
|
/* 广播ID */
|
|
#define broadcast_ID 0xFFFFFFFFFFFF
|
|
|
|
#define max_Len 32
|
|
|
|
extern uint8_t protocol[max_Len];
|
|
|
|
|
|
void broadcast_Scan_Fun(USART_TypeDef* pUSARTx);
|
|
|
|
|
|
#endif /* SOFTWARE_PROTOCOL_COMMUNICATION_PROTOCOL_H_ */
|