nanoMODBUS is a small C library that implements the Modbus protocol. It is especially useful in resource-constrained system like microcontrollers.
GtiHub: https://github.com/debevv/nanoMODBUS
API reference: nanomodbus.h