--- /dev/null
+/*
+ * Copyright (C) 2015 Czech Technical University in Prague
+ *
+ * Authors:
+ * - Michal Sojka <sojkam1@fel.cvut.cz>
+ *
+ * This document contains proprietary information belonging to Czech
+ * Technical University in Prague. Passing on and copying of this
+ * document, and communication of its contents is not permitted
+ * without prior written authorization.
+ *
+ */
+
+#include "drv/gio_tab.h"
+
+const struct gio_pin gio_table[_PIN_COUNT] = {
+ #define GIO_PIN_DEF_GEN(name, port, pin, conf) { .pin_name = #name, .pin_dsc = GIO_PIN_DESC(GIO_PORT_##port, pin, conf) },
+ #include "drv/gio_def.h"
+ #undef GIO_PIN_DEF_GEN
+};
+
+int8_t port_gioset_get(const struct port_desc *port, void *values, size_t size)
+{
+ int i;
+ uint32_t val = 0;
+
+ if (size != sizeof(uint32_t) ||
+ port->numchn > 32 ||
+ port->bpch != 1)
+ return FAILURE;
+
+ for (i = 0; i < port->numchn; i++)
+ val |= gio_tab_get(port->cfg.gioset.pins[i]) ? (1 << i) : 0;
+
+ *(uint32_t*)values = val;
+ return SUCCESS;
+}
+
+int8_t port_gioset_set(const struct port_desc *port, void *values, size_t size)
+{
+ int i;
+
+ if (size != sizeof(uint32_t) ||
+ port->numchn > 32 ||
+ port->bpch != 1)
+ return FAILURE;
+
+ for (i = 0; i < port->numchn; i++)
+ gio_tab_set(port->cfg.gioset.pins[i], *(uint32_t*)values & (1 << i));
+
+ return SUCCESS;
+}