![]() |
NTURT Zephyr v0.0.1
NTURT common library for Zephyr RTOS
|
CANopen support. More...
Data Structures | |
struct | canopen_od_init |
Struct for initializing OD entries. More... | |
Macros | |
#define | CO_EMC_NTURT 0xFF10 |
CANopen error code for reporting NTURT errors. | |
#define | TPDO_DATA(data, idx, subidx, ...) |
Specify the telemetry data to be published to TPDOs. | |
#define | CANOPEN_TM_TO_TPDO_DEFINE(_name, _period, _min_separation, _watermark, flag, ...) |
Define a telemetry group that publishes data to TPDOs. | |
#define | OD_TO_AGG_DATA(subidx, type, convert, member) |
Specify the data in an OD entry to be aggregated. Used in OD_TO_MSG_ENTRY. | |
#define | CANOPEN_OD_TO_AGG_DEFINE(_idx, _agg, _agg_type, ...) |
Define a mapping from OD writes (PDO or SDO) to updates of typed data aggregation. | |
#define | OD_TO_MSG_DATA(subidx, type, convert, member) |
Specify the data in an OD entry to be aggregated. Used in OD_TO_MSG_ENTRY. | |
#define | OD_TO_MSG_ENTRY(idx, ...) |
Specify an OD entry to be aggregated. Used in CANOPEN_OD_TO_MSG_DEFINE. | |
#define | CANOPEN_OD_TO_MSG_DEFINE(_msg, _init_val, _period, _min_separation, _watermark, _flag, ...) |
Define a data aggregration for aggregating OD writes (PDO or SDO) to message _msg . | |
Enumerations | |
enum | canopen_node_id { NODE_ID_VCU = 0x01 , NODE_ID_SENSORS = 0x02 , NODE_ID_RPI = 0x04 , NODE_ID_IMU = 0x08 , NODE_ID_GPS , NODE_ID_ACC = 0x10 , NODE_ID_INV_FL , NODE_ID_INV_FR , NODE_ID_INV_RL , NODE_ID_INV_RR } |
CANopen node ID. More... | |
Functions | |
void | canopen_tm_publish (uint32_t addr, const void *data, size_t size, void *user_data) |
Publishing function for CANOPEN_TM_TO_TPDO_DEFINE. | |
CANopen support.
#define CANOPEN_OD_TO_AGG_DEFINE | ( | _idx, | |
_agg, | |||
_agg_type, | |||
... ) |
#include <nturt/canbus/canopen.h>
Define a mapping from OD writes (PDO or SDO) to updates of typed data aggregation.
[in] | _idx | Index of the OD entry. |
[in] | ... | Data to be aggregated, must be specified by OD_TO_AGG_DATA. |
#define CANOPEN_OD_TO_MSG_DEFINE | ( | _msg, | |
_init_val, | |||
_period, | |||
_min_separation, | |||
_watermark, | |||
_flag, | |||
... ) |
#include <nturt/canbus/canopen.h>
Define a data aggregration for aggregating OD writes (PDO or SDO) to message _msg
.
[in] | _msg | Message to aggregate. |
[in] | _init_val | Initial value of the message, must be a specified by AGG_DATA_INIT. |
[in] | _period | Period of data publishing. |
[in] | _min_separation | Minimum separation time between two data publishing. |
[in] | _watermark | Watermark to wait for late-arriving members. |
[in] | _flag | Flag of the aggregation. The same ones and rules as flag in AGG_DEFINE. |
[in] | ... | OD entries to be aggregated, must be specified by OD_TO_MSG_ENTRY. |
#define CANOPEN_TM_TO_TPDO_DEFINE | ( | _name, | |
_period, | |||
_min_separation, | |||
_watermark, | |||
flag, | |||
... ) |
#include <nturt/canbus/canopen.h>
Define a telemetry group that publishes data to TPDOs.
[in] | _name | Name of the telemetry group. |
[in] | _period | Period of data publishing. |
[in] | _min_separation | Minimum separation time between two data publishing. |
[in] | _watermark | Watermark to wait for late-arriving members. |
[in] | flag | Flag of the aggregation. The same ones and rules as flag in AGG_DEFINE. |
[in] | ... | Telemetry data to be published to PDOs, must be specified by TPDO_DATA. |
#define CO_EMC_NTURT 0xFF10 |
#include <nturt/canbus/canopen.h>
CANopen error code for reporting NTURT errors.
#define OD_TO_AGG_DATA | ( | subidx, | |
type, | |||
convert, | |||
member ) |
#include <nturt/canbus/canopen.h>
Specify the data in an OD entry to be aggregated. Used in OD_TO_MSG_ENTRY.
[in] | subidx | Subindex of the data in the OD entry. If the entry is of type VAR , this must be 0. |
[in] | type | Type of the data. |
[in] | convert | Function to convert the raw data into physical data, which is useful if the raw data have different scale or offset. If no conversion is needed, use Zephyr IDENTITY . |
[in] | member | Member of typed data aggregation to update. |
#define OD_TO_MSG_DATA | ( | subidx, | |
type, | |||
convert, | |||
member ) |
#include <nturt/canbus/canopen.h>
Specify the data in an OD entry to be aggregated. Used in OD_TO_MSG_ENTRY.
[in] | subidx | Subindex of the data in the OD entry. If the entry is of type VAR , this must be 0. |
[in] | type | Type of the data. |
[in] | convert | Function to convert the raw data into physical data, which is useful if the raw data have different scale or offset. If no conversion is needed, use Zephyr IDENTITY . |
[in] | member | Member in the message that the data corresponds to and will be updated to when the OD data is received, must be specified by AGG_MEMBER. |
#define OD_TO_MSG_ENTRY | ( | idx, | |
... ) |
#include <nturt/canbus/canopen.h>
Specify an OD entry to be aggregated. Used in CANOPEN_OD_TO_MSG_DEFINE.
[in] | idx | Index of the OD entry. |
[in] | ... | Data to be aggregated, must be specified by OD_TO_MSG_DATA. |
#define TPDO_DATA | ( | data, | |
idx, | |||
subidx, | |||
... ) |
#include <nturt/canbus/canopen.h>
Specify the telemetry data to be published to TPDOs.
[in] | data | Telemetry data defined by TM_DATA_DEFINE. |
[in] | idx | Index of the OD entry that corresponds to the data. |
[in] | subidx | Subindex of the OD entry that corresponds to the data. If the entry is of type VAR , this must be 0. |
[in] | ... | Optional flags of the data, the same ones and rules as AGG_MEMBER. |
enum canopen_node_id |
#include <nturt/canbus/canopen.h>
CANopen node ID.
Enumerator | |
---|---|
NODE_ID_VCU | |
NODE_ID_SENSORS | |
NODE_ID_RPI | |
NODE_ID_IMU | |
NODE_ID_GPS | |
NODE_ID_ACC | |
NODE_ID_INV_FL | |
NODE_ID_INV_FR | |
NODE_ID_INV_RL | |
NODE_ID_INV_RR |
void canopen_tm_publish | ( | uint32_t | addr, |
const void * | data, | ||
size_t | size, | ||
void * | user_data ) |
#include <nturt/canbus/canopen.h>
Publishing function for CANOPEN_TM_TO_TPDO_DEFINE.