first push

This commit is contained in:
claw committed 2026-04-02 17:52:12 +08:00
1 parent 53c85e94af
commit 32f5ef9d3b
398 files changed
+1675 -140886

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
/*
* 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_ */