|
#define | MAX_FILE_NAME_SIZE 512u |
| file name max size
|
|
#define | MAX_ERROR_TEXT_SIZE 512u |
| error text max size
|
|
#define | EC_FOE_OP_CODE_READ_REQUEST 0x01u |
| read request
|
|
#define | EC_FOE_OP_CODE_WRITE_REQUEST 0x02u |
| write request
|
|
#define | EC_FOE_OP_CODE_DATA_REQUEST 0x03u |
| data request
|
|
#define | EC_FOE_OP_CODE_ACK_REQUEST 0x04u |
| acknowledge request
|
|
#define | EC_FOE_OP_CODE_ERROR_REQUEST 0x05u |
| error request
|
|
#define | EC_FOE_OP_CODE_BUSY_REQUEST 0x06u |
| busy request
|
|
#define | EC_FOE_ERROR_NOT_DEFINED 0x8000u |
| not defined
|
|
#define | EC_FOE_ERROR_NOT_FOUND 0x8001u |
| not found
|
|
#define | EC_FOE_ERROR_ACCESS_DENIED 0x8002u |
| access denied
|
|
#define | EC_FOE_ERROR_DISK_FULL 0x8003u |
| disk full
|
|
#define | EC_FOE_ERROR_ILLEGAL 0x8004u |
| illegal
|
|
#define | EC_FOE_ERROR_PACKET_NUMBER_WRONG 0x8005u |
| packed number wrong
|
|
#define | EC_FOE_ERROR_ALREADY_EXISTS 0x8006u |
| already exist
|
|
#define | EC_FOE_ERROR_NO_USER 0x8007u |
| no user
|
|
#define | EC_FOE_ERROR_BOOTSTRAP_ONLY 0x8008u |
| bootstrap access only
|
|
#define | EC_FOE_ERROR_NOT_BOOTSTRAP 0x8009u |
| not in bootstrap
|
|
#define | EC_FOE_ERROR_NO_RIGHTS 0x800Au |
| no access rights
|
|
#define | EC_FOE_ERROR_PROGRAM_ERROR 0x800Bu |
| program error
|
|
#define | EFW_CMD_IGNORE 0u |
| command ignore
|
|
#define | EFW_CMD_MEMORY_TRANSFER 1u |
| command memory transfer
|
|
#define | EFW_CMD_WRCODE 2u |
| command wrcode
|
|
#define | EFW_CMD_CHK_DEVID 3u |
| command check device id
|
|
#define | EFW_CMD_CHK_DEVICEID 3u |
| command check device id
|
|
#define | EFW_CMD_CHKSUM 4u |
| command checksum
|
|
#define | EFW_CMD_WRCODECHKSUM 5u |
| command wr code checksum
|
|
#define | EFW_CMD_SET_DEVID 6u |
| command set device id
|
|
#define | EFW_CMD_CHKSUMCHKSUM 6u |
| command checksum checksum
|
|
#define | EFW_CMD_BOOTCHKSUM 7u |
| command boot checksum
|
|
#define | EFW_CMD_SET_EEPROM 10u |
| command set eeprom
|
|
|
void | ec_foe_init (ec_t *pec, osal_uint16_t slave) |
| initialize FoE structure
|
|
void | ec_foe_deinit (ec_t *pec, osal_uint16_t slave) |
| deinitialize FoE structure
|
|
void | ec_foe_enqueue (ec_t *pec, osal_uint16_t slave, pool_entry_t *p_entry) |
| Enqueue FoE message received from slave.
|
|
int | ec_foe_read (ec_t *pec, osal_uint16_t slave, osal_uint32_t password, osal_char_t file_name[MAX_FILE_NAME_SIZE], osal_uint8_t **file_data, osal_size_t *file_data_len, const osal_char_t **error_message) |
| Read file over FoE.
|
|
int | ec_foe_write (ec_t *pec, osal_uint16_t slave, osal_uint32_t password, osal_char_t file_name[MAX_FILE_NAME_SIZE], osal_uint8_t *file_data, osal_size_t file_data_len, const osal_char_t **error_message) |
| Write file over FoE.
|
|
This modules contains EtherCAT FoE funcitons.
◆ ec_foe_deinit()
void ec_foe_deinit |
( |
ec_t * |
pec, |
|
|
osal_uint16_t |
slave |
|
) |
| |
deinitialize FoE structure
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
◆ ec_foe_enqueue()
Enqueue FoE message received from slave.
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
[in] | p_entry | Pointer to pool entry containing received mailbox message from slave. |
◆ ec_foe_init()
void ec_foe_init |
( |
ec_t * |
pec, |
|
|
osal_uint16_t |
slave |
|
) |
| |
initialize FoE structure
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
◆ ec_foe_read()
int ec_foe_read |
( |
ec_t * |
pec, |
|
|
osal_uint16_t |
slave, |
|
|
osal_uint32_t |
password, |
|
|
osal_char_t |
file_name[MAX_FILE_NAME_SIZE], |
|
|
osal_uint8_t ** |
file_data, |
|
|
osal_size_t * |
file_data_len, |
|
|
const osal_char_t ** |
error_message |
|
) |
| |
Read file over FoE.
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
[in] | password | FoE password for file to read. |
[in] | file_name | File name on EtherCAT slave to read from. |
[out] | file_data | This will be allocated by the ec_foe_read call and return the content of the EtherCAT slaves file. The caller must ensure to free the allocated memory. |
[out] | file_data_len | The length of the file and the allocated buffer file_data |
[out] | error_message | In error cases this will return the error message set by the EtherCAT slave. If any error has occured, this has to be freed by the caller. |
- Return values
-
EC_OK | On success. |
EC_ERROR_MAILBOX_NOT_SUPPORTED_FOE | FoE not supported by slave. |
EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERS | No more mailbox send buffers left. |
EC_ERROR_MAILBOX_FOE_AGAIN | Try again. |
EC_ERROR_MAILBOX_FOE_ERROR_REQ | Error on FoE request. |
◆ ec_foe_write()
int ec_foe_write |
( |
ec_t * |
pec, |
|
|
osal_uint16_t |
slave, |
|
|
osal_uint32_t |
password, |
|
|
osal_char_t |
file_name[MAX_FILE_NAME_SIZE], |
|
|
osal_uint8_t * |
file_data, |
|
|
osal_size_t |
file_data_len, |
|
|
const osal_char_t ** |
error_message |
|
) |
| |
Write file over FoE.
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
[in] | password | FoE password for file to write. |
[in] | file_name | File name on EtherCAT slave to write to. |
[out] | file_data | The caller has to provide the data which will be written as content of the file to the EtherCAT slave. |
[out] | file_data_len | The length of the file_data . |
[out] | error_message | In error cases this will return the error message set by the EtherCAT slave. If any error has occured, this has to be freed by the caller. |
- Return values
-
EC_OK | On success. |
EC_ERROR_MAILBOX_NOT_SUPPORTED_FOE | FoE not supported by slave. |
EC_ERROR_MAILBOX_OUT_OF_SEND_BUFFERS | No more mailbox send buffers left. |
EC_ERROR_MAILBOX_FOE_AGAIN | Try again. |
EC_ERROR_MAILBOX_FOE_ERROR_REQ | Error on FoE request. |
EC_ERROR_MAILBOX_FOE_NO_ACK | No Ack on segment write. |