Ethernet over EtherCAT (EoE) module. More...
Go to the source code of this file.
Functions | |
int | ecx_EOEdefinehook (ecx_contextt *context, void *hook) |
int | ecx_EOEgetIp (ecx_contextt *context, uint16 slave, uint8 port, eoe_param_t *ipparam, int timeout) |
int | ecx_EOEreadfragment (ec_mbxbuft *MbxIn, uint8 *rxfragmentno, uint16 *rxframesize, uint16 *rxframeoffset, uint16 *rxframeno, int *psize, void *p) |
int | ecx_EOErecv (ecx_contextt *context, uint16 slave, uint8 port, int *psize, void *p, int timeout) |
int | ecx_EOEsend (ecx_contextt *context, uint16 slave, uint8 port, int psize, void *p, int timeout) |
int | ecx_EOEsetIp (ecx_contextt *context, uint16 slave, uint8 port, eoe_param_t *ipparam, int timeout) |
static void | EOE_ip_byte_to_uint32 (uint8_t *byte_ip, eoe_ip4_addr_t *ip) |
static void | EOE_ip_uint32_to_byte (eoe_ip4_addr_t *ip, uint8_t *byte_ip) |
Ethernet over EtherCAT (EoE) module.
Set / Get IP functions Blocking send/receive Ethernet Frame Read incoming EoE fragment to Ethernet Frame
Definition in file ethercateoe.c.
int ecx_EOEdefinehook | ( | ecx_contextt * | context, |
void * | hook | ||
) |
EoE fragment data handler hook. Should not block.
[in] | context | = context struct |
[in] | hook | = Pointer to hook function. |
Definition at line 52 of file ethercateoe.c.
int ecx_EOEgetIp | ( | ecx_contextt * | context, |
uint16 | slave, | ||
uint8 | port, | ||
eoe_param_t * | ipparam, | ||
int | timeout | ||
) |
EoE EOE get IP, blocking. Waits for response from the slave.
[in] | context | = Context struct |
[in] | slave | = Slave number |
[in] | port | = Port number on slave if applicable |
[out] | ipparam | = IP parameter data retrived from slave |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
Definition at line 181 of file ethercateoe.c.
int ecx_EOEreadfragment | ( | ec_mbxbuft * | MbxIn, |
uint8 * | rxfragmentno, | ||
uint16 * | rxframesize, | ||
uint16 * | rxframeoffset, | ||
uint16 * | rxframeno, | ||
int * | psize, | ||
void * | p | ||
) |
EoE mailbox fragment read
Will take the data in incoming mailbox buffer and copy to destination Ethernet frame buffer at given offset and update current fragment variables
[in] | MbxIn | = Received mailbox containing fragment data |
[in,out] | rxfragmentno | = Fragment number |
[in,out] | rxframesize | = Frame size |
[in,out] | rxframeoffset | = Frame offset |
[in,out] | rxframeno | = Frame number |
[in,out] | psize | = Size in bytes of frame buffer. |
[out] | p | = Pointer to frame buffer |
Definition at line 534 of file ethercateoe.c.
int ecx_EOErecv | ( | ecx_contextt * | context, |
uint16 | slave, | ||
uint8 | port, | ||
int * | psize, | ||
void * | p, | ||
int | timeout | ||
) |
EoE ethernet buffer read, blocking.
If the buffer is larger than the mailbox size then the buffer is received by several fragments. The function will assamble the fragments into a complete Ethernet buffer.
[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | port | = Port number on slave if applicable |
[in,out] | psize | = Size in bytes of parameter buffer. |
[in] | p | = Pointer to parameter buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
Definition at line 415 of file ethercateoe.c.
int ecx_EOEsend | ( | ecx_contextt * | context, |
uint16 | slave, | ||
uint8 | port, | ||
int | psize, | ||
void * | p, | ||
int | timeout | ||
) |
EoE ethernet buffer write, blocking.
If the buffer is larger than the mailbox size then the buffer is sent in several fragments. The function will split the buf data in fragments and send them to the slave one by one.
[in] | context | = context struct |
[in] | slave | = Slave number |
[in] | port | = Port number on slave if applicable |
[in] | psize | = Size in bytes of parameter buffer. |
[in] | p | = Pointer to parameter buffer |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
Definition at line 322 of file ethercateoe.c.
int ecx_EOEsetIp | ( | ecx_contextt * | context, |
uint16 | slave, | ||
uint8 | port, | ||
eoe_param_t * | ipparam, | ||
int | timeout | ||
) |
EoE EOE set IP, blocking. Waits for response from the slave.
[in] | context | = Context struct |
[in] | slave | = Slave number |
[in] | port | = Port number on slave if applicable |
[in] | ipparam | = IP parameter data to be sent |
[in] | timeout | = Timeout in us, standard is EC_TIMEOUTRXM |
Definition at line 67 of file ethercateoe.c.
|
static |
EoE utility function to convert eoe ip bytes to uint32.
[in] | byte_ip | = eoe ip 4th octet, 3ed octet, 2nd octet, 1st octet |
[out] | ip | = ip in uint32 |
Definition at line 37 of file ethercateoe.c.
|
static |
EoE utility function to convert uint32 to eoe ip bytes.
[in] | ip | = ip in uint32 |
[out] | byte_ip | = eoe ip 4th octet, 3ed octet, 2nd octet, 1st octet |
Definition at line 25 of file ethercateoe.c.