Files
microros_turntable_controller/src/devices.hpp
2026-01-11 12:03:47 +01:00

24 lines
867 B
C++

#pragma once
#include <version.h>
#if ZEPHYR_VERSION_CODE >= ZEPHYR_VERSION(3,1,0)
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/stepper.h>
#else
#include <device.h>
#include <devicetree.h>
#endif
static const struct gpio_dt_spec uros_connection_status_led = GPIO_DT_SPEC_GET(DT_CHOSEN(uros_status_led), gpios);
static const struct gpio_dt_spec pid_offset_led = GPIO_DT_SPEC_GET(DT_CHOSEN(pid_offset_led), gpios);
static const struct gpio_dt_spec uros_error_led = GPIO_DT_SPEC_GET(DT_CHOSEN(uros_error_led), gpios);
static const struct device *rotenc0 = DEVICE_DT_GET(DT_CHOSEN(pid_rotenc));
static const struct device *stepper0 = DEVICE_DT_GET(DT_CHOSEN(pid_stepper));
static const struct device *pid_counter = DEVICE_DT_GET(DT_CHOSEN(pid_counter));
bool verify_are_devices_available(void);