CANOPEN_CLIENT Driver 0.1.0
API reference
Loading...
Searching...
No Matches
canopen_client_kconfig.hpp
Go to the documentation of this file.
1
11#ifndef CANOPEN_CLIENT_KCONFIG_HPP
12#define CANOPEN_CLIENT_KCONFIG_HPP
13
14#ifdef __has_include
15#if __has_include("sdkconfig.h")
16#include "sdkconfig.h"
17#endif
18#endif
19
21
22#ifndef CONFIG_CANOPEN_CLIENT_SDO_TIMEOUT_MS
24#define CONFIG_CANOPEN_CLIENT_SDO_TIMEOUT_MS 200
25#endif
26#ifndef CONFIG_CANOPEN_CLIENT_GUARD_TIMEOUT_MS
28#define CONFIG_CANOPEN_CLIENT_GUARD_TIMEOUT_MS 100
29#endif
30#ifndef CONFIG_CANOPEN_CLIENT_DRIVE_TIMEOUT_MS
32#define CONFIG_CANOPEN_CLIENT_DRIVE_TIMEOUT_MS 2000
33#endif
34#ifndef CONFIG_CANOPEN_CLIENT_DRIVE_POLL_INTERVAL_MS
36#define CONFIG_CANOPEN_CLIENT_DRIVE_POLL_INTERVAL_MS 10
37#endif
38#ifndef CONFIG_CANOPEN_CLIENT_SAFETY_ATTEMPTS
40#define CONFIG_CANOPEN_CLIENT_SAFETY_ATTEMPTS 3
41#endif
42
43namespace canopen_client {
44
54constexpr Config KconfigDefaults() noexcept {
55 Config c{};
56 c.sdo_timeout_us = static_cast<uint32_t>(CONFIG_CANOPEN_CLIENT_SDO_TIMEOUT_MS) * 1000U;
57 c.guard_timeout_us = static_cast<uint32_t>(CONFIG_CANOPEN_CLIENT_GUARD_TIMEOUT_MS) * 1000U;
58 c.drive_timeout_us = static_cast<uint32_t>(CONFIG_CANOPEN_CLIENT_DRIVE_TIMEOUT_MS) * 1000U;
59 c.drive_poll_interval_us =
60 static_cast<uint32_t>(CONFIG_CANOPEN_CLIENT_DRIVE_POLL_INTERVAL_MS) * 1000U;
61 c.safety_attempts = static_cast<uint8_t>(CONFIG_CANOPEN_CLIENT_SAFETY_ATTEMPTS);
62#ifdef CONFIG_CANOPEN_CLIENT
63#ifdef CONFIG_CANOPEN_CLIENT_ABORT_ON_TIMEOUT
64 c.abort_on_timeout = true;
65#else
66 c.abort_on_timeout = false;
67#endif
68#ifdef CONFIG_CANOPEN_CLIENT_STRICT_SDO_LENGTH
69 c.strict_sdo_length = true;
70#else
71 c.strict_sdo_length = false;
72#endif
73#endif
74 return c;
75}
76
77} // namespace canopen_client
78
79#endif // CANOPEN_CLIENT_KCONFIG_HPP
#define CONFIG_CANOPEN_CLIENT_DRIVE_POLL_INTERVAL_MS
Definition canopen_client_kconfig.hpp:36
#define CONFIG_CANOPEN_CLIENT_SAFETY_ATTEMPTS
Definition canopen_client_kconfig.hpp:40
#define CONFIG_CANOPEN_CLIENT_GUARD_TIMEOUT_MS
Definition canopen_client_kconfig.hpp:28
#define CONFIG_CANOPEN_CLIENT_DRIVE_TIMEOUT_MS
Definition canopen_client_kconfig.hpp:32
#define CONFIG_CANOPEN_CLIENT_SDO_TIMEOUT_MS
Definition canopen_client_kconfig.hpp:24
Public types of the CANopen client driver: errors, Result<T>, the CAN frame, the protocol vocabulary ...
The CANopen client driver: everything it declares lives here; internals in detail.
Definition canopen_client.hpp:28
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the defaults.
Definition canopen_client_kconfig.hpp:54
Everything the client uses; the defaults suit a node on a 500 kbit/s bus.
Definition canopen_client_types.hpp:580
uint32_t sdo_timeout_us
Wait for each SDO reply, 1 ms to 60 s.
Definition canopen_client_types.hpp:581