Debian Codegraph @

bindings/glib/gpiod-glib/chip-info.h

raw symbols SCIP
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 /* SPDX-FileCopyrightText: 2022-2024 Bartosz Golaszewski <[email protected]> */
3
4 #ifndef __GPIODGLIB_CHIP_INFO_H__
5 #define __GPIODGLIB_CHIP_INFO_H__
6
7 #if !defined(__INSIDE_GPIOD_GLIB_H__) && !defined(GPIODGLIB_COMPILATION)
8 #error "Only <gpiod-glib.h> can be included directly."
9 #endif
10
11 #include <glib.h>
12 #include <glib-object.h>
13
14 G_BEGIN_DECLS
15
16 G_DECLARE_FINAL_TYPE(GpiodglibChipInfo, gpiodglib_chip_info,
17 GPIODGLIB, CHIP_INFO, GObject);
18
19 #define GPIODGLIB_CHIP_INFO_TYPE (gpiodglib_chip_info_get_type())
20 #define GPIODGLIB_CHIP_INFO_OBJ(obj) \
21 (G_TYPE_CHECK_INSTANCE_CAST((obj), GPIODGLIB_CHIP_INFO_TYPE, \
22 GpiodglibChipInfo))
23
24 /**
25 * gpiodglib_chip_info_dup_name:
26 * @self: #GpiodglibChipInfo to manipulate.
27 *
28 * Get the name of the chip as represented in the kernel.
29 *
30 * Returns: (transfer full): Valid pointer to a human-readable string
31 * containing the chip name. The returned string is a copy and must be freed by
32 * the caller using g_free().
33 */
34 gchar * G_GNUC_WARN_UNUSED_RESULT
35 gpiodglib_chip_info_dup_name(GpiodglibChipInfo *self);
36
37 /**
38 * gpiodglib_chip_info_dup_label:
39 * @self: #GpiodglibChipInfo to manipulate.
40 *
41 * Get the label of the chip as represented in the kernel.
42 *
43 * Returns: (transfer full): Valid pointer to a human-readable string
44 * containing the chip label. The returned string is a copy and must be freed
45 * by the caller using g_free().
46 */
47 gchar * G_GNUC_WARN_UNUSED_RESULT
48 gpiodglib_chip_info_dup_label(GpiodglibChipInfo *self);
49
50 /**
51 * gpiodglib_chip_info_get_num_lines:
52 * @self: #GpiodglibChipInfo to manipulate.
53 *
54 * Get the number of lines exposed by the chip.
55 *
56 * Returns: Number of GPIO lines.
57 */
58 guint gpiodglib_chip_info_get_num_lines(GpiodglibChipInfo *self);
59
60 G_END_DECLS
61
62 #endif /* __GPIODGLIB_CHIP_INFO_H__ */