source: rtems-libbsd/rtemsbsd/include/rtems/bsd/local/gpio_if.h @ c40e45b

55-freebsd-126-freebsd-12
Last change on this file since c40e45b was c40e45b, checked in by Sebastian Huber <sebastian.huber@…>, on 10/07/16 at 13:10:20

Update to FreeBSD head 2016-08-23

Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd.

  • Property mode set to 100644
File size: 5.2 KB
Line 
1/*
2 * This file is produced automatically.
3 * Do not modify anything in here by hand.
4 *
5 * Created from source file
6 *   freebsd-org/sys/dev/gpio/gpio_if.m
7 * with
8 *   makeobjops.awk
9 *
10 * See the source file for legal information
11 */
12
13
14#ifndef _gpio_if_h_
15#define _gpio_if_h_
16
17
18#include <dev/ofw/openfirm.h>
19
20/** @brief Unique descriptor for the GPIO_GET_BUS() method */
21extern struct kobjop_desc gpio_get_bus_desc;
22/** @brief A function implementing the GPIO_GET_BUS() method */
23typedef device_t gpio_get_bus_t(device_t dev);
24
25static __inline device_t GPIO_GET_BUS(device_t dev)
26{
27        kobjop_t _m;
28        KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_get_bus);
29        return ((gpio_get_bus_t *) _m)(dev);
30}
31
32/** @brief Unique descriptor for the GPIO_PIN_MAX() method */
33extern struct kobjop_desc gpio_pin_max_desc;
34/** @brief A function implementing the GPIO_PIN_MAX() method */
35typedef int gpio_pin_max_t(device_t dev, int *maxpin);
36
37static __inline int GPIO_PIN_MAX(device_t dev, int *maxpin)
38{
39        kobjop_t _m;
40        KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_max);
41        return ((gpio_pin_max_t *) _m)(dev, maxpin);
42}
43
44/** @brief Unique descriptor for the GPIO_PIN_SET() method */
45extern struct kobjop_desc gpio_pin_set_desc;
46/** @brief A function implementing the GPIO_PIN_SET() method */
47typedef int gpio_pin_set_t(device_t dev, uint32_t pin_num, uint32_t pin_value);
48
49static __inline int GPIO_PIN_SET(device_t dev, uint32_t pin_num,
50                                 uint32_t pin_value)
51{
52        kobjop_t _m;
53        KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_set);
54        return ((gpio_pin_set_t *) _m)(dev, pin_num, pin_value);
55}
56
57/** @brief Unique descriptor for the GPIO_PIN_GET() method */
58extern struct kobjop_desc gpio_pin_get_desc;
59/** @brief A function implementing the GPIO_PIN_GET() method */
60typedef int gpio_pin_get_t(device_t dev, uint32_t pin_num, uint32_t *pin_value);
61
62static __inline int GPIO_PIN_GET(device_t dev, uint32_t pin_num,
63                                 uint32_t *pin_value)
64{
65        kobjop_t _m;
66        KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_get);
67        return ((gpio_pin_get_t *) _m)(dev, pin_num, pin_value);
68}
69
70/** @brief Unique descriptor for the GPIO_PIN_TOGGLE() method */
71extern struct kobjop_desc gpio_pin_toggle_desc;
72/** @brief A function implementing the GPIO_PIN_TOGGLE() method */
73typedef int gpio_pin_toggle_t(device_t dev, uint32_t pin_num);
74
75static __inline int GPIO_PIN_TOGGLE(device_t dev, uint32_t pin_num)
76{
77        kobjop_t _m;
78        KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_toggle);
79        return ((gpio_pin_toggle_t *) _m)(dev, pin_num);
80}
81
82/** @brief Unique descriptor for the GPIO_PIN_GETCAPS() method */
83extern struct kobjop_desc gpio_pin_getcaps_desc;
84/** @brief A function implementing the GPIO_PIN_GETCAPS() method */
85typedef int gpio_pin_getcaps_t(device_t dev, uint32_t pin_num, uint32_t *caps);
86
87static __inline int GPIO_PIN_GETCAPS(device_t dev, uint32_t pin_num,
88                                     uint32_t *caps)
89{
90        kobjop_t _m;
91        KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_getcaps);
92        return ((gpio_pin_getcaps_t *) _m)(dev, pin_num, caps);
93}
94
95/** @brief Unique descriptor for the GPIO_PIN_GETFLAGS() method */
96extern struct kobjop_desc gpio_pin_getflags_desc;
97/** @brief A function implementing the GPIO_PIN_GETFLAGS() method */
98typedef int gpio_pin_getflags_t(device_t dev, uint32_t pin_num,
99                                uint32_t *flags);
100
101static __inline int GPIO_PIN_GETFLAGS(device_t dev, uint32_t pin_num,
102                                      uint32_t *flags)
103{
104        kobjop_t _m;
105        KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_getflags);
106        return ((gpio_pin_getflags_t *) _m)(dev, pin_num, flags);
107}
108
109/** @brief Unique descriptor for the GPIO_PIN_GETNAME() method */
110extern struct kobjop_desc gpio_pin_getname_desc;
111/** @brief A function implementing the GPIO_PIN_GETNAME() method */
112typedef int gpio_pin_getname_t(device_t dev, uint32_t pin_num, char *name);
113
114static __inline int GPIO_PIN_GETNAME(device_t dev, uint32_t pin_num, char *name)
115{
116        kobjop_t _m;
117        KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_getname);
118        return ((gpio_pin_getname_t *) _m)(dev, pin_num, name);
119}
120
121/** @brief Unique descriptor for the GPIO_PIN_SETFLAGS() method */
122extern struct kobjop_desc gpio_pin_setflags_desc;
123/** @brief A function implementing the GPIO_PIN_SETFLAGS() method */
124typedef int gpio_pin_setflags_t(device_t dev, uint32_t pin_num, uint32_t flags);
125
126static __inline int GPIO_PIN_SETFLAGS(device_t dev, uint32_t pin_num,
127                                      uint32_t flags)
128{
129        kobjop_t _m;
130        KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_setflags);
131        return ((gpio_pin_setflags_t *) _m)(dev, pin_num, flags);
132}
133
134/** @brief Unique descriptor for the GPIO_MAP_GPIOS() method */
135extern struct kobjop_desc gpio_map_gpios_desc;
136/** @brief A function implementing the GPIO_MAP_GPIOS() method */
137typedef int gpio_map_gpios_t(device_t bus, phandle_t dev, phandle_t gparent,
138                             int gcells, pcell_t *gpios, uint32_t *pin,
139                             uint32_t *flags);
140
141static __inline int GPIO_MAP_GPIOS(device_t bus, phandle_t dev,
142                                   phandle_t gparent, int gcells,
143                                   pcell_t *gpios, uint32_t *pin,
144                                   uint32_t *flags)
145{
146        kobjop_t _m;
147        KOBJOPLOOKUP(((kobj_t)bus)->ops,gpio_map_gpios);
148        return ((gpio_map_gpios_t *) _m)(bus, dev, gparent, gcells, gpios, pin, flags);
149}
150
151#endif /* _gpio_if_h_ */
Note: See TracBrowser for help on using the repository browser.