#ifndef _MODBUS_MASTER_H_
#define _MODBUS_MASTER_H_

#include <stdint.h>

#define receiveOkay (modbusGetBusState() & (1<<ReceiveCompleted))

extern int32_t kraftsensor_value;
extern uint8_t kraftsensor_valid;

void timer2_init();
void kraftsensor_init();
void do_kraftsensor(void);
uint8_t wait_receive(uint8_t len, uint16_t dest[], 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);

#endif
