#ifndef MODBUS_MSP33_COMPAT_H_
#define MODBUS_MSP33_COMPAT_H_

#include "ti_msp_dl_config.h"
#include <ti/devices/msp/msp.h>
#include <ti/driverlib/driverlib.h>

/*
 * ModbusRTU.h in MSPM33 SDK v1.03.00.01 requires UART_Regs *,
 * but on the MSPM33 side, UART instances are handled as UNICOMM-based
 * peripherals, so the legacy type name UART_Regs is supplied here.
 *
 * ModbusRTU.c / ModbusRTU.h are not modified.
 */

/*
 * Define UNICOMM_Inst_Regs as an alias for UART_Regs.
 * When UART_0_INST is generated as UC13_0 / UC12 / UC1_0, etc.,
 * this alias allows ModbusRTU.h to resolve the type correctly.
 */
#ifndef MODBUS_MSP33_UART_REGS_ALIAS_DONE
typedef UNICOMM_Inst_Regs UART_Regs;
#define MODBUS_MSP33_UART_REGS_ALIAS_DONE
#endif

#endif /* MODBUS_MSP33_COMPAT_H_ */
