1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef __NODE_MESSAGE_H
- #define __NODE_MESSAGE_H
- #include "stm32f2xx.h"
- #define slave
- #ifdef slave
- #define MODBUS_WRITE 4
- #define MODBUS_READ 3
- #define DLT645_07 2
- #define DLT645_97 1
- typedef struct _NODE_DLT645_PARAMS
- {
- uint32_t dataType645;
- uint8_t deviceType645[6];
- uint8_t datalength;
- uint8_t value[10];
- uint8_t rxLen;
- }NODE_DLT645_PARAMS;
- typedef struct _NODE_MODBUS_READ
- {
- uint8_t slaveAddress;
- uint8_t functionCode;
- uint16_t registerAddress;
- uint16_t registerLength;
- uint8_t dataType;
- uint8_t precision;
- uint8_t bigLittleFormat;
- uint8_t flag;
- uint8_t callback[4];
- uint8_t rxLen;
- }NODE_MODBUS_READ;
- typedef struct _NODE_MODBUS_WRITE
- {
- uint8_t slaveAddress;
- uint8_t functionCode;
- uint8_t dataType;
- uint16_t registerAddress;
- uint16_t registerLength;
- uint8_t bigLittleFormat;
- uint8_t flag;
- }NODE_MODBUS_WRITE;
- typedef struct _PARAMS
- {
- uint8_t protcol;
- NODE_DLT645_PARAMS *dlt645_params;
- NODE_MODBUS_READ *modbus_read;
- NODE_MODBUS_WRITE *modbus_write;
- }PARAMS;
- typedef struct _NODE_DEVICE_PARAMS
- {
- uint8_t Index;
- PARAMS params[20];
- }NODE_DEVICE_PARAMS;
- NODE_DEVICE_PARAMS *get_node_receive_params();
- void free_all_node_params();
- extern uint8_t protocol_485;
- #endif
- #endif
|