#pragma once

#include "myBase.h"
#include "lib60870_common.h"
#include "gb101.h"
#include "gb104.h"

#define MAX_IEC_NUM 3

#define IEC_BUF_SIZE 1024




typedef struct
{
    uint8_t rx[IEC_BUF_SIZE];
    uint8_t tx[IEC_BUF_SIZE];
    uint8_t pub[IEC_BUF_SIZE];
    uint8_t bak[IEC_BUF_SIZE];
}stru_60870_buf;

typedef struct 
{
    uint8_t is_busy;
    CS10x_Type iec_type;
    uint32_t interface;
    uint32_t tm_out;

    stru_60870_buf buf;
    CS10x cs10x;

}stru_iec_60870;


stru_iec_60870 *iec60870_get_by_interface(uint32_t interface);