#include <stdint.h>

void timer2_init(void);
void modbus_master_init(void);
int8_t wait_receive(uint8_t len, uint16_t dest[], uint8_t timeout);
int8_t wait_write(uint8_t timeout);
void readReg(uint8_t slaveid, uint16_t address, uint8_t amount);
void writeReg(uint8_t slaveid, uint16_t address, uint16_t value);
void readInputReg(uint8_t slaveid, uint16_t address, uint16_t amount);
void readInputState(uint8_t slaveid, uint16_t address, uint16_t amount);
void writeCoil(uint8_t slaveid, uint16_t address, uint16_t value);
