We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2a8017 commit 22cdc59Copy full SHA for 22cdc59
1 file changed
src/ZeDMDSpi.h
@@ -9,9 +9,15 @@
9
#include "ZeDMDComm.h"
10
11
#if defined(SPI_SUPPORT)
12
+#include <gpiod.h>
13
#include <linux/spi/spidev.h>
14
15
+#define GPIO_CHIP "/dev/gpiochip0"
16
#define SPI_DEVICE "/dev/spidev1.0"
17
+#else
18
+// Forward declarations so non-Linux builds can compile the stub implementation.
19
+struct gpiod_chip;
20
+struct gpiod_line;
21
#endif
22
23
class ZeDMDSpi : public ZeDMDComm
@@ -46,5 +52,9 @@ class ZeDMDSpi : public ZeDMDComm
46
52
uint32_t m_speed = 72000000; // 72MHz
47
53
uint8_t m_framePause = 0; // 0ms
48
54
int m_fileDescriptor = -1;
55
+#if defined(SPI_SUPPORT)
56
+ gpiod_chip* m_gpioChip = nullptr;
57
+ gpiod_line* m_csLine = nullptr;
58
+#endif
49
59
bool m_connected = false;
50
60
};
0 commit comments