#ifndef __MODBUS_H
#define __MODBUS_H


//#define MB__DEBUG

#ifdef MB__DEBUG
#define MBDBG
#else
#define MBDBG if (0)
#endif


//
typedef enum 
{
    MB_NO_ACTION = 0,
    MB_CHANGE_ADDR,
    MB_CHANGE_PORT_SETTINGS,
    MB_DEF_SETTINGS,
    MB_PART_DEF_SETTINGS,
    MB_SAVE_SETTINGS,
    MB_SAVE_SYS_SETTINGS,
    MB_CHANGE_PWM_FREQ_1,
    MB_CHANGE_PWM_FREQ_2,
    MB_CHANGE_PWM_FREQ_3,
    MB_RESET,
    MB_PAS_OK,
    MB_PAS_ERR
  
} mb_delay_action_t ;


//
void mb_init(void);

//
void modbus_reset(void const * params);

//
void settings_timer(void const * params);

//
void modbus_port_timer(void const * params);

#endif // __MODBUS_H