2 * Copyright (C) 2015 Czech Technical University in Prague
5 * - Michal Sojka <sojkam1@fel.cvut.cz>
7 * This document contains proprietary information belonging to Czech
8 * Technical University in Prague. Passing on and copying of this
9 * document, and communication of its contents is not permitted
10 * without prior written authorization.
14 #ifndef DRV_GIO_PIN_TAB_H
15 #define DRV_GIO_PIN_TAB_H
18 #include "drv/gio_names.h"
22 const char *pin_name; // Pin name
23 uint32_t pin_dsc; // Pin descriptor computed with GIO_PIN_DESC
26 extern const struct gio_pin gio_table[_PIN_COUNT];
29 * We don't use enum pin_name here, because it prevents us doing
30 * arithmetic operations like (PIN_DIN8 + 1). The enum is used in the
31 * rpp layer, where it protects users from doing stupid things.
33 static inline void gio_tab_set(/* enum pin_name */int pin, boolean_t val)
35 gio_set(gio_table[pin].pin_dsc, val);
38 static inline boolean_t gio_tab_get(/* enum pin_name */int pin)
40 return gio_get(gio_table[pin].pin_dsc);
43 int8_t port_gioset_get(const struct port_desc *port, void *values, size_t size);
44 int8_t port_gioset_set(const struct port_desc *port, void *values, size_t size);