Lely core libraries 2.3.4
|
This header file is part of the CANopen library; it contains the synchronization (SYNC) object declarations. More...
Go to the source code of this file.
Typedefs | |
typedef void | co_sync_ind_t(co_sync_t *sync, co_unsigned8_t cnt, void *data) |
The type of a CANopen SYNC indication function, invoked after a SYNC message is received or transmitted. More... | |
typedef void | co_sync_err_t(co_sync_t *sync, co_unsigned16_t eec, co_unsigned8_t er, void *data) |
The type of a CANopen SYNC error handling function, invoked when the SYNC data length does not match. More... | |
Functions | |
co_sync_t * | co_sync_create (can_net_t *net, co_dev_t *dev) |
Creates a new CANopen SYNC producer/consumer service. More... | |
void | co_sync_destroy (co_sync_t *sync) |
Destroys a CANopen SYNC producer/consumer service. More... | |
int | co_sync_start (co_sync_t *sync) |
Starts a SYNC service. More... | |
void | co_sync_stop (co_sync_t *sync) |
Stops a SYNC service. More... | |
int | co_sync_is_stopped (const co_sync_t *sync) |
Retuns 1 if the specified SYNC service is stopped, and 0 if not. More... | |
can_net_t * | co_sync_get_net (const co_sync_t *sync) |
Returns a pointer to the CAN network of a SYNC producer/consumer service. | |
co_dev_t * | co_sync_get_dev (const co_sync_t *sync) |
Returns a pointer to the CANopen device of a SYNC producer/consumer service. | |
void | co_sync_get_ind (const co_sync_t *sync, co_sync_ind_t **pind, void **pdata) |
Retrieves the indication function invoked after a CANopen SYNC message is received or transmitted. More... | |
void | co_sync_set_ind (co_sync_t *sync, co_sync_ind_t *ind, void *data) |
Sets the indication function invoked after a CANopen SYNC message is received or transmitted. More... | |
void | co_sync_get_err (const co_sync_t *sync, co_sync_err_t **perr, void **pdata) |
Retrieves the error handling function of a SYNC consumer service. More... | |
void | co_sync_set_err (co_sync_t *sync, co_sync_err_t *err, void *data) |
Sets the error handling function of a SYNC consumer service. More... | |
This header file is part of the CANopen library; it contains the synchronization (SYNC) object declarations.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file sync.h.
typedef void co_sync_ind_t(co_sync_t *sync, co_unsigned8_t cnt, void *data) |
typedef void co_sync_err_t(co_sync_t *sync, co_unsigned16_t eec, co_unsigned8_t er, void *data) |
Creates a new CANopen SYNC producer/consumer service.
The service is started as if by co_sync_start().
net | a pointer to a CAN network. |
dev | a pointer to a CANopen device. |
void co_sync_destroy | ( | co_sync_t * | sync | ) |
Destroys a CANopen SYNC producer/consumer service.
int co_sync_start | ( | co_sync_t * | sync | ) |
Starts a SYNC service.
void co_sync_stop | ( | co_sync_t * | sync | ) |
int co_sync_is_stopped | ( | const co_sync_t * | sync | ) |
Retuns 1 if the specified SYNC service is stopped, and 0 if not.
void co_sync_get_ind | ( | const co_sync_t * | sync, |
co_sync_ind_t ** | pind, | ||
void ** | pdata | ||
) |
Retrieves the indication function invoked after a CANopen SYNC message is received or transmitted.
sync | a pointer to a SYNC consumer service. |
pind | the address at which to store a pointer to the indication function (can be NULL). |
pdata | the address at which to store a pointer to user-specified data (can be NULL). |
void co_sync_set_ind | ( | co_sync_t * | sync, |
co_sync_ind_t * | ind, | ||
void * | data | ||
) |
Sets the indication function invoked after a CANopen SYNC message is received or transmitted.
sync | a pointer to a SYNC consumer service. |
ind | a pointer to the function to be invoked. |
data | a pointer to user-specified data (can be NULL). data is passed as the last parameter to ind. |
void co_sync_get_err | ( | const co_sync_t * | sync, |
co_sync_err_t ** | perr, | ||
void ** | pdata | ||
) |
Retrieves the error handling function of a SYNC consumer service.
sync | a pointer to a SYNC consumer service. |
perr | the address at which to store a pointer to the error handling function (can be NULL). |
pdata | the address at which to store a pointer to user-specified data (can be NULL). |
void co_sync_set_err | ( | co_sync_t * | sync, |
co_sync_err_t * | err, | ||
void * | data | ||
) |
Sets the error handling function of a SYNC consumer service.
sync | a pointer to a SYNC consumer service. |
err | a pointer to the function to be invoked. |
data | a pointer to user-specified data (can be NULL). data is passed as the last parameter to err. |