diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-21 21:23:18 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-21 21:23:18 +0000 |
commit | d9714b556703561a0abcbe71970b1cd6922168a6 (patch) | |
tree | 70b7893243b8ee2e6b8b5fd95106c4ab962699c5 /apps/include/modbus/mb.h | |
parent | ebf70f8a79eb8ef23bc1d99938768ef06c466119 (diff) | |
download | px4-nuttx-d9714b556703561a0abcbe71970b1cd6922168a6.tar.gz px4-nuttx-d9714b556703561a0abcbe71970b1cd6922168a6.tar.bz2 px4-nuttx-d9714b556703561a0abcbe71970b1cd6922168a6.zip |
Use NuttX types in FreeModBus port; Add FreeModBus demo at apps/examples/modbus; Add new termios APIs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4964 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/include/modbus/mb.h')
-rw-r--r-- | apps/include/modbus/mb.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/apps/include/modbus/mb.h b/apps/include/modbus/mb.h index b534c178a..ed247d163 100644 --- a/apps/include/modbus/mb.h +++ b/apps/include/modbus/mb.h @@ -31,7 +31,8 @@ #ifndef _MB_H #define _MB_H -#include "port.h" +#include <stdint.h> +#include <stdbool.h> #ifdef __cplusplus PR_BEGIN_EXTERN_C @@ -121,7 +122,6 @@ typedef enum MB_ETIMEDOUT /*!< timeout error occurred. */ } eMBErrorCode; - /* ----------------------- Function prototypes ------------------------------*/ /*! \ingroup modbus * \brief Initialize the Modbus protocol stack. @@ -148,8 +148,8 @@ typedef enum * slave addresses are in the range 1 - 247. * - eMBErrorCode::MB_EPORTERR IF the porting layer returned an error. */ -eMBErrorCode eMBInit( eMBMode eMode, UCHAR ucSlaveAddress, - UCHAR ucPort, ULONG ulBaudRate, eMBParity eParity ); +eMBErrorCode eMBInit( eMBMode eMode, uint8_t ucSlaveAddress, + uint8_t ucPort, uint32_t ulBaudRate, eMBParity eParity ); /*! \ingroup modbus * \brief Initialize the Modbus protocol stack for Modbus TCP. @@ -165,7 +165,7 @@ eMBErrorCode eMBInit( eMBMode eMode, UCHAR ucSlaveAddress, * slave addresses are in the range 1 - 247. * - eMBErrorCode::MB_EPORTERR IF the porting layer returned an error. */ -eMBErrorCode eMBTCPInit( USHORT usTCPPort ); +eMBErrorCode eMBTCPInit( uint16_t usTCPPort ); /*! \ingroup modbus * \brief Release resources used by the protocol stack. @@ -228,7 +228,7 @@ eMBErrorCode eMBPoll( void ); * * \param ucSlaveID Values is returned in the <em>Slave ID</em> byte of the * <em>Report Slave ID</em> response. - * \param xIsRunning If TRUE the <em>Run Indicator Status</em> byte is set to 0xFF. + * \param xIsRunning If true the <em>Run Indicator Status</em> byte is set to 0xFF. * otherwise the <em>Run Indicator Status</em> is 0x00. * \param pucAdditional Values which should be returned in the <em>Additional</em> * bytes of the <em> Report Slave ID</em> response. @@ -238,9 +238,9 @@ eMBErrorCode eMBPoll( void ); * is too small it returns eMBErrorCode::MB_ENORES. Otherwise * it returns eMBErrorCode::MB_ENOERR. */ -eMBErrorCode eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning, - UCHAR const *pucAdditional, - USHORT usAdditionalLen ); +eMBErrorCode eMBSetSlaveID( uint8_t ucSlaveID, bool xIsRunning, + uint8_t const *pucAdditional, + uint16_t usAdditionalLen ); /*! \ingroup modbus * \brief Registers a callback handler for a given function code. @@ -262,7 +262,7 @@ eMBErrorCode eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning, * case the values in config.h should be adjusted. If the argument was not * valid it returns eMBErrorCode::MB_EINVAL. */ -eMBErrorCode eMBRegisterCB( UCHAR ucFunctionCode, +eMBErrorCode eMBRegisterCB( uint8_t ucFunctionCode, pxMBFunctionHandler pxHandler ); /* ----------------------- Callback -----------------------------------------*/ @@ -309,8 +309,8 @@ eMBErrorCode eMBRegisterCB( UCHAR ucFunctionCode, * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case * a <b>SLAVE DEVICE FAILURE</b> exception is sent as a response. */ -eMBErrorCode eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, - USHORT usNRegs ); +eMBErrorCode eMBRegInputCB( uint8_t * pucRegBuffer, uint16_t usAddress, + uint16_t usNRegs ); /*! \ingroup modbus_registers * \brief Callback function used if a <em>Holding Register</em> value is @@ -344,8 +344,8 @@ eMBErrorCode eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case * a <b>SLAVE DEVICE FAILURE</b> exception is sent as a response. */ -eMBErrorCode eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, - USHORT usNRegs, eMBRegisterMode eMode ); +eMBErrorCode eMBRegHoldingCB( uint8_t * pucRegBuffer, uint16_t usAddress, + uint16_t usNRegs, eMBRegisterMode eMode ); /*! \ingroup modbus_registers * \brief Callback function used if a <em>Coil Register</em> value is @@ -379,8 +379,8 @@ eMBErrorCode eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case * a <b>SLAVE DEVICE FAILURE</b> exception is sent as a response. */ -eMBErrorCode eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, - USHORT usNCoils, eMBRegisterMode eMode ); +eMBErrorCode eMBRegCoilsCB( uint8_t * pucRegBuffer, uint16_t usAddress, + uint16_t usNCoils, eMBRegisterMode eMode ); /*! \ingroup modbus_registers * \brief Callback function used if a <em>Input Discrete Register</em> value is @@ -408,8 +408,8 @@ eMBErrorCode eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, * - eMBErrorCode::MB_EIO If an unrecoverable error occurred. In this case * a <b>SLAVE DEVICE FAILURE</b> exception is sent as a response. */ -eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, - USHORT usNDiscrete ); +eMBErrorCode eMBRegDiscreteCB( uint8_t * pucRegBuffer, uint16_t usAddress, + uint16_t usNDiscrete ); #ifdef __cplusplus PR_END_EXTERN_C |