|
Lydia - Printhead
|
#include <inttypes.h>#include "Arduino.h"#include "Print.h"#include <SoftwareSerial.h>#include "enums.h"#include "./utils.h"Go to the source code of this file.
Classes | |
| class | Modbus |
| Arduino class library for communicating with Modbus devices over USB/RS232/485 (via RTU protocol). More... | |
| struct | modbus_t |
| Master query structure: This includes all the necessary fields to make the Master generate a Modbus query. A Master may keep several of these structures and send them cyclically or use them according to program needs. More... | |
Macros | |
| #define | MAX_BUFFER 64 |
| maximum size for the communication buffer in bytes More... | |
| #define | RS485_CLEAR_DE RS485_PORT_REG &= ~RS485_PIN_DE |
| #define | RS485_CLEAR_RE RS485_PORT_REG &= ~RS485_PIN_RE |
| #define | RS485_DIR_REG DDRJ |
| #define | RS485_PIN_DE 0b01000000 |
| #define | RS485_PIN_RE 0b00100000 |
| #define | RS485_PORT_REG PORTJ |
| #define | RS485_SET_DE RS485_PORT_REG |= RS485_PIN_DE |
| #define | RS485_SET_RE RS485_PORT_REG |= RS485_PIN_RE |
| #define | T35 5 |
Enumerations | |
| enum | { RESPONSE_SIZE = 6, EXCEPTION_SIZE = 3, CHECKSUM_SIZE = 2 } |
| enum | { NO_REPLY = 255, EXC_FUNC_CODE = 1, EXC_ADDR_RANGE = 2, EXC_REGS_QUANT = 3, EXC_EXECUTE = 4 } |
| enum | COM_STATES { COM_IDLE = 0, COM_WAITING = 1 } |
| enum | ERR_LIST { ERR_NOT_MASTER = -1, ERR_POLLING = -2, ERR_BUFF_OVERFLOW = -3, ERR_BAD_CRC = -4, ERR_EXCEPTION = -5 } |
| enum | MESSAGE { ID = 0, FUNC, ADD_HI, ADD_LO, NB_HI, NB_LO, BYTE_CNT } |
| Indexes to telegram frame positions. More... | |
Variables | |
| const unsigned char | fctsupported [] |
@description Arduino library for communicating with Modbus devices over RS232/USB/485 via RTU protocol.
Further information: http://modbus.org/ http://modbus.org/docs/Modbus_over_serial_line_V1_02.pdf
@license This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file ModbusRtu.h.
| #define MAX_BUFFER 64 |
maximum size for the communication buffer in bytes
Definition at line 57 of file ModbusRtu.h.
| #define RS485_CLEAR_DE RS485_PORT_REG &= ~RS485_PIN_DE |
Definition at line 51 of file ModbusRtu.h.
| #define RS485_CLEAR_RE RS485_PORT_REG &= ~RS485_PIN_RE |
Definition at line 52 of file ModbusRtu.h.
| #define RS485_DIR_REG DDRJ |
Definition at line 49 of file ModbusRtu.h.
| #define RS485_PIN_DE 0b01000000 |
Definition at line 47 of file ModbusRtu.h.
| #define RS485_PIN_RE 0b00100000 |
Definition at line 48 of file ModbusRtu.h.
| #define RS485_PORT_REG PORTJ |
Definition at line 50 of file ModbusRtu.h.
| #define RS485_SET_DE RS485_PORT_REG |= RS485_PIN_DE |
Definition at line 53 of file ModbusRtu.h.
| #define RS485_SET_RE RS485_PORT_REG |= RS485_PIN_RE |
Definition at line 54 of file ModbusRtu.h.
| #define T35 5 |
Definition at line 56 of file ModbusRtu.h.
| anonymous enum |
| Enumerator | |
|---|---|
| RESPONSE_SIZE | |
| EXCEPTION_SIZE | |
| CHECKSUM_SIZE | |
Definition at line 79 of file ModbusRtu.h.
| anonymous enum |
| Enumerator | |
|---|---|
| NO_REPLY | |
| EXC_FUNC_CODE | |
| EXC_ADDR_RANGE | |
| EXC_REGS_QUANT | |
| EXC_EXECUTE | |
Definition at line 126 of file ModbusRtu.h.
| enum COM_STATES |
| Enumerator | |
|---|---|
| COM_IDLE | |
| COM_WAITING | |
Definition at line 111 of file ModbusRtu.h.
| enum ERR_LIST |
| Enumerator | |
|---|---|
| ERR_NOT_MASTER | |
| ERR_POLLING | |
| ERR_BUFF_OVERFLOW | |
| ERR_BAD_CRC | |
| ERR_EXCEPTION | |
Definition at line 117 of file ModbusRtu.h.
| enum MESSAGE |
Indexes to telegram frame positions.
Definition at line 91 of file ModbusRtu.h.
| const unsigned char fctsupported[] |
Definition at line 135 of file ModbusRtu.h.