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 #include "drv/gio_tab.h"
16 const struct gio_pin gio_table[_PIN_COUNT] = {
17 #define GIO_PIN_DEF_GEN(name, port, pin, conf) { .pin_name = #name, .pin_dsc = GIO_PIN_DESC(GIO_PORT_##port, pin, conf) },
18 #include "drv/gio_def.h"
19 #undef GIO_PIN_DEF_GEN
22 int8_t port_gioset_get(const struct port_desc *port, void *values, size_t size)
27 if (size != sizeof(uint32_t) ||
32 for (i = 0; i < port->numchn; i++)
33 val |= gio_tab_get(port->cfg.gioset.pins[i]) ? (1 << i) : 0;
35 *(uint32_t*)values = val;
39 int8_t port_gioset_set(const struct port_desc *port, void *values, size_t size)
43 if (size != sizeof(uint32_t) ||
48 for (i = 0; i < port->numchn; i++)
49 gio_tab_set(port->cfg.gioset.pins[i], *(uint32_t*)values & (1 << i));