18 Commits

Author SHA1 Message Date
Hans-Erik Floryd
0093291cfa Update sample headers
Use same header for all sources.

Change-Id: Ie30f55f8fe64e6815482dd2662372e54791e833e
2025-07-11 11:28:30 +02:00
Hans-Erik Floryd
fdb246c8b2 Add slave argument to eoe_test
Let the user specify the EoE slave to use.

Change-Id: I835110cedd7de30419d947073a04370e1e121972
2025-07-11 11:28:30 +02:00
Hans-Erik Floryd
f93f66f822 Merge samples
Merge simple_test, red_test and coetest samples into ec_sample for
easier maintenance. The ec_sample program demonstrates distributed
clock synchronization and slave mailbox cyclic handling in addition to
running a simple process data loop.

Change-Id: If0e9cd484e701902fddffc7165e0c83b70a06979
2025-07-11 11:28:30 +02:00
Hans-Erik Floryd
a943a5706a Cleanup eoe_test
Change-Id: Ie65ab4b17e51e749dc0c3e1a2ce84f2707478f13
2025-07-10 11:59:45 +02:00
Hans-Erik Floryd
573cf4aadf Fix spelling
Change-Id: I1dc05f26dfb32ca1584aeb3a31fbd525cafb55cb
2025-07-10 11:59:03 +02:00
Hans-Erik Floryd
c40fd2c98c Fix mscv warnings
Change-Id: Icb8d8bd0a756acda12b7fb392f199f9216aebd7a
2025-07-10 11:38:59 +02:00
Hans-Erik Floryd
5827f10baa Inline ecx_contextt
Simplify user applications by allocating space for exc_contextt
members in the struct directly.

Change-Id: If53062539e265326c420020188621887435681f3
2025-07-10 11:38:59 +02:00
Hans-Erik Floryd
0c291d4f92 Fix buffer overflow in slaveinfo
The string buffer in SDO2string could overflow for large octet
strings. Fix by limiting output to the size of the output string.

Change-Id: Ic45056918570d8320a02f70a8795b6b863a590ff
2025-07-10 11:38:59 +02:00
Hans-Erik Floryd
3377d1d8ae Remove ecx_config_init usetable argument
The usetable argument was a leftover from the legacy API which was
removed in a previous commit.

Change-Id: I2fe5fdf9ed2e2c0b118dff43bf5d50b5809adbd7
2025-07-10 11:38:42 +02:00
Hans-Erik Floryd
3188367ef6 Add overlap and align modes to context
Simplify the API by adding overlap and byte alignment modes to the
context. SOEM can then call the correct functions internally. As a
consequence the following functions are removed from the public API:

   ecx_config_overlap_map_group
   ecx_config_map_group_aligned
   ecx_send_overlap_processdata_group
   ecx_send_overlap_processdata

Change-Id: I0404c4fbaa6be68be4c584af0cc9d62e780c7aaa
2025-07-10 11:38:42 +02:00
Hans-Erik Floryd
3ecdba7618 Use ec_group for input/output size in samples
The ec_slave Ibyte count now includes one byte mailbox state per
slave. Use ec_group Ibytes instead. ec_group does not have Ibits
however.

Change-Id: Ic25563fda1d6ba2753ebf47fc45b70cc336c8671
2025-07-10 10:23:07 +02:00
Hans-Erik Floryd
d5124435f0 Let coetest/redtest build on other platforms
Use the new osal functions to let tests build on all supported
platforms.

Change-Id: I6519ee55588e7bf0dff8d412679db268abbe86ce
2025-07-10 10:23:07 +02:00
Hans-Erik Floryd
7c2da72988 Add OSAL functions for monotonic time
This commit adds osal_get_monotonic_time() and
osal_monotonic_sleep(). These functions are designed to facilitate
synchronization with DC time, which can achieve nanosecond precision.

To support this functionality, the ec_timet structure has been
refactored to hold time values in nanoseconds, eliminating the need to
maintain separate time representations.

Change-Id: I039a006ccdb21ba35c437ab76e44e5153c711998
2025-07-10 10:23:07 +02:00
Hans-Erik Floryd
d1c95dfb7d Add eni_test sample
Add a simple test showing how to use the ENI parser.

Change-Id: I23755d29b10a40fc3ddb21b0780f7e000d9fbdfe
2025-07-10 10:23:07 +02:00
Hans-Erik Floryd
08064ae3fa Add more samples
Change-Id: I6bf219887efd88a69a257815f1974759d56fd3c3
2025-07-09 17:21:26 +02:00
Hans-Erik Floryd
0ae3d2f056 Run clang-format on sources
Change-Id: Ide59897b87104bfb71e953b7f8dace00e441e245
2025-07-09 17:20:48 +02:00
Hans-Erik Floryd
9582886c2c Refactor repository layout (step 2 of 2)
Rename files ethercat to ec_

Change-Id: If79f133fa37147bf509a3a75b0f4e14de860fea3
2025-07-09 17:20:48 +02:00
Hans-Erik Floryd
78b757b2bf Refactor repository layout (step 1 of 2)
Create include,src and test folders and move files accordingly.

Change-Id: I3caf7a8de2ba1a9ad5a9cedbaad3942657a3753d
2025-07-09 17:20:48 +02:00