DYNAMIXEL Driver 0.1.0
API reference
Loading...
Searching...
No Matches
dynamixel_kconfig.hpp
Go to the documentation of this file.
1
20#ifndef DYNAMIXEL_KCONFIG_HPP
21#define DYNAMIXEL_KCONFIG_HPP
22
23#ifdef __has_include
24#if __has_include("sdkconfig.h")
25#include "sdkconfig.h"
26#endif
27#endif
28
29#include "dynamixel_types.hpp"
30
31#ifndef CONFIG_DYNAMIXEL_BAUD
33#define CONFIG_DYNAMIXEL_BAUD 57600
34#endif
35#ifndef CONFIG_DYNAMIXEL_REPLY_TIMEOUT_US
37#define CONFIG_DYNAMIXEL_REPLY_TIMEOUT_US 20000
38#endif
39#ifndef CONFIG_DYNAMIXEL_RETRIES
41#define CONFIG_DYNAMIXEL_RETRIES 1
42#endif
43
44namespace dynamixel {
45
51constexpr Config KconfigDefaults() noexcept {
52 Config c{};
53#ifdef CONFIG_DYNAMIXEL_PROTOCOL_1
55#else
56 c.protocol = Protocol::V2;
57#endif
58 c.baud = static_cast<uint32_t>(CONFIG_DYNAMIXEL_BAUD);
59 c.reply_timeout_us = static_cast<uint32_t>(CONFIG_DYNAMIXEL_REPLY_TIMEOUT_US);
60 c.retries = static_cast<uint8_t>(CONFIG_DYNAMIXEL_RETRIES);
61#if defined(CONFIG_DYNAMIXEL_ECHO_LOOPBACK) && CONFIG_DYNAMIXEL_ECHO_LOOPBACK
62 c.echo = EchoMode::Loopback;
63#endif
64 return c;
65}
66
67} // namespace dynamixel
68
69#endif // DYNAMIXEL_KCONFIG_HPP
#define CONFIG_DYNAMIXEL_REPLY_TIMEOUT_US
Definition dynamixel_kconfig.hpp:37
#define CONFIG_DYNAMIXEL_RETRIES
Definition dynamixel_kconfig.hpp:41
#define CONFIG_DYNAMIXEL_BAUD
Definition dynamixel_kconfig.hpp:33
Public types of the DYNAMIXEL driver: errors, Result<T>, protocol enumerations, replies,...
@ V1
Protocol 1.0: header FF FF, one-byte length, additive checksum, error flags.
@ Loopback
TX and RX are tied: every sent byte is read back and compared.
The DYNAMIXEL driver: everything it declares lives here; internals in detail.
Definition dynamixel.hpp:35
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the defaults.
Definition dynamixel_kconfig.hpp:51
Everything the driver needs to know about the bus.
Definition dynamixel_types.hpp:385
Protocol protocol
Packet format of every servo on the bus.
Definition dynamixel_types.hpp:386