|
CANOPEN_CLIENT Driver 0.1.0
API reference
|
Public types of the CANopen client driver: errors, Result<T>, the CAN frame, the protocol vocabulary (NMT, SDO, EMCY, PDO, drive states) and the configuration.
More...
#include <array>#include <cstddef>#include <cstdint>#include "canopen_client_version.h"Go to the source code of this file.
Classes | |
| struct | canopen_client::Result< T > |
| The value of a call, or why there is none. More... | |
| struct | canopen_client::Result< void > |
| The result of a call that returns no value. More... | |
| struct | canopen_client::CanFrame |
| One classic CAN frame with an 11-bit identifier. More... | |
| struct | canopen_client::SdoAbortInfo |
| The last SDO abort, from the node or from this driver. More... | |
| struct | canopen_client::SdoReply |
| A decoded SDO server reply. More... | |
| struct | canopen_client::HeartbeatInfo |
| A decoded heartbeat or node-guarding reply. More... | |
| struct | canopen_client::NodeStatus |
| What the heartbeat consumer knows about one node. More... | |
| struct | canopen_client::EmcyEvent |
| One emergency message (EMCY). More... | |
| struct | canopen_client::PdoSample |
| The latest frame received on a subscribed TPDO identifier. More... | |
| struct | canopen_client::Stats |
| Counters of the receive path, for diagnostics. More... | |
| struct | canopen_client::PdoMapEntry |
| One mapped object of a PDO. More... | |
| struct | canopen_client::PdoConfig |
| The communication and mapping parameters of one PDO. More... | |
| struct | canopen_client::DriveObjects |
| The object indices of a drive; the defaults are the profile's, a remapped drive overrides them. More... | |
| struct | canopen_client::Config |
| Everything the client uses; the defaults suit a node on a 500 kbit/s bus. More... | |
Namespaces | |
| namespace | canopen_client |
The CANopen client driver: everything it declares lives here; internals in detail. | |
Functions | |
| constexpr const char * | canopen_client::ToString (Error error) noexcept |
| The name of an error, for logs. | |
| constexpr bool | canopen_client::IsValid (const CanFrame &frame) noexcept |
| Whether a frame is representable on the bus: identifier at most 0x7FF, length at most 8. | |
| constexpr const char * | canopen_client::AbortCodeName (uint32_t code) noexcept |
| The name of an abort code, for logs. | |
| constexpr const char * | canopen_client::ToString (DriveState state) noexcept |
| The name of a drive state, for logs. | |
| constexpr Error | canopen_client::Validate (const Config &config) noexcept |
| Check a configuration without touching the bus. | |
| constexpr Config | canopen_client::FastBusPreset () noexcept |
| Short timeouts for a fast, lightly loaded bus. | |
| constexpr Config | canopen_client::SlowBusPreset () noexcept |
| Long timeouts for a slow or busy bus (for example 125 kbit/s with many nodes). | |
| constexpr const char * | canopen_client::GetDriverVersion () noexcept |
| constexpr uint32_t | canopen_client::GetDriverVersionMajor () noexcept |
| constexpr uint32_t | canopen_client::GetDriverVersionMinor () noexcept |
| constexpr uint32_t | canopen_client::GetDriverVersionPatch () noexcept |
Variables | |
| constexpr uint16_t | canopen_client::kMaxCanId = 0x7FF |
| Largest 11-bit CAN identifier. | |
| constexpr uint8_t | canopen_client::kMaxDlc = 8 |
| Longest classic CAN payload in bytes. | |
| constexpr uint8_t | canopen_client::kBroadcastNode = 0 |
| Node identifier of "every node" in an NMT command. | |
| constexpr uint8_t | canopen_client::kMinNodeId = 1 |
| Lowest valid node identifier. | |
| constexpr uint8_t | canopen_client::kMaxNodeId = 127 |
| Highest valid node identifier. | |
| constexpr uint16_t | canopen_client::kCobIdNmt = 0x000 |
| NMT command identifier (pre-defined connection set). | |
| constexpr uint16_t | canopen_client::kCobIdSync = 0x080 |
| SYNC identifier. | |
| constexpr uint16_t | canopen_client::kCobIdEmcyBase = 0x080 |
| EMCY identifiers are this plus the node identifier. | |
| constexpr uint16_t | canopen_client::kCobIdSdoResponseBase = 0x580 |
| SDO response (server to client) identifiers are this plus the node identifier. | |
| constexpr uint16_t | canopen_client::kCobIdSdoRequestBase = 0x600 |
| SDO request (client to server) identifiers are this plus the node identifier. | |
| constexpr uint16_t | canopen_client::kCobIdHeartbeatBase = 0x700 |
| Heartbeat and node-guarding identifiers are this plus the node identifier. | |
| constexpr uint16_t | canopen_client::kPdoCobIdMin = 0x181 |
| Lowest identifier the driver accepts for a PDO (the first pre-defined TPDO1 of node 1). | |
| constexpr uint16_t | canopen_client::kPdoCobIdMax = 0x57F |
| Highest identifier the driver accepts for a PDO (the last pre-defined RPDO4 identifier). | |
| constexpr std::size_t | canopen_client::kMonitorCapacity = 16 |
| Nodes the heartbeat and guarding consumer can watch at once. | |
| constexpr std::size_t | canopen_client::kPdoSubscriptionCapacity = 16 |
| TPDO identifiers the receive path can hold the latest frame of. | |
| constexpr std::size_t | canopen_client::kEmcyQueueCapacity = 8 |
EMCY events queued between two PopEmcy() calls. | |
| constexpr std::size_t | canopen_client::kMaxPdoEntries = 16 |
| Entries of one PDO mapping the helpers handle. | |
| constexpr uint32_t | canopen_client::kMaxFramesPerWait = 256 |
| Frames one blocking wait looks at before it gives up (a flooded bus must not stall a call). | |
| constexpr uint32_t | canopen_client::kMaxDrainFrames = 64 |
| Frames drained and routed before a request is sent. | |
| constexpr uint32_t | canopen_client::kMaxSdoSegments = 65536 |
| Segments of one segmented SDO transfer (7 bytes each). | |
| constexpr uint32_t | canopen_client::kMaxReceivesPerWait = 65536 |
| constexpr uint16_t | canopen_client::kControlShutdown = 0x0006 |
| Controlword: shutdown (to Ready to switch on). | |
| constexpr uint16_t | canopen_client::kControlSwitchOn = 0x0007 |
| Controlword: switch on (to Switched on). | |
| constexpr uint16_t | canopen_client::kControlDisableVoltage = 0x0000 |
| Controlword: disable voltage (to Switch on disabled). | |
| constexpr uint16_t | canopen_client::kControlQuickStop = 0x0002 |
| Controlword: quick stop. | |
| constexpr uint16_t | canopen_client::kControlEnableOperation = 0x000F |
| Controlword: enable operation (to Operation enabled). | |
| constexpr uint16_t | canopen_client::kControlFaultReset = 0x0080 |
| Controlword: fault reset (bit 7, acts on the rising edge). | |
| constexpr uint32_t | canopen_client::kMaxSdoTimeoutUs = 60'000'000 |
| Longest SDO timeout in microseconds. | |
Public types of the CANopen client driver: errors, Result<T>, the CAN frame, the protocol vocabulary (NMT, SDO, EMCY, PDO, drive states) and the configuration.
The driver speaks classic CAN with 11-bit identifiers. Everything here is a plain value type; the frame codecs are in canopen_client_protocol.hpp and the client class in canopen_client.hpp.