Refactor repository layout (step 2 of 2)

Rename files ethercat to ec_

Change-Id: If79f133fa37147bf509a3a75b0f4e14de860fea3
This commit is contained in:
Hans-Erik Floryd
2025-07-09 17:20:48 +02:00
parent 78b757b2bf
commit 9582886c2c
37 changed files with 100 additions and 131 deletions
+23 -23
View File
@@ -34,24 +34,24 @@ set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)
set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
add_library(soem
src/ethercatbase.c
src/ethercatcoe.c
src/ethercatconfig.c
src/ethercatdc.c
src/ethercateoe.c
src/ethercatfoe.c
src/ethercatmain.c
src/ethercatprint.c
src/ethercatsoe.c
src/ec_base.c
src/ec_coe.c
src/ec_config.c
src/ec_dc.c
src/ec_eoe.c
src/ec_foe.c
src/ec_main.c
src/ec_print.c
src/ec_soe.c
)
target_include_directories(soem PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include/soem>
$<INSTALL_INTERFACE:include/soem>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_include_directories(soem PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/osal>
$<INSTALL_INTERFACE:include/soem>
$<INSTALL_INTERFACE:include>
)
install(
@@ -66,17 +66,17 @@ install(
)
install(FILES
include/soem/ethercatbase.h
include/soem/ethercatcoe.h
include/soem/ethercatconfig.h
include/soem/ethercatdc.h
include/soem/ethercateoe.h
include/soem/ethercatfoe.h
include/soem/ethercat.h
include/soem/ethercatmain.h
include/soem/ethercatprint.h
include/soem/ethercatsoe.h
include/soem/ethercattype.h
include/soem/ec_base.h
include/soem/ec_coe.h
include/soem/ec_config.h
include/soem/ec_dc.h
include/soem/ec_eoe.h
include/soem/ec_foe.h
include/soem/ec_main.h
include/soem/ec_print.h
include/soem/ec_soe.h
include/soem/ec_type.h
include/soem/soem.h
osal/osal.h
DESTINATION include/soem
)
@@ -6,11 +6,11 @@
/** \file
* \brief
* Headerfile for ethercatbase.c
* Headerfile for ec_base.c
*/
#ifndef _ethercatbase_
#define _ethercatbase_
#ifndef _ec_base_
#define _ec_base_
#ifdef __cplusplus
extern "C"
@@ -6,11 +6,11 @@
/** \file
* \brief
* Headerfile for ethercatcoe.c
* Headerfile for ec_coe.c
*/
#ifndef _ethercatcoe_
#define _ethercatcoe_
#ifndef _ec_coe_
#define _ec_coe_
#ifdef __cplusplus
extern "C"
@@ -6,11 +6,11 @@
/** \file
* \brief
* Headerfile for ethercatconfig.c
* Headerfile for ec_config.c
*/
#ifndef _ethercatconfig_
#define _ethercatconfig_
#ifndef _ec_config_
#define _ec_config_
#ifdef __cplusplus
extern "C"
@@ -6,7 +6,7 @@
/** \file
* \brief
* Headerfile for ethercatdc.c
* Headerfile for ec_dc.c
*/
#ifndef _EC_ECATDC_H
@@ -6,18 +6,18 @@
/** \file
* \brief
* Headerfile for ethercatfoe.c
* Headerfile for ec_foe.c
*/
#ifndef _ethercateoe_
#define _ethercateoe_
#ifndef _ec_eoe_
#define _ec_eoe_
#ifdef __cplusplus
extern "C"
{
#endif
#include "ethercat.h"
#include "soem/soem.h"
/* use maximum size for EOE mailbox data - mbxheader and 2x frameinfo */
#define EC_MAXEOEDATA (EC_MAXMBX - (sizeof(ec_mbxheadert) +\
@@ -6,11 +6,11 @@
/** \file
* \brief
* Headerfile for ethercatfoe.c
* Headerfile for ec_foe.c
*/
#ifndef _ethercatfoe_
#define _ethercatfoe_
#ifndef _ec_foe_
#define _ec_foe_
#ifdef __cplusplus
extern "C"
@@ -6,11 +6,11 @@
/** \file
* \brief
* Headerfile for ethercatmain.c
* Headerfile for ec_main.c
*/
#ifndef _ethercatmain_
#define _ethercatmain_
#ifndef _ec_main_
#define _ec_main_
#ifdef __cplusplus
@@ -6,18 +6,18 @@
/** \file
* \brief
* Headerfile for ethercatprint.c
* Headerfile for ec_print.c
*/
#ifndef _ethercatprint_
#define _ethercatprint_
#ifndef _ec_print_
#define _ec_print_
#ifdef __cplusplus
extern "C"
{
#endif
char* ec_sdoerror2string( uint32 sdoerrorcode);
const char* ec_sdoerror2string( uint32 sdoerrorcode);
char* ec_ALstatuscode2string( uint16 ALstatuscode);
char* ec_soeerror2string( uint16 errorcode);
char* ec_mbxerror2string( uint16 errorcode);
@@ -6,11 +6,11 @@
/** \file
* \brief
* Headerfile for ethercatsoe.c
* Headerfile for ec_soe.c
*/
#ifndef _ethercatsoe_
#define _ethercatsoe_
#ifndef _ec_soe_
#define _ec_soe_
#ifdef __cplusplus
extern "C"
-27
View File
@@ -1,27 +0,0 @@
/*
* This software is dual-licensed under GPLv3 and a commercial
* license. See the file LICENSE.md distributed with this software for
* full license information.
*/
/** \file
* \brief
* Headerfile for all ethercat headers
*/
#ifndef _EC_ETHERCAT_H
#define _EC_ETHERCAT_H
#include "ethercattype.h"
#include "nicdrv.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatdc.h"
#include "ethercatcoe.h"
#include "ethercatfoe.h"
#include "ethercatsoe.h"
#include "ethercateoe.h"
#include "ethercatconfig.h"
#include "ethercatprint.h"
#endif /* _EC_ETHERCAT_H */
+26
View File
@@ -0,0 +1,26 @@
/*
* Licensed under the GNU General Public License version 2 with exceptions. See
* LICENSE file in the project root for full license information
*/
/** \file
* \brief
* SOEM main include file
*/
#ifndef _SOEM_H
#define _SOEM_H
#include "soem/ec_type.h"
#include "nicdrv.h"
#include "soem/ec_base.h"
#include "soem/ec_main.h"
#include "soem/ec_dc.h"
#include "soem/ec_coe.h"
#include "soem/ec_foe.h"
#include "soem/ec_soe.h"
#include "soem/ec_eoe.h"
#include "soem/ec_config.h"
#include "soem/ec_print.h"
#endif /* _SOEM_H */
+1 -2
View File
@@ -16,9 +16,8 @@
extern "C" {
#endif
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "ethercatmain.h"
uint16 oshw_htons(uint16 hostshort);
uint16 oshw_ntohs(uint16 networkshort);
+1 -2
View File
@@ -38,9 +38,8 @@
#include <traceapi.h>
#include "hpeif2.h"
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "oshw.h"
/** Redundancy modes */
enum
+1 -2
View File
@@ -12,9 +12,8 @@
#ifndef _oshw_
#define _oshw_
#include "ethercattype.h"
#include "soem/soem.h"
#include "ethercatmain.h"
#include "nicdrv.h"
#ifdef __cplusplus
extern "C" {
+1 -2
View File
@@ -16,9 +16,8 @@
extern "C" {
#endif
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "ethercatmain.h"
uint16 oshw_htons(uint16 hostshort);
uint16 oshw_ntohs(uint16 networkshort);
+1 -2
View File
@@ -38,9 +38,8 @@
#include <fcntl.h>
#include <string.h>
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "osal.h"
/** Redundancy modes */
enum
+1 -2
View File
@@ -16,9 +16,8 @@
extern "C" {
#endif
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "ethercatmain.h"
uint16 oshw_htons(uint16 hostshort);
uint16 oshw_ntohs(uint16 networkshort);
+1 -2
View File
@@ -16,9 +16,8 @@
extern "C" {
#endif
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "ethercatmain.h"
uint16 oshw_htons(uint16 hostshort);
uint16 oshw_ntohs(uint16 networkshort);
+1 -2
View File
@@ -18,9 +18,8 @@ extern "C"
#endif
#include <kern/kern.h>
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "ethercatmain.h"
int oshw_mac_init (const uint8_t * mac_address);
int oshw_mac_send (const void *payload, size_t tot_len);
+1 -2
View File
@@ -12,9 +12,8 @@
#ifndef _oshw_
#define _oshw_
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "ethercatmain.h"
uint16 oshw_htons(uint16 hostshort);
uint16 oshw_ntohs(uint16 networkshort);
+1 -1
View File
@@ -39,7 +39,7 @@
#include <string.h>
#include <winsock2.h>
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "osal_win32.h"
+1 -2
View File
@@ -17,9 +17,8 @@ extern "C"
{
#endif
#include "ethercattype.h"
#include "soem/soem.h"
#include "nicdrv.h"
#include "ethercatmain.h"
uint16 oshw_htons (uint16 hostshort);
uint16 oshw_ntohs (uint16 networkshort);
+1 -1
View File
@@ -18,7 +18,7 @@
#include <stdlib.h>
#include <string.h>
#include "ethercat.h"
#include "soem/soem.h"
#define MAXBUF 524288
#define STDBUF 2048
+1 -1
View File
@@ -7,7 +7,7 @@
* This is a minimal test.
*/
#include "ethercat.h"
#include "soem/soem.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+1 -1
View File
@@ -13,7 +13,7 @@
#include <string.h>
#include <inttypes.h>
#include "ethercat.h"
#include "soem/soem.h"
#define EC_TIMEOUTMON 500
+1 -1
View File
@@ -15,7 +15,7 @@
#include <string.h>
#include <inttypes.h>
#include "ethercat.h"
#include "soem/soem.h"
static char IOmap[4096];
static ec_ODlistt ODlist;
+1 -3
View File
@@ -14,12 +14,10 @@
* wait for the frame to be returned to the master or timeout. If this is
* not acceptable build your own datagrams and use the functions from nicdrv.c.
*/
#include "soem/soem.h"
#include <string.h>
#include "oshw.h"
#include "osal.h"
#include "ethercattype.h"
#include "ethercatbase.h"
/** Write data to EtherCAT datagram.
*
+1 -4
View File
@@ -11,13 +11,10 @@
* SDO read / write and SDO service functions
*/
#include "soem/soem.h"
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatcoe.h"
/** SDO structure, not to be confused with EcSDOserviceT */
PACKED_BEGIN
+1 -6
View File
@@ -12,16 +12,11 @@
* the slaves can be auto configured with this module.
*/
#include "soem/soem.h"
#include <stdio.h>
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatcoe.h"
#include "ethercatsoe.h"
#include "ethercatconfig.h"
typedef struct
+1 -4
View File
@@ -9,12 +9,9 @@
* Distributed Clock EtherCAT functions.
*
*/
#include "soem/soem.h"
#include "oshw.h"
#include "osal.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatdc.h"
#define PORTM0 0x01
#define PORTM1 0x02
+1 -1
View File
@@ -14,10 +14,10 @@
* Read incoming EoE fragment to Ethernet Frame
*/
#include "soem/soem.h"
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercat.h"
/** EoE utility function to convert uint32 to eoe ip bytes.
* @param[in] ip = ip in uint32
+1 -4
View File
@@ -11,13 +11,10 @@
* SDO read / write and SDO service functions
*/
#include "soem/soem.h"
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatfoe.h"
/* use maximum size for FOE mailbox data - header and metadata */
#define EC_MAXFOEDATA \
+1 -1
View File
@@ -16,10 +16,10 @@
* Needed for most user interaction with slaves.
*/
#include "soem/soem.h"
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercat.h"
/** delay in us for eeprom ready loop */
+1 -2
View File
@@ -13,10 +13,9 @@
* For the defined error codes see the EtherCAT protocol documentation.
*/
#include "soem/soem.h"
#include <stdio.h>
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatmain.h"
#define EC_MAXERRORNAME 127
+1 -4
View File
@@ -9,13 +9,10 @@
* Servo over EtherCAT (SoE) Module.
*/
#include "soem/soem.h"
#include <string.h>
#include "osal.h"
#include "oshw.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatsoe.h"
#define EC_SOE_MAX_DRIVES 8