libethercat - an embeddable realtime EtherCAT-master library
Communicate with EtherCAT slaves attached to a Network interface.
Loading...
Searching...
No Matches
EEPROM (SII)

Data Structures

struct  ec_eeprom_cat_general
 
struct  ec_eeprom_cat_pdo_entry
 
struct  ec_eeprom_cat_pdo
 
struct  ec_eeprom_cat_sm
 eeprom sync manager settings More...
 
struct  ec_eeprom_cat_dc
 eeprom distributed clocks settings More...
 
struct  ec_eeprom_cat_fmmu
 eeporm fmmu description More...
 
struct  eeprom_info
 

Macros

#define EC_EEPROM_MBX_AOE   (0x01u)
 AoE mailbox support.
 
#define EC_EEPROM_MBX_EOE   (0x02u)
 EoE mailbox support.
 
#define EC_EEPROM_MBX_COE   (0x04u)
 CoE mailbox support.
 
#define EC_EEPROM_MBX_FOE   (0x08u)
 FoE mailbox support.
 
#define EC_EEPROM_MBX_SOE   (0x10u)
 SoE mailbox support.
 
#define EC_EEPROM_MBX_VOE   (0x20u)
 VoE mailbox support.
 
#define EC_EEPROM_ADR_VENDOR_ID   (0x0008u)
 offset vendor id
 
#define EC_EEPROM_ADR_PRODUCT_CODE   (0x000Au)
 offset product code
 
#define EC_EEPROM_ADR_BOOT_MBX_RECV_OFF   (0x0014u)
 offset mbx receive off
 
#define EC_EEPROM_ADR_BOOT_MBX_RECV_SIZE   (0x0015u)
 offset mbx receive size
 
#define EC_EEPROM_ADR_BOOT_MBX_SEND_OFF   (0x0016u)
 offset mbx send off
 
#define EC_EEPROM_ADR_BOOT_MBX_SEND_SIZE   (0x0017u)
 offset mbx send size
 
#define EC_EEPROM_ADR_STD_MBX_RECV_OFF   (0x0018u)
 offset boot mbx rcv off
 
#define EC_EEPROM_ADR_STD_MBX_RECV_SIZE   (0x0019u)
 offset boot mbx rcv size
 
#define EC_EEPROM_ADR_STD_MBX_SEND_OFF   (0x001Au)
 offset boot mbx send off
 
#define EC_EEPROM_ADR_STD_MBX_SEND_SIZE   (0x001Bu)
 offset boot mbx send size
 
#define EC_EEPROM_ADR_MBX_SUPPORTED   (0x001Cu)
 offset mailbox supported
 
#define EC_EEPROM_ADR_SIZE   (0x003Eu)
 offset eeprom size
 
#define EC_EEPROM_ADR_CAT_OFFSET   (0x0040u)
 offset start of categories
 
#define EC_EEPROM_CAT_NOP   ( 0u)
 category do nothing
 
#define EC_EEPROM_CAT_STRINGS   ( 10u)
 category strings
 
#define EC_EEPROM_CAT_DATATYPES   ( 20u)
 category datatypes
 
#define EC_EEPROM_CAT_GENERAL   ( 30u)
 category general
 
#define EC_EEPROM_CAT_FMMU   ( 40u)
 category fmmus
 
#define EC_EEPROM_CAT_SM   ( 41u)
 category sync managers
 
#define EC_EEPROM_CAT_TXPDO   ( 50u)
 category TXPDOs
 
#define EC_EEPROM_CAT_RXPDO   ( 51u)
 category RXPDOs
 
#define EC_EEPROM_CAT_DC   ( 60u)
 category distributed clocks
 
#define EC_EEPROM_CAT_END   (0xFFFFu)
 category end identifier
 

Typedefs

typedef struct PACKED ec_eeprom_cat_general ec_eeprom_cat_general_t
 
typedef struct PACKED ec_eeprom_cat_pdo_entry ec_eeprom_cat_pdo_entry_t
 
typedef struct ec_eeprom_cat_pdo ec_eeprom_cat_pdo_t
 
typedef struct PACKED ec_eeprom_cat_sm ec_eeprom_cat_sm_t
 eeprom sync manager settings
 
typedef struct PACKED ec_eeprom_cat_dc ec_eeprom_cat_dc_t
 eeprom distributed clocks settings
 
typedef struct PACKED ec_eeprom_cat_fmmu ec_eeprom_cat_fmmu_t
 eeporm fmmu description
 
typedef struct eeprom_info eeprom_info_t
 

Functions

 TAILQ_HEAD (ec_eeprom_cat_pdo_queue, ec_eeprom_cat_pdo)
 head to PDO queue
 
int ec_eeprom_to_pdi (struct ec *pec, osal_uint16_t slave)
 Set eeprom control to pdi.
 
int ec_eeprom_to_ec (struct ec *pec, osal_uint16_t slave)
 Set eeprom control to ec.
 
int ec_eepromread (struct ec *pec, osal_uint16_t slave, osal_uint32_t eepadr, osal_uint32_t *data)
 Read 32-bit word of eeprom.
 
int ec_eepromwrite (struct ec *pec, osal_uint16_t slave, osal_uint32_t eepadr, osal_uint16_t *data)
 Write 32-bit word to eeprom.
 
int ec_eepromread_len (struct ec *pec, osal_uint16_t slave, osal_uint32_t eepadr, osal_uint8_t *buf, osal_size_t buflen)
 Read a burst of eeprom data.
 
int ec_eepromwrite_len (struct ec *pec, osal_uint16_t slave, osal_uint32_t eepadr, const osal_uint8_t *buf, osal_size_t buflen)
 Write a burst of eeprom data.
 
void ec_eeprom_dump (struct ec *pec, osal_uint16_t slave)
 Read out whole eeprom and categories and store in EtherCAT master structure.
 

Detailed Description

This modules contains EtherCAT SII functions for EEPROM access.

Function Documentation

◆ ec_eeprom_dump()

void ec_eeprom_dump ( struct ec pec,
osal_uint16_t  slave 
)

Read out whole eeprom and categories and store in EtherCAT master structure.

Parameters
[in]pecPointer to EtherCAT master structure, which you got from ec_open.
[in]slaveNumber of EtherCAT slave. this depends on the physical order of the EtherCAT slaves (usually the n'th slave attached).
Return values
EC_OKOn success.
EC_ERROR_EEPROM_READ_ERRORRead error on EEPROM.
EC_ERROR_EEPROM_WRITE_IN_PROGRESSWrite on EEPROM is currently in progress.
EC_ERROR_EEPROM_WRITE_ENABLEEEPROM write is enabled.
EC_ERROR_EEPROM_CHECKSUMEEPROM checksum is wrong.

◆ ec_eeprom_to_ec()

int ec_eeprom_to_ec ( struct ec pec,
osal_uint16_t  slave 
)

Set eeprom control to ec.

Parameters
[in]pecPointer to EtherCAT master structure, which you got from ec_open.
[in]slaveNumber of EtherCAT slave. this depends on the physical order of the EtherCAT slaves (usually the n'th slave attached).
Return values
EC_OKOn success.
EC_ERROR_EEPROM_CONTROL_TO_ECError setting control to EC.

◆ ec_eeprom_to_pdi()

int ec_eeprom_to_pdi ( struct ec pec,
osal_uint16_t  slave 
)

Set eeprom control to pdi.

Parameters
[in]pecPointer to EtherCAT master structure, which you got from ec_open.
[in]slaveNumber of EtherCAT slave. this depends on the physical order of the EtherCAT slaves (usually the n'th slave attached).
Return values
EC_OKOn success.
EC_ERROR_EEPROM_CONTROL_TO_PDIError setting control to PDI.

◆ ec_eepromread()

int ec_eepromread ( struct ec pec,
osal_uint16_t  slave,
osal_uint32_t  eepadr,
osal_uint32_t *  data 
)

Read 32-bit word of eeprom.

Parameters
[in]pecPointer to EtherCAT master structure, which you got from ec_open.
[in]slaveNumber of EtherCAT slave. this depends on the physical order of the EtherCAT slaves (usually the n'th slave attached).
[in]eepadrAddress in eeprom where to read data.
[out]dataReturns read 32-bit data value.
Return values
EC_OKOn success.
EC_ERROR_EEPROM_READ_ERRORRead error on EEPROM.
EC_ERROR_EEPROM_WRITE_IN_PROGRESSWrite on EEPROM is currently in progress.
EC_ERROR_EEPROM_WRITE_ENABLEEEPROM write is enabled.
EC_ERROR_EEPROM_CHECKSUMEEPROM checksum is wrong.

◆ ec_eepromread_len()

int ec_eepromread_len ( struct ec pec,
osal_uint16_t  slave,
osal_uint32_t  eepadr,
osal_uint8_t *  buf,
osal_size_t  buflen 
)

Read a burst of eeprom data.

Parameters
[in]pecPointer to EtherCAT master structure, which you got from ec_open.
[in]slaveNumber of EtherCAT slave. this depends on the physical order of the EtherCAT slaves (usually the n'th slave attached).
[in]eepadrAddress in eeprom from where to read the data.
[out]bufData buffer where the read data will be copied.
[in]buflenLength of data buffer provided by user.
Return values
EC_OKOn success.
EC_ERROR_EEPROM_READ_ERRORRead error on EEPROM.
EC_ERROR_EEPROM_WRITE_IN_PROGRESSWrite on EEPROM is currently in progress.
EC_ERROR_EEPROM_WRITE_ENABLEEEPROM write is enabled.
EC_ERROR_EEPROM_CHECKSUMEEPROM checksum is wrong.

◆ ec_eepromwrite()

int ec_eepromwrite ( struct ec pec,
osal_uint16_t  slave,
osal_uint32_t  eepadr,
osal_uint16_t *  data 
)

Write 32-bit word to eeprom.

Parameters
[in]pecPointer to EtherCAT master structure, which you got from ec_open.
[in]slaveNumber of EtherCAT slave. this depends on the physical order of the EtherCAT slaves (usually the n'th slave attached).
[in]eepadrAddress in eeprom where to write data.
[out]data32-bit data value which will be written.
Return values
EC_OKOn success.
EC_ERROR_EEPROM_WRITE_ERRORWrite error on EEPROM.
EC_ERROR_EEPROM_WRITE_IN_PROGRESSWrite on EEPROM is currently in progress.
EC_ERROR_EEPROM_WRITE_ENABLEEEPROM write is enabled.
EC_ERROR_EEPROM_CHECKSUMEEPROM checksum is wrong.

◆ ec_eepromwrite_len()

int ec_eepromwrite_len ( struct ec pec,
osal_uint16_t  slave,
osal_uint32_t  eepadr,
const osal_uint8_t *  buf,
osal_size_t  buflen 
)

Write a burst of eeprom data.

Parameters
[in]pecPointer to EtherCAT master structure, which you got from ec_open.
[in]slaveNumber of EtherCAT slave. this depends on the physical order of the EtherCAT slaves (usually the n'th slave attached).
[in]eepadrAddress in eeprom from where to read the data.
[in]bufData buffer with provided data to write to EtherCAT slave's eeprom.
[in]buflenLength of data buffer provided by user.
Return values
EC_OKOn success.
EC_ERROR_EEPROM_WRITE_ERRORWrite error on EEPROM.
EC_ERROR_EEPROM_WRITE_IN_PROGRESSWrite on EEPROM is currently in progress.
EC_ERROR_EEPROM_WRITE_ENABLEEEPROM write is enabled.
EC_ERROR_EEPROM_CHECKSUMEEPROM checksum is wrong.