32 lines
689 B
C
32 lines
689 B
C
#ifndef __MB_RTU_H__
|
|
#define __MB_RTU_H__
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include "mb.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
eMBErrorCode eMBRTUInit (rt_uint8_t slaveAddress, rt_uint8_t ucPort,
|
|
rt_uint32_t ulBaudRate, eMBParity eParity);
|
|
void eMBRTUStart (void);
|
|
void eMBRTUStop (void);
|
|
eMBErrorCode eMBRTUReceive (rt_uint8_t * pucRcvAddress, rt_uint8_t ** pucFrame, rt_uint16_t * pusLength);
|
|
eMBErrorCode eMBRTUSend (rt_uint8_t slaveAddress, const rt_uint8_t * pucFrame, rt_uint16_t usLength);
|
|
rt_uint8_t xMBRTUReceiveFSM (void);
|
|
rt_uint8_t xMBRTUTransmitFSM (void);
|
|
|
|
rt_uint8_t xMBRTUTimerT35Expired (void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|