# modbuv v0.1.0 - API Reference

## Modules

- [Modbuv.CRC](Modbuv.CRC.md): CRC16/MODBUS calculation.

- [Modbuv.Codec](Modbuv.Codec.md): Modbus PDU encoding and decoding. A PDU is `<<fc, body::binary>>`; slave/unit
ids, CRC, and MBAP live in the transport layers.

- [Modbuv.FcMap](Modbuv.FcMap.md): Server/Slave function-code registry: maps a numeric function code to the
direction, data width, address region, and (for writes) single/multi layout.

- [Modbuv.IEEE754](Modbuv.IEEE754.md): IEEE754 float helper. `:be` keeps the first register as the high word;
`:le` swaps the two words.

- [Modbuv.Model](Modbuv.Model.md): Pure functions over the Server/Slave DB:
`%{slave_id => %{{region, address} => value}}`.

- [Modbuv.Model.Shared](Modbuv.Model.Shared.md): Agent that holds the Server/Slave DB.

- [Modbuv.Rtu](Modbuv.Rtu.md): Modbus RTU ADU framing: `<<slave, pdu, crc::little-16>>`.

- [Modbuv.Rtu.Framer](Modbuv.Rtu.Framer.md): Circuits.UART framer for Modbus RTU slave traffic. It accumulates bytes,
derives the expected length from the fc_map, validates CRC, and resyncs
byte-by-byte when a candidate is invalid.

- [Modbuv.Rtu.Master](Modbuv.Rtu.Master.md): Modbus RTU master. Reads raw UART bytes and frames replies from the request
currently in flight. Only one request may be in flight at a time.

- [Modbuv.Rtu.Slave](Modbuv.Rtu.Slave.md): Modbus RTU slave. The UART runs with `Modbuv.Rtu.Framer` in active mode;
complete frames are decoded, applied to the shared DB, and answered.

- [Modbuv.Tcp](Modbuv.Tcp.md): Modbus TCP ADU framing: MBAP header plus the Codec PDU.

- [Modbuv.Tcp.Client](Modbuv.Tcp.Client.md): Modbus TCP client. In passive mode `request/2` followed by `confirmation/1`
returns the result synchronously; in active mode responses are sent to
`d_pid` as `{:modbuv_tcp, frame, result}`.

- [Modbuv.Tcp.Server](Modbuv.Tcp.Server.md): Modbus TCP server: listens on a port, serves each connection from the shared
DB, and optionally notifies the owner of parsed requests.

- [Modbuv.Telemetry](Modbuv.Telemetry.md): Telemetry instrumentation for `Modbuv.Tcp.Client` and `Modbuv.Rtu.Master`
requests.

