11
This commit is contained in:
commit
53c85e94af
393 files changed
+141844
No files matched your search
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* smlpMaster.h
|
||||
*
|
||||
* Created on: Apr 15, 2025
|
||||
* Author: 18896
|
||||
*/
|
||||
|
||||
#ifndef SLMPMASTER_H_
|
||||
#define SLMPMASTER_H_
|
||||
|
||||
#define SLMP_HEAD_SIZE 9
|
||||
|
||||
typedef enum {
|
||||
slmp_read, slmp_readRxDone, slmp_write, slmp_writeRxDone,readySend
|
||||
} SLMPSTATUS;
|
||||
|
||||
typedef struct {
|
||||
uint8_t byte0;
|
||||
uint8_t byte1;
|
||||
uint8_t byte2;
|
||||
} uint24_t;
|
||||
|
||||
uint24_t u32_to_u24(uint32_t val);
|
||||
|
||||
typedef union {
|
||||
struct __attribute__((__packed__)){
|
||||
uint16_t header;
|
||||
uint16_t taget;
|
||||
uint16_t index;
|
||||
uint8_t subIdx;
|
||||
uint16_t requestSize;
|
||||
uint16_t timeout;
|
||||
uint16_t cmd;
|
||||
uint16_t subCmd;
|
||||
uint24_t start;
|
||||
uint8_t DM;
|
||||
uint16_t size;
|
||||
} frameStruct;
|
||||
uint8_t frameU8[21];
|
||||
} SMLPFrame;
|
||||
|
||||
|
||||
|
||||
extern SLMPSTATUS slmp_master_status;
|
||||
extern uint8_t readRespHeader[7];
|
||||
extern SMLPFrame frame;
|
||||
|
||||
uint16_t handleSMLP_ReadTX(uint32_t start, uint16_t size);
|
||||
|
||||
uint16_t handleSLMP_WriteTX(uint32_t start, uint16_t size);
|
||||
|
||||
#endif /* SLMPMASTER_H_ */
|
||||
Reference in new issue
Block a user