Johann Fischer
f943a5581d
modbus: rework RS-485 transceiver DE,RE GPIO configuration
...
Follow modern way to configure DE,RE GPIO using
struct gpio_dt_spec.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
6394298960
modbus: add raw ADU support
...
MODBUS raw ADU support allows to implement
MODBUS messaging service over TCP or UDP.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
4ff616b647
modbus: rework interface configuration
...
Use commot parameter structure to configure server
or client interfaces.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
144a3a5ba2
modbus: return ETIMEDOUT on timeout instead of EIO
...
Return ETIMEDOUT on timeout instead of EIO.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
0bf4916efd
modbus: move some RX/TX ADU related code to the core
...
Let the core call the modbus_tx_adu() to make
the process more comprehensible.
Move tx-wait-for-rx handling outside of client code.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
e3c630d25f
modbus: rename internal designations and do few minor fixups
...
Prefix internal functions and structs with modbus_.
Use unit_id consistently instead of node_addr.
Fix mbm_ remainder and rename to mbc_.
Rename struct modbus_frame to modbus_adu since
ADU is closer to what the structure represents.
Let the compiler/linker do the job and
remove ifdef around mbc_validate_fc03fp_response().
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
669d3e9e91
modbus: make MODBUS support over serial line optional
...
Make MODBUS support over serial line optional.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
b132ab556c
modbus: move serial line config outside context
...
Move serial line config outside context.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
3ddb47cc43
modbus: move MODBUS over serial line code to own file
...
Move MODBUS over serial line code to own source file.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
19d0b474c1
modbus: use enum for MODBUS mode
...
Use enum for MODBUS mode.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
9792a6c43e
modbus: rename mb_rtu_ to modbus_
...
Rename mb_rtu_ to modbus_.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00