Petit Modbus 2.0
Loading...
Searching...
No Matches
PetitModbusPort.h File Reference

Go to the source code of this file.

Macros

#define PETIT_CRC_TABULAR   (0x4040)
 
#define PETIT_CRC_BITWISE   (0x2020)
 
#define PETIT_CRC_EXTERNAL   (0x9090)
 
#define PETIT_INTERNAL   (0x1333)
 
#define PETIT_BOTH   (0x1222)
 
#define PETIT_EXTERNAL   (0x2222)
 
#define PETIT_USER_LED_NONE   (0x7777)
 
#define PETIT_USER_LED_FN   (0x5555)
 
#define PETIT_USER_LED_DEF   (0x3333)
 
#define PetitLedSuc()
 
#define PetitLedErrFail()
 
#define PetitLedCrcFail()
 
#define PetitLedOff()
 

Functions

void PetitRxBufferReset (void)
 
pb_t PetitRxBufferInsert (pu8_t rcvd)
 
pb_t PetitTxBufferPop (pu8_t *tx)
 
void PetitPortTxBegin (pu8_t tx)
 
void PetitPortTimerStart (void)
 
void PetitPortTimerStop (void)
 
void PetitPortDirTx (void)
 
void PetitPortDirRx (void)
 

Variables

pu8_t PetitRegChange
 

Detailed Description

This is a file to support porting PetitModbus.

Definition in file PetitModbusPort.h.

Macro Definition Documentation

◆ PETIT_BOTH

#define PETIT_BOTH   (0x1222)

Definition at line 14 of file PetitModbusPort.h.

◆ PETIT_CRC_BITWISE

#define PETIT_CRC_BITWISE   (0x2020)

Definition at line 10 of file PetitModbusPort.h.

◆ PETIT_CRC_EXTERNAL

#define PETIT_CRC_EXTERNAL   (0x9090)

Definition at line 11 of file PetitModbusPort.h.

◆ PETIT_CRC_TABULAR

#define PETIT_CRC_TABULAR   (0x4040)

Definition at line 9 of file PetitModbusPort.h.

◆ PETIT_EXTERNAL

#define PETIT_EXTERNAL   (0x2222)

Definition at line 15 of file PetitModbusPort.h.

◆ PETIT_INTERNAL

#define PETIT_INTERNAL   (0x1333)

Definition at line 13 of file PetitModbusPort.h.

◆ PETIT_USER_LED_DEF

#define PETIT_USER_LED_DEF   (0x3333)

Definition at line 19 of file PetitModbusPort.h.

◆ PETIT_USER_LED_FN

#define PETIT_USER_LED_FN   (0x5555)

Definition at line 18 of file PetitModbusPort.h.

◆ PETIT_USER_LED_NONE

#define PETIT_USER_LED_NONE   (0x7777)

Definition at line 17 of file PetitModbusPort.h.

◆ PetitLedCrcFail

#define PetitLedCrcFail ( )

Definition at line 76 of file PetitModbusPort.h.

◆ PetitLedErrFail

#define PetitLedErrFail ( )

Definition at line 75 of file PetitModbusPort.h.

◆ PetitLedOff

#define PetitLedOff ( )

Definition at line 77 of file PetitModbusPort.h.

◆ PetitLedSuc

#define PetitLedSuc ( )

Definition at line 74 of file PetitModbusPort.h.

Function Documentation

◆ PetitRxBufferInsert()

pb_t PetitRxBufferInsert ( pu8_t  rcvd)
extern

Inserts bits into the buffer on device receive.

Parameters
[in]rcvdthe byte to insert into the buffer
Returns
bytes "left" to insert into buffer (1 if byte insertion failed)

Definition at line 75 of file PetitModbus.c.

◆ PetitRxBufferReset()

void PetitRxBufferReset ( void  )
extern

Reset the modbus buffer.

This function is called by the interrupt code that handles byte to byte time overrun. It is also called by the validation function to reject data that is not for this device before more system resources are taken.

Definition at line 62 of file PetitModbus.c.

◆ PetitTxBufferPop()

pb_t PetitTxBufferPop ( pu8_t tx)
extern

This function removes a byte from the buffer and places it on "tx" to be sent over rs485.

Parameters
[out]tx
Returns
1 if there is a byte to be sent, 0 otherwise if the buffer is empty

Definition at line 94 of file PetitModbus.c.

Variable Documentation

◆ PetitRegChange

pu8_t PetitRegChange
extern

Definition at line 47 of file PetitReg.c.