TMC9660 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
tmc9660_kconfig.hpp
Go to the documentation of this file.
1
17#ifndef TMC9660_KCONFIG_HPP
18#define TMC9660_KCONFIG_HPP
19
20#ifdef __has_include
21#if __has_include("sdkconfig.h")
22#include "sdkconfig.h"
23#endif
24#endif
25
26#include "tmc9660_types.hpp"
27
28#ifndef CONFIG_TMC9660_DEVICE_ADDRESS
30#define CONFIG_TMC9660_DEVICE_ADDRESS 1
31#endif
32#ifndef CONFIG_TMC9660_BOOT_TIMEOUT_MS
34#define CONFIG_TMC9660_BOOT_TIMEOUT_MS 500
35#endif
36
37namespace tmc9660 {
38
44constexpr Config KconfigDefaults() noexcept {
45 Config c{};
46#ifdef CONFIG_TMC9660_MODE_BOOTLOADER
48#elif defined(CONFIG_TMC9660_MODE_REGISTER)
49 c.mode = Mode::Register;
50#else
51 c.mode = Mode::Parameter;
52#endif
53 c.device_address = static_cast<uint8_t>(CONFIG_TMC9660_DEVICE_ADDRESS);
54 c.boot_timeout_ms = static_cast<uint32_t>(CONFIG_TMC9660_BOOT_TIMEOUT_MS);
55#if defined(CONFIG_TMC9660_HARDWARE_RESET) && CONFIG_TMC9660_HARDWARE_RESET
56 c.hardware_reset = true;
57#endif
58#if defined(CONFIG_TMC9660_NO_UART_CANARY) && CONFIG_TMC9660_NO_UART_CANARY
59 c.uart_canary = false;
60#endif
61 return c;
62}
63
64} // namespace tmc9660
65
66#endif // TMC9660_KCONFIG_HPP
@ Register
The application in register mode: direct register access.
@ Bootloader
The bootloader: GET_INFO, memory access, configuration.
@ Parameter
The application in parameter mode: TMCL commands.
The TMC9660 driver: everything it declares lives here; internals in detail.
Definition tmc9660.hpp:37
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the Config{} defaults.
Definition tmc9660_kconfig.hpp:44
Configuration of the driver. The defaults are the chip's.
Definition tmc9660_types.hpp:461
Mode mode
The protocol the chip is in at EnsureInitialized().
Definition tmc9660_types.hpp:462
#define CONFIG_TMC9660_BOOT_TIMEOUT_MS
Definition tmc9660_kconfig.hpp:34
#define CONFIG_TMC9660_DEVICE_ADDRESS
Definition tmc9660_kconfig.hpp:30
Public types of the TMC9660 driver: errors, Result<T>, the protocol enumerations, Config and its mode...