SOEM
v1.4.0
|
Ethernet over EtherCAT (EoE) module. More...
Functions | |
static void | EOE_ip_uint32_to_byte (eoe_ip4_addr_t *ip, uint8_t *byte_ip) |
static void | EOE_ip_byte_to_uint32 (uint8_t *byte_ip, eoe_ip4_addr_t *ip) |
int | ecx_EOEdefinehook (ecx_contextt *context, void *hook) |
int | ecx_EOEsetIp (ecx_contextt *context, uint16 slave, uint8 port, eoe_param_t *ipparam, int timeout) |
int | ecx_EOEgetIp (ecx_contextt *context, uint16 slave, uint8 port, eoe_param_t *ipparam, int timeout) |
int | ecx_EOEsend (ecx_contextt *context, uint16 slave, uint8 port, int psize, void *p, int timeout) |
int | ecx_EOErecv (ecx_contextt *context, uint16 slave, uint8 port, int *psize, void *p, int timeout) |
int | ecx_EOEreadfragment (ec_mbxbuft *MbxIn, uint8 *rxfragmentno, uint16 *rxframesize, uint16 *rxframeoffset, uint16 *rxframeno, int *psize, void *p) |
Ethernet over EtherCAT (EoE) module.
Set / Get IP functions Blocking send/receive Ethernet Frame Read incoming EoE fragment to Ethernet Frame
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. |
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 |
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 |
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 |
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 |
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 |
|
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 |
|
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 |