1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #ifndef _DLT645_PRIVATE_H
- #define _DLT645_PRIVATE_H
- #include "dlt645.h"
- #ifdef DLT645_DEBUG
- #define DLT645_LOG kprintf
- #else
- #define DLT645_LOG(...)
- #endif
- #define DL645_START_CODE 0x68
- #define DL645_STOP_CODE 0x16
- #define DL645_PREMBLE_ENABLE 0
- #define DL645_PREMBLE 0xFE
- #define DL645_ADDR_LEN 6
- #define DL645_CONTROL_POS 8
- #define DL645_LEN_POS 9
- #define DL645_DATA_POS 10
- #define DL645_WR_LEN 50
- #define DL645_RESP_LEN 60
- #define C_TD_MASK 0x80
- #define C_TD_POS 7
- #define C_TD_MASTER 0
- #define C_TD_SLAVE 1
- #define C_ACK_MASK 0x40
- #define C_ACK_POS 6
- #define C_ACK_OK 0
- #define C_ACK_ERR 1
- #define C_FU_MASK 0x20
- #define C_FU_POS 5
- #define C_FU_NONE 0
- #define C_FU_EXT 1
- #define C_CODE_MASK 0x1F
- extern int dlt645_common_check(uint8_t *msg, int len, uint8_t *addr);
- extern int _crc(uint8_t *msg, int len);
- extern int dlt645_receive_msg(dlt645_t *ctx, uint8_t *msg, uint16_t len, uint32_t code, dlt645_protocal protocal);
- extern int dlt645_send_msg(dlt645_t *ctx, uint8_t *msg, int len);
- extern int data_package_translate_to_int(uint8_t *read_data, uint16_t len);
- extern int dlt645_data_parse_by_format_to_float(uint8_t *read_data, uint16_t read_len, const char *data_format, uint8_t *store_address);
- #endif
|