libethercat - an embeddable realtime EtherCAT-master library
Communicate with EtherCAT slaves attached to a Network interface.
Loading...
Searching...
No Matches
eeprom.h File Reference

EtherCAT eeprom access fuctions. More...

#include <libosal/queue.h>
#include <libosal/types.h>
#include "libethercat/common.h"

Go to the source code of this file.

Data Structures

struct  ec_eeprom_cat_general
 
struct  ec_eeprom_cat_pdo_entry
 
struct  ec_eeprom_cat_pdo
 
struct  ec_eeprom_cat_pdo::PACKED
 
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_CAT_PDO_LEN   (osal_size_t)8u
 
#define EC_EEPROM_CAT_DC_LEN   (osal_size_t)25u
 
#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

EtherCAT eeprom access fuctions.

Author
Robert Burger rober.nosp@m.t.bu.nosp@m.rger@.nosp@m.dlr..nosp@m.de
Date
24 Nov 2016

These functions are used to ensure access to the EtherCAT slaves EEPROM.