Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICS Control System Infrastructure
etherlabmaster
Commits
19ce7ae3
Commit
19ce7ae3
authored
16 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Introduced ecrt_voe_handler_received_header(); renamed
ecrt_voe_handler_header() to ecrt_voe_handler_send_header().
parent
9733b26a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ecrt.h
+24
-7
24 additions, 7 deletions
include/ecrt.h
master/voe_handler.c
+16
-2
16 additions, 2 deletions
master/voe_handler.c
with
40 additions
and
9 deletions
include/ecrt.h
+
24
−
7
View file @
19ce7ae3
...
@@ -923,21 +923,35 @@ void ecrt_sdo_request_read(
...
@@ -923,21 +923,35 @@ void ecrt_sdo_request_read(
* VoE handler methods.
* VoE handler methods.
****************************************************************************/
****************************************************************************/
/** Sets the VoE header
containing vendor ID and vendor type
.
/** Sets the VoE header
for future send operations
.
*
*
* A VoE message shall contain a 4-byte vendor ID, followed by a 2-byte vendor
* A VoE message shall contain a 4-byte vendor ID, followed by a 2-byte vendor
* type at as header. These numbers can be set with this function.
* type at as header. These numbers can be set with this function.
*/
*/
void
ecrt_voe_handler_header
(
void
ecrt_voe_handler_
send_
header
(
ec_voe_handler_t
*
voe
,
/**< VoE handler. */
ec_voe_handler_t
*
voe
,
/**< VoE handler. */
uint32_t
vendor_id
,
/**< Vendor ID. */
uint32_t
vendor_id
,
/**< Vendor ID. */
uint16_t
vendor_type
/**< Vendor-specific type. */
uint16_t
vendor_type
/**< Vendor-specific type. */
);
);
/** Reads the header data of a received VoE message.
*
* This method can be used after a read operation has succeded, to get the
* received header information.
*
* The header information is stored at the memory given by the pointer
* parameters.
*/
void
ecrt_voe_handler_received_header
(
const
ec_voe_handler_t
*
voe
,
/**< VoE handler. */
uint32_t
*
vendor_id
,
/**< Vendor ID. */
uint16_t
*
vendor_type
/**< Vendor-specific type. */
);
/** Access to the VoE handler's data.
/** Access to the VoE handler's data.
*
*
* This function returns a pointer to the VoE handler's internal memory, after
* This function returns a pointer to the VoE handler's internal memory, after
* the VoE header (see ecrt_voe_handler_header()).
* the VoE header (see ecrt_voe_handler_
send_
header()).
*
*
* - After a read operation was successful, the memory contains the received
* - After a read operation was successful, the memory contains the received
* data. The size of the received data can be determined via
* data. The size of the received data can be determined via
...
@@ -955,7 +969,7 @@ uint8_t *ecrt_voe_handler_data(
...
@@ -955,7 +969,7 @@ uint8_t *ecrt_voe_handler_data(
/** Returns the current data size.
/** Returns the current data size.
*
*
* The data size is the size of the VoE data without the header (see
* The data size is the size of the VoE data without the header (see
* ecrt_voe_handler_header()).
* ecrt_voe_handler_
send_
header()).
*
*
* When the VoE handler is created, the data size is set to the size of the
* When the VoE handler is created, the data size is set to the size of the
* reserved memory. At a write operation, the data size is set to the number
* reserved memory. At a write operation, the data size is set to the number
...
@@ -971,7 +985,8 @@ size_t ecrt_voe_handler_data_size(
...
@@ -971,7 +985,8 @@ size_t ecrt_voe_handler_data_size(
/** Start a VoE write operation.
/** Start a VoE write operation.
*
*
* After this function has been called, the ecrt_voe_handler_execute() method
* After this function has been called, the ecrt_voe_handler_execute() method
* must be called in every bus cycle as long as it returns EC_REQUEST_BUSY.
* must be called in every bus cycle as long as it returns EC_REQUEST_BUSY. No
* other operation may be started while the handler is busy.
*/
*/
void
ecrt_voe_handler_write
(
void
ecrt_voe_handler_write
(
ec_voe_handler_t
*
voe
,
/**< VoE handler. */
ec_voe_handler_t
*
voe
,
/**< VoE handler. */
...
@@ -981,10 +996,12 @@ void ecrt_voe_handler_write(
...
@@ -981,10 +996,12 @@ void ecrt_voe_handler_write(
/** Start a VoE read operation.
/** Start a VoE read operation.
*
*
* After this function has been called, the ecrt_voe_handler_execute() method
* After this function has been called, the ecrt_voe_handler_execute() method
* must be called in every bus cycle as long as it returns EC_REQUEST_BUSY.
* must be called in every bus cycle as long as it returns EC_REQUEST_BUSY. No
* other operation may be started while the handler is busy.
*
*
* On success, the size of the read data can be determined via
* On success, the size of the read data can be determined via
* ecrt_voe_handler_data_size().
* ecrt_voe_handler_data_size(), while the VoE header of the received data
* can be retrieved with ecrt_voe_handler_received_header().
*/
*/
void
ecrt_voe_handler_read
(
void
ecrt_voe_handler_read
(
ec_voe_handler_t
*
voe
/**< VoE handler. */
ec_voe_handler_t
*
voe
/**< VoE handler. */
...
...
This diff is collapsed.
Click to expand it.
master/voe_handler.c
+
16
−
2
View file @
19ce7ae3
...
@@ -111,7 +111,7 @@ void ec_voe_handler_clear(
...
@@ -111,7 +111,7 @@ void ec_voe_handler_clear(
* Application interface.
* Application interface.
****************************************************************************/
****************************************************************************/
void
ecrt_voe_handler_header
(
ec_voe_handler_t
*
voe
,
uint32_t
vendor_id
,
void
ecrt_voe_handler_
send_
header
(
ec_voe_handler_t
*
voe
,
uint32_t
vendor_id
,
uint16_t
vendor_type
)
uint16_t
vendor_type
)
{
{
voe
->
vendor_id
=
vendor_id
;
voe
->
vendor_id
=
vendor_id
;
...
@@ -120,6 +120,19 @@ void ecrt_voe_handler_header(ec_voe_handler_t *voe, uint32_t vendor_id,
...
@@ -120,6 +120,19 @@ void ecrt_voe_handler_header(ec_voe_handler_t *voe, uint32_t vendor_id,
/*****************************************************************************/
/*****************************************************************************/
void
ecrt_voe_handler_received_header
(
const
ec_voe_handler_t
*
voe
,
uint32_t
*
vendor_id
,
uint16_t
*
vendor_type
)
{
uint8_t
*
header
=
voe
->
datagram
.
data
+
EC_MBOX_HEADER_SIZE
;
if
(
vendor_id
)
*
vendor_id
=
EC_READ_U32
(
header
);
if
(
vendor_type
)
*
vendor_type
=
EC_READ_U16
(
header
+
4
);
}
/*****************************************************************************/
uint8_t
*
ecrt_voe_handler_data
(
ec_voe_handler_t
*
voe
)
uint8_t
*
ecrt_voe_handler_data
(
ec_voe_handler_t
*
voe
)
{
{
return
voe
->
datagram
.
data
+
EC_MBOX_HEADER_SIZE
+
EC_VOE_HEADER_SIZE
;
return
voe
->
datagram
.
data
+
EC_MBOX_HEADER_SIZE
+
EC_VOE_HEADER_SIZE
;
...
@@ -405,7 +418,8 @@ void ec_voe_handler_state_error(ec_voe_handler_t *voe)
...
@@ -405,7 +418,8 @@ void ec_voe_handler_state_error(ec_voe_handler_t *voe)
/** \cond */
/** \cond */
EXPORT_SYMBOL
(
ecrt_voe_handler_header
);
EXPORT_SYMBOL
(
ecrt_voe_handler_send_header
);
EXPORT_SYMBOL
(
ecrt_voe_handler_received_header
);
EXPORT_SYMBOL
(
ecrt_voe_handler_data
);
EXPORT_SYMBOL
(
ecrt_voe_handler_data
);
EXPORT_SYMBOL
(
ecrt_voe_handler_data_size
);
EXPORT_SYMBOL
(
ecrt_voe_handler_data_size
);
EXPORT_SYMBOL
(
ecrt_voe_handler_read
);
EXPORT_SYMBOL
(
ecrt_voe_handler_read
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment