From 68826376ee5f47783c644c6604f4411ec747cd7e Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Fri, 14 Nov 2025 23:52:16 +0800
Subject: [PATCH] Add UDP DNS client source code
---
project/4.mqttd/booster/leds.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/project/4.mqttd/booster/leds.h b/project/4.mqttd/booster/leds.h
new file mode 100644
index 0000000..ddf1518
--- /dev/null
+++ b/project/4.mqttd/booster/leds.h
@@ -0,0 +1,58 @@
+/*********************************************************************************
+ * Copyright: (C) 2021 LingYun IoT System Studio
+ * All rights reserved.
+ *
+ * Filename: led.h
+ * Description: This file is used to control RGB 3-colors LED
+ *
+ *
+ * Pin connection:
+ * RGB Led Module Raspberry Pi Board
+ * R <-----> #Pin33(BCM GPIO13)
+ * G <-----> #Pin35(BCM GPIO19)
+ * B <-----> #Pin37(BCM GPIO26)
+ * GND <-----> GND
+ *
+ * System install:
+ * sudo apt install -y libgpiod-dev gpiod
+ *
+ *
+ ********************************************************************************/
+
+#ifndef _LEDS_H_
+#define _LEDS_H_
+
+#define ON 1
+#define OFF 0
+
+/* Three LEDs code */
+enum
+{
+ LED_R = 0,
+ LED_G,
+ LED_B,
+ LED_CNT,
+};
+
+/* Three LEDs hardware information */
+typedef struct led_info_s
+{
+ const char *name; /* RGB 3-color LED name */
+ int gpio; /* RGB 3-color LED BCM pin number */
+ int active;/* RGB 3-color LED active GPIO level: 0->low 1->high */
+ struct gpiod_line *line; /* libgpiod line */
+} led_info_t;
+
+/* Three LEDs API context */
+typedef struct led_ctx_s
+{
+ struct gpiod_chip *chip;
+ led_info_t *leds;
+ int count;
+} led_ctx_t;
+
+extern int init_led(led_ctx_t *ctx, int which);
+extern int term_led(led_ctx_t *ctx, int which);
+extern int turn_led(int which, int cmd);
+
+#endif /* ----- #ifndef _LEDS_H_ ----- */
--
Gitblit v1.9.1