#ifndef GRIFO_DOWN_CONVERTER_IF_H
#define GRIFO_DOWN_CONVERTER_IF_H

#include "grifo_ctrlink.h"

namespace grifo_fw
{

enum dc_board_t
{
    dc_0,
    dc_1,
    dc_2
};

enum dc_ad_ctrl_t
{
    dc_ad_operative,
    dc_ad_ramp_test,
    dc_ad_alignment,

    dc_ad_invalid_
};

extern int dc_append_status_request(ctrlink_blob_t* ld, dc_board_t board);

extern int dc_append_ad_control_message(ctrlink_blob_t* ld, dc_board_t board, dc_ad_ctrl_t mode);   //Always asynch?

extern int dc_append_sw_asynch_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int sw);
extern int dc_append_sw_operative_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int sw, ctrlink_pingpong_t mode=ctrlink_pingpong_auto);

extern int dc_append_stc_operative_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int num_values, const unsigned int* values, ctrlink_pingpong_t pingpong=ctrlink_pingpong_auto);
extern int dc_append_stc_asynch_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int values);

extern int dc_append_stc_operative_message_synch_send(ctrlink_blob_t* ld, dc_board_t board, unsigned int num_values, const unsigned int* values, ctrlink_pingpong_t pingpong=ctrlink_pingpong_auto);


extern int dc_append_nacg_asynch_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int ch0, unsigned int ch1, unsigned int ch2, unsigned int ch3);
extern int dc_append_nacg_asynch_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int ch[4]);
extern int dc_append_nacg_operative_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int num_values, const unsigned int* ch, ctrlink_pingpong_t pingpong=ctrlink_pingpong_auto); //ch array shal be at least num_values*4 items

extern int dc_append_frequency_operative_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int num_values, const unsigned int* frq /*[num_values]*/, ctrlink_pingpong_t pingpong=ctrlink_pingpong_auto);
extern int dc_append_frequency_asynch_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int frq);

extern int dc_append_test_port_command_message(ctrlink_blob_t* ld, dc_board_t board, unsigned int tp);

extern int dc_append_simple_test_pattern(ctrlink_blob_t* ld, dc_board_t board, unsigned int pattern, bool asynch=false);


}//namespace

#endif // GRIFO_DOWN_CONVERTER_IF_H
