first push
This commit is contained in:
1 parent
53c85e94af
commit
32f5ef9d3b
398 files changed
+1675
-140886
No files matched your search
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* rtuMaster.h
|
||||
*
|
||||
* Created on: Mar 26, 2026
|
||||
* Author: 18896
|
||||
*/
|
||||
|
||||
#ifndef RTUMASTER_H_
|
||||
#define RTUMASTER_H_
|
||||
|
||||
#define RE_SET HAL_GPIO_WritePin(re485_GPIO_Port, re485_Pin, GPIO_PIN_SET)
|
||||
#define RE_RESET HAL_GPIO_WritePin(re485_GPIO_Port, re485_Pin, GPIO_PIN_RESET)
|
||||
|
||||
typedef struct {
|
||||
uint16_t slave_id;
|
||||
uint16_t slave_address;
|
||||
uint16_t plc_address;
|
||||
uint16_t size;
|
||||
} rtumST;
|
||||
|
||||
typedef struct {
|
||||
uint8_t plc_type;
|
||||
_Bool isMaster;
|
||||
_Bool rxdone;
|
||||
uint16_t rxsize, txsize;
|
||||
uint16_t timeout;
|
||||
uint8_t rxbuf[255];
|
||||
uint8_t txbuf[255];
|
||||
uint16_t localSlaveId;
|
||||
uint16_t localStartIdx;
|
||||
} RtuMaster;
|
||||
|
||||
extern rtumST readST[10];
|
||||
extern rtumST writeST[10];
|
||||
extern rtumST myRtumST[20];
|
||||
extern RtuMaster master;
|
||||
|
||||
void initRtuMaster();
|
||||
void RTU_Master_Loop();
|
||||
|
||||
#endif /* RTUMASTER_H_ */
|
||||
Reference in new issue
Block a user