#pragma once
#include <stdint.h>

void initModbus();
void gererModbus();
void setIntervallesModbus(uint32_t jour_ms, uint32_t nuit_ms);
void getIntervallesModbus(uint32_t &jour_ms, uint32_t &nuit_ms);
bool reglerHorlogeEpever(uint16_t annee, uint8_t mois, uint8_t jour,
                         uint8_t heure, uint8_t minute, uint8_t seconde);

// Accès Modbus partagé (pour epever_config.cpp)
bool isModbusBusy();
bool modbusAcquire();
void modbusRelease();
bool modbusLireHolding(uint16_t reg, uint16_t qty, uint16_t *dest, uint16_t timeoutMs);
bool modbusEcrireHolding(uint16_t reg, uint16_t qty, const uint16_t *vals, uint16_t timeoutMs);
