mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
Lint
This commit is contained in:
+40
-29
@@ -5,49 +5,60 @@
|
||||
#ifdef __aarch64__
|
||||
#include <gpiod.h>
|
||||
#else
|
||||
struct gpiod_line_request{};
|
||||
struct gpiod_request_config{};
|
||||
struct gpiod_line_settings{};
|
||||
struct gpiod_line_config{};
|
||||
struct gpiod_chip{};
|
||||
enum gpiod_line_value {
|
||||
GPIOD_LINE_VALUE_ERROR = -1,
|
||||
/**< Returned to indicate an error when reading the value. */
|
||||
GPIOD_LINE_VALUE_INACTIVE = 0,
|
||||
/**< Line is logically inactive. */
|
||||
GPIOD_LINE_VALUE_ACTIVE = 1,
|
||||
/**< Line is logically active. */
|
||||
struct gpiod_line_request
|
||||
{
|
||||
};
|
||||
enum gpiod_line_direction {
|
||||
GPIOD_LINE_DIRECTION_AS_IS = 1,
|
||||
/**< Request the line(s), but don't change direction. */
|
||||
GPIOD_LINE_DIRECTION_INPUT,
|
||||
/**< Direction is input - for reading the value of an externally driven
|
||||
* GPIO line. */
|
||||
GPIOD_LINE_DIRECTION_OUTPUT,
|
||||
/**< Direction is output - for driving the GPIO line. */
|
||||
struct gpiod_request_config
|
||||
{
|
||||
};
|
||||
struct gpiod_line_settings
|
||||
{
|
||||
};
|
||||
struct gpiod_line_config
|
||||
{
|
||||
};
|
||||
struct gpiod_chip
|
||||
{
|
||||
};
|
||||
enum gpiod_line_value
|
||||
{
|
||||
GPIOD_LINE_VALUE_ERROR = -1,
|
||||
/**< Returned to indicate an error when reading the value. */
|
||||
GPIOD_LINE_VALUE_INACTIVE = 0,
|
||||
/**< Line is logically inactive. */
|
||||
GPIOD_LINE_VALUE_ACTIVE = 1,
|
||||
/**< Line is logically active. */
|
||||
};
|
||||
enum gpiod_line_direction
|
||||
{
|
||||
GPIOD_LINE_DIRECTION_AS_IS = 1,
|
||||
/**< Request the line(s), but don't change direction. */
|
||||
GPIOD_LINE_DIRECTION_INPUT,
|
||||
/**< Direction is input - for reading the value of an externally driven
|
||||
* GPIO line. */
|
||||
GPIOD_LINE_DIRECTION_OUTPUT,
|
||||
/**< Direction is output - for driving the GPIO line. */
|
||||
};
|
||||
#endif
|
||||
|
||||
class GPIO : public QObject {
|
||||
class GPIO : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Direction {
|
||||
enum Direction
|
||||
{
|
||||
Input,
|
||||
Output
|
||||
};
|
||||
explicit GPIO(Direction dir, uint8_t gpio, bool state = false, QObject* parent = nullptr);
|
||||
explicit GPIO(Direction dir, uint8_t gpio, bool state = false, QObject *parent = nullptr);
|
||||
~GPIO();
|
||||
void set_value(bool val);
|
||||
bool value();
|
||||
|
||||
private:
|
||||
struct gpiod_line_request *
|
||||
request_output_line(const char *chip_path, unsigned int offset,
|
||||
enum gpiod_line_value value, const char *consumer);
|
||||
struct gpiod_line_request *request_input_line(const char *chip_path,
|
||||
unsigned int offset,
|
||||
const char *consumer);
|
||||
struct gpiod_line_request *request_output_line(const char *chip_path, unsigned int offset,
|
||||
enum gpiod_line_value value, const char *consumer);
|
||||
struct gpiod_line_request *request_input_line(const char *chip_path, unsigned int offset, const char *consumer);
|
||||
|
||||
struct gpiod_line_request *m_request;
|
||||
unsigned int m_offset;
|
||||
|
||||
Reference in New Issue
Block a user