Lely core libraries 2.3.4
|
This header file is part of the CANopen library; it contains the Receive-PDO declarations. More...
Go to the source code of this file.
Typedefs | |
typedef void | co_rpdo_ind_t(co_rpdo_t *pdo, co_unsigned32_t ac, const void *ptr, size_t n, void *data) |
The type of a CANopen Receive-PDO indication function, invoked when a PDO is received or an error occurs. More... | |
typedef void | co_rpdo_err_t(co_rpdo_t *pdo, co_unsigned16_t eec, co_unsigned8_t er, void *data) |
The type of a CANopen Receive-PDO error handling function, invoked in case of a timeout or length mismatch. More... | |
Functions | |
co_rpdo_t * | co_rpdo_create (can_net_t *net, co_dev_t *dev, co_unsigned16_t num) |
Creates a new CANopen Receive-PDO service. More... | |
void | co_rpdo_destroy (co_rpdo_t *pdo) |
Destroys a CANopen Receive-PDO service. More... | |
int | co_rpdo_start (co_rpdo_t *pdo) |
Starts a Receive-PDO service. More... | |
void | co_rpdo_stop (co_rpdo_t *pdo) |
Stops a Receive-PDO service. More... | |
int | co_rpdo_is_stopped (const co_rpdo_t *pdo) |
Retuns 1 if the specified Receive-PDO service is stopped, and 0 if not. More... | |
can_net_t * | co_rpdo_get_net (const co_rpdo_t *pdo) |
Returns a pointer to the CAN network of a Receive-PDO. | |
co_dev_t * | co_rpdo_get_dev (const co_rpdo_t *pdo) |
Returns a pointer to the CANopen device of a Receive-PDO. | |
co_unsigned16_t | co_rpdo_get_num (const co_rpdo_t *pdo) |
Returns the PDO number of a Receive-PDO. | |
const struct co_pdo_comm_par * | co_rpdo_get_comm_par (const co_rpdo_t *pdo) |
Returns a pointer to the PDO communication parameter record of a Receive-PDO. | |
const struct co_pdo_map_par * | co_rpdo_get_map_par (const co_rpdo_t *pdo) |
Returns a pointer to the PDO mapping parameter record of a Receive-PDO. | |
void | co_rpdo_get_ind (const co_rpdo_t *pdo, co_rpdo_ind_t **pind, void **pdata) |
Retrieves the indication function invoked when a Receive-PDO error occurs. More... | |
void | co_rpdo_set_ind (co_rpdo_t *pdo, co_rpdo_ind_t *ind, void *data) |
Sets the indication function invoked when a Receive-PDO error occurs. More... | |
void | co_rpdo_get_err (const co_rpdo_t *pdo, co_rpdo_err_t **perr, void **pdata) |
Retrieves the error handling function of a Receive-PDO service. More... | |
void | co_rpdo_set_err (co_rpdo_t *pdo, co_rpdo_err_t *err, void *data) |
Sets the error handling function of a Receive-PDO service. More... | |
int | co_rpdo_sync (co_rpdo_t *pdo, co_unsigned8_t cnt) |
Triggers the actuation of a received synchronous PDO. More... | |
int | co_rpdo_rtr (co_rpdo_t *pdo) |
Requests the transmission of a PDO. More... | |
This header file is part of the CANopen library; it contains the Receive-PDO 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 rpdo.h.
typedef void co_rpdo_ind_t(co_rpdo_t *pdo, co_unsigned32_t ac, const void *ptr, size_t n, void *data) |
The type of a CANopen Receive-PDO indication function, invoked when a PDO is received or an error occurs.
pdo | a pointer to a Receive-PDO service. |
ac | the SDO abort code: 0 on success, or CO_SDO_AC_NO_OBJ, CO_SDO_AC_NO_SUB, CO_SDO_AC_NO_WRITE, CO_SDO_AC_NO_PDO or CO_SDO_AC_PDO_LEN on error. |
ptr | a pointer to the bytes received. |
n | the number of bytes at ptr. |
data | a pointer to user-specified data. |
typedef void co_rpdo_err_t(co_rpdo_t *pdo, co_unsigned16_t eec, co_unsigned8_t er, void *data) |
The type of a CANopen Receive-PDO error handling function, invoked in case of a timeout or length mismatch.
pdo | a pointer to a Receive-PDO service. |
eec | the emergency error code (0x8210, 0x8220 or 0x8250). |
er | the error register (0x10). |
data | a pointer to user-specified data. |
Creates a new CANopen Receive-PDO service.
The service is started as if by co_rpdo_start().
net | a pointer to a CAN network. |
dev | a pointer to a CANopen device describing the server. |
num | the PDO number (in the range [1..512]). The PDO communication and mapping parameter records MUST exist in the object dictionary of dev. |
void co_rpdo_destroy | ( | co_rpdo_t * | pdo | ) |
Destroys a CANopen Receive-PDO service.
int co_rpdo_start | ( | co_rpdo_t * | pdo | ) |
Starts a Receive-PDO service.
void co_rpdo_stop | ( | co_rpdo_t * | pdo | ) |
int co_rpdo_is_stopped | ( | const co_rpdo_t * | pdo | ) |
Retuns 1 if the specified Receive-PDO service is stopped, and 0 if not.
void co_rpdo_get_ind | ( | const co_rpdo_t * | pdo, |
co_rpdo_ind_t ** | pind, | ||
void ** | pdata | ||
) |
Retrieves the indication function invoked when a Receive-PDO error occurs.
pdo | a pointer to a Receive-PDO 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_rpdo_set_ind | ( | co_rpdo_t * | pdo, |
co_rpdo_ind_t * | ind, | ||
void * | data | ||
) |
Sets the indication function invoked when a Receive-PDO error occurs.
pdo | a pointer to a Receive-PDO 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_rpdo_get_err | ( | const co_rpdo_t * | pdo, |
co_rpdo_err_t ** | perr, | ||
void ** | pdata | ||
) |
Retrieves the error handling function of a Receive-PDO service.
pdo | a pointer to a Receive-PDO 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_rpdo_set_err | ( | co_rpdo_t * | pdo, |
co_rpdo_err_t * | err, | ||
void * | data | ||
) |
Sets the error handling function of a Receive-PDO service.
pdo | a pointer to a Receive-PDO 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. |
int co_rpdo_sync | ( | co_rpdo_t * | pdo, |
co_unsigned8_t | cnt | ||
) |
Triggers the actuation of a received synchronous PDO.
pdo | a pointer to a Receive-PDO service. |
cnt | the counter value (in the range [0..240]). |
int co_rpdo_rtr | ( | co_rpdo_t * | pdo | ) |
Requests the transmission of a PDO.