
#ifndef ETHERCAT_SLAVE_STARTUP_H
#define ETHERCAT_SLAVE_STARTUP_H

#include "../ethercat_types.h"
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef DYNAMIC_LOAD

int      AddStartupParameter(uint16_t master_index, uint16_t slave_index,
                              const ec_startup_param_t* param);
int      AddStartupParameterBatch(uint16_t master_index, uint16_t slave_index,
                                   const ec_startup_param_t* params, int count);
int      ClearStartupParameters(uint16_t master_index, uint16_t slave_index);
int      GetStartupParameterCount(uint16_t master_index, uint16_t slave_index);
int      ApplyStartupParameters(uint16_t master_index, uint16_t slave_index,
                                 uint8_t transition, uint8_t timing);
int      ApplyStartupParametersAll(uint16_t master_index, uint8_t transition, uint8_t timing);

int      EnumerateDefaultPdo(uint16_t master_index, uint16_t slave_index,
                              int direction,
                              uint16_t* out_indices, int max_count);

int EcEsi_GetDevicePdoIndices(uint16_t master_index, uint16_t slave_index,
                               int direction,
                               uint16_t* out_indices, int max_count);

int EcEsi_GetDevicePdoSizeBits(uint16_t master_index, uint16_t slave_index,
                                uint16_t pdo_index);

int EcEsi_GetDeviceSmInfo(uint16_t master_index, uint16_t slave_index, uint8_t sm_idx,
                          uint16_t* start_addr, uint16_t* default_len, uint8_t* control_byte);

int EcEsi_GetDeviceDcSyncMode(uint16_t master_index, uint16_t slave_index);

int EcEsi_GetDeviceMailboxTimeout(uint16_t master_index, uint16_t slave_index,
                                   int* request_ms, int* response_ms);

int EcEsi_GetDeviceIdentity(uint16_t master_index, uint16_t slave_index,
                             uint32_t* vendor_id, uint32_t* product_code,
                             uint32_t* revision_no, char* name_buf, int name_buf_size);

#endif

#ifdef __cplusplus
}
#endif

#endif
